Center

Centers content vertically and horizontally
Import

Usage

All elements inside Center are centered
import { Center } from '@mantine/core';
function Demo() {
return (
<Center style={{ width: 400, height: 200 }}>
<div>All elements inside Center are centered</div>
</Center>
);
}

Inline

To use center with inline elements set inline prop. For example, you can center link icon and label:

import { Center, Anchor, Box } from '@mantine/core';
import { ArrowLeft } from 'tabler-icons-react';
function Demo() {
return (
<Anchor href="https://mantine.dev" target="_blank">
<Center inline>
<ArrowLeft size={14} />
<Box ml={5}>Back to Mantine website</Box>
</Center>
</Anchor>
);
}