Divider
The Divider component is a versatile UI element used to create visual separation between content sections, groups, or list items. It helps improve readability and provides a clean, structured layout in user interfaces.
Import
import { VKDivider } from "@vivakits/react-components";
Direction
The Divider component supports both horizontal and vertical orientations using the direction
prop.
Color
The Divider component comes with 7 different colors that you can change using the color
prop.
Variant
The Divider supports different line styles through the variant
prop.
Thickness
The Divider thickness can be customized using the thickness
prop.
Position
The content position can be adjusted using the position
prop.
Inset
The Divider can be inset from its container using the inset
prop.
Content Color
The color of the content text can be customized independently using the contentColor
prop.
API Reference
Attribute | Type | Description | Default |
---|---|---|---|
direction | horizontalvertical | Sets the direction of the divider | horizontal |
color | primarysecondaryaccentsuccesswarningdangerdarklight | Sets the color of the divider | dark |
variant | soliddasheddotted | Sets the style of the divider line | solid |
thickness | thinmediumthickstringnumber | Sets the thickness of the divider | thin |
children | ReactNode | Content to display within the divider | - |
contentColor | primarysecondaryaccentsuccesswarningdangerdarklight | Sets the color of the content text | dark |
contentMaxSize | xssmmdlgxlstringnumber | Sets the maximum size of the content within the divider | - |
position | startcenterend | Sets the position of the content | center |
inset | nonesmmdlgxlstringnumber | Sets the margin space on both sides | none |
size | string | number | Sets the width (horizontal) or height (vertical) | auto/100% |
className | string | Additional CSS classes | - |
contentWrapperClassName | string | Additional CSS classes for content wrapper | - |
dividerWrapperClassName | string | Additional CSS classes for divider wrapper | - |