Divider Properties
Visual separators that create hierarchy and organize content. Supports horizontal/vertical orientations, text, icons, and interactive elements.
Installation
Add Divider to your project with the CK-UI CLI. It copies the source into your project, so the code is yours to change.
- Adds
Divider.tsxto your CK-UI folder (src/components/ck-ui by default)- Installs
- No extra npm packages
First time with CK-UI in this project? Run npx ck-ui-cli@latest init once before adding components. The installation guide explains what it sets up.
Manual installationInstall the packages and copy the files yourself.
Create or update your Divider component
Copy this code to create your Divider component
Test Your Component
- 1. Add the component to a test page
- 2. Check all props and variants work as expected
- 3. Verify responsive behavior
- 4. Test with different content/data
- 5. Ensure accessibility features work correctly
Different Colors
Apply custom colors to dividers with a background class in className, for example bg-blue-500.
Line Text
Dividers with text and lines on either side, with multiple alignment options.
Text Dividers
Simple text dividers that separate content with meaningful labels.
Solid Text
Distinct text dividers with solid background for stronger visual separation.
Content
Dividers with interactive elements like buttons for enhanced functionality.
Vertical Orientation
Vertical dividers for separating horizontally aligned content.
API Reference
The Divider component provides a flexible way to create visual separations between content sections.
Divider.Root
Main divider component with support for different orientations and styles. Lines (line and vertical) render role="separator" with aria-orientation. In line-text and content the children stay readable and the lines are decorative; text and solid-text are label rows.
| Prop | Type | Default | Description |
|---|---|---|---|
variant | "line""line-text""text""solid-text""content" | "line" | Visual style of the divider |
orientation | "horizontal""vertical" | "horizontal" | vertical always renders a plain line; give it a height with className (e.g. h-6) |
align | "center""left""right" | "center" | Position of the children for line-text and content |
decorative | "boolean" | "false" | For lines only: hide a purely visual line from assistive technology instead of exposing it as a separator |
className | "string" | "undefined" | Additional CSS classes, merged last. Set the line color with a bg-* class. |
Used in these blocks
Block families with at least one block built on this component. Each page previews its blocks and lists the components and packages they use.