Divider
Horizontal line with optional label or vertical divider
Import
Source
Docs
Package
Usage
import { Divider } from '@mantine/core';
function Demo() {
return (
<>
<Divider my="sm" />
<Divider my="sm" variant="dashed" />
<Divider my="sm" variant="dotted" />
</>
);
}
With label
import { Divider, Box, Anchor } from '@mantine/core';
import { IconSearch } from '@tabler/icons-react';
function Demo() {
return (
<>
<Divider my="xs" label="Label on the left" labelPosition="left" />
<Divider my="xs" label="Label in the center" labelPosition="center" />
<Divider my="xs" label="Label on the right" labelPosition="right" />
<Divider
my="xs"
variant="dashed"
labelPosition="center"
label={
<>
<IconSearch size={12} />
<Box ml={5}>Search results</Box>
</>
}
/>
<Divider
my="xs"
label={
<Anchor href="https://mantine.dev" target="_blank" inherit>
Link label
</Anchor>
}
/>
</>
);
}
Sizes
import { Divider } from '@mantine/core';
function Demo() {
return (
<>
<Divider size="xs" />
<Divider size="sm" />
<Divider size="md" />
<Divider size="lg" />
<Divider size="xl" />
<Divider size={10} />
</>
);
}
Vertical orientation
Label
Label
Label
Label
Label
Label
import { Divider, Group, Text } from '@mantine/core';
function Demo() {
return (
<Group>
<Text>Label</Text>
<Divider orientation="vertical" />
<Text>Label</Text>
<Divider size="sm" orientation="vertical" />
<Text>Label</Text>
<Divider size="md" orientation="vertical" />
<Text>Label</Text>
<Divider size="lg" orientation="vertical" />
<Text>Label</Text>
<Divider size="xl" orientation="vertical" />
<Text>Label</Text>
</Group>
);
}
Welcome to Mantine, React components library that you always wished for
Build fully functional accessible web applications faster than ever