Skip to main content

Divider dividing line component

A divider is a thin line that groups content in lists and layouts.

Effect demonstration

1. Default effect

<Text>Divider component</Text>
<Divider />
<Text>
Lorem Ipsum is simply dummy text of the printing and typesetting
industry. Lorem Ipsum has been the industry's standard dummy text ever
since the 1500s, when an unknown printer took a galley of type and
scrambled it to make a type specimen book.
</Text>

2. The dividing line is a dotted line

<Text>Divider component</Text>
<Divider type="dashed" />
<Text>Divider component</Text>
divider-ios1

3. Vertical divider

<Flex>
<Text variant="p0" color="primary200">
hotel
</Text>
<Divider color="red" axis="vertical" height={px(20)} />
<Text variant="p0" color="primary200">
business district
</Text>
</Flex>
divider-ios1

4. Separator with text

<Divider text="I am the dividing line" />
divider-ios1

5. Custom dotted line separator

<Divider
type="dashed"
dashGap={px(30)}
dashLength={px(20)}
dashThickness={px(2)}
/>
divider-ios1

API

PropertiesRequiredDescriptionTypeDefault Value
typefalseSplitting line typesolid | dashedsolid
axisfalseSplitting line directionhorizontal | verticalhorizontal
heightfalseThe height of the dividing line when verticalnumber12
colorfalsedividing line colorstring#bbbbbb
marginfalseHorizontal top and bottom margins, vertical left and right marginsxxs | xs | s | m | l | xl \xxl
textfalseSplit line text (only supports horizontal split lines)string
textAlignfalseSplit line text positionleft | center | rightcenter
dashGapfalseDash gap widthnumber
dashLengthfalseSingle dash line widthnumber
dashThicknessfalsedash thicknessnumber