Skip to main content

Divider

Component to separate content visually with horizontal or vertical lines.
Supports labels, custom spacing, and styling for better layout structure.

Usage Playground

Width
Height
Spacing
Color
Label
Label Position
left
right
center
Code Snippet
import { Divider } from "@react-native-blossom-ui/components";

function Usage() {
return (
<Divider/>
);
}

Usage

function DividerUsage() {
return (
<View>
<Divider />
</View>
)
}

Vertical

Use width & height prop in conjunction to have the vertical look.

function DividerVertical() {
return (
<View>
<Divider width={1} height={50} spacing={20} />
</View>
)
}

Spacing

use the spacing prop to have the around cross axis i.e vertical margin for horizontal line and horizontal margin for vertical line.

function DividerSpacing() {
return (
<View>
<Divider spacing={10} />
<Divider spacing={30} />
</View>
)
}

Label

Use the label & labelPosition prop together to show and control the position of label (left, center & right)

Left
Center
Right
Danger Area
Danger Area
Danger Area
function DividerLabel() {
return (
<View>
<Divider label="Left" labelPosition="left" />
<Divider label="Center" labelPosition="center" />
<Divider label="Right" labelPosition="right" />
<Divider spacing={20}>
<Text status="error">Danger Area</Text>
</Divider>
</View>
)
}

Custom

function DividerCustom() {
return (
<View>
<Divider width={200} height={10} spacing={20} />
</View>
)
}

Props

PropData TypeDefault ValueDescription
ExtendsViewProps--Inherits properties from ViewProps
widthDimensionValue100%Control Width of the divider
heightDimensionValue1Control height of the divider
spacingDimensionValue0Spacing around the line
colorColorValue--Color of the divider default vale from theme `background900`
labelstring--Label inside the divider
labelPosition"left" | "right" | "center"centerLabel position where it will be rendered
rowboolean--Set true for horizontal(flexDirection) view