React Native MantineMiscellaneous

Divider

Visual separator with label support

Import: import { Divider } from 'react-native-mantine';

Usage

import { Divider, Stack, Text } from 'react-native-mantine';

// Basic divider
<Stack spacing={16}>
  <Text>Section 1</Text>
  <Divider />
  <Text>Section 2</Text>
</Stack>

// Divider with label
<Divider label="Section Title" labelPosition="center" />

// Styled divider
<Divider
  variant="dashed"
  color="blue"
  size="md"
  label="Optional Label"
/>

Props

PropTypeDefaultDescription
orientation'horizontal' | 'vertical'"horizontal"Line orientation - horizontal for separating content vertically, vertical for separating content horizontally
colorMantineColorLine color from theme. If not provided, uses theme.colors.gray[3] in light mode and theme.colors.dark[4] in dark mode
sizenumber | "xs" | "sm" | "md" | "lg" | "xl""sm"Line thickness as predefined size or custom number in pixels
labelReact.ReactNodeLabel to display in the divider. Can be text or any React component. Divides the line with label in the middle
labelPosition'left' | 'center' | 'right'"center"Position of the label within the divider. Affects the length of lines on each side
variant'solid' | 'dashed' | 'dotted'"solid"Divider line style
styleViewStyleAdditional styles to apply to the divider container

Source on GitHub · npm