Divider
Visual separator for content sections with horizontal, vertical, and text variants.
import { Divider } from "@ninna-ui/primitives"pnpm add @ninna-ui/primitivesRequires @ninna-ui/core (auto-installed) + CSS setup.
Usage
Import and use the Divider component in your application.
import { Divider , Code } from "@ninna-ui/primitives";
export default function Example() { return ( <div> <Divider variant="horizontal" /> <Divider variant="vertical" className="h-20" /> <Divider variant="with-text" text="OR" color="primary" /> </div> );}Horizontal
Horizontal dividers for separating content vertically
Soft (default)
Solid
Vertical
Vertical dividers for separating content horizontally
With Text
Dividers with centered text for labeled sections
Colors
All color variants for with-text dividers
Use Cases
Real-world divider usage examples
Content Sections
Section 1
This is the first section of content with some descriptive text.
Section 2
This is the second section separated by a horizontal divider.
Login Form
Sidebar Layout
Main Content
This is the main content area.
Sidebar
This is the sidebar content.
List Items
Item 1
Description for item 1
Item 2
Description for item 2
Item 3
Description for item 3
Section Headers
Content related to personal information goes here.
Content related to account settings goes here.
API Reference
Complete list of props for the Divider component.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
variant | 'horizontal' | 'vertical' | 'with-text' | 'horizontal' | Orientation and style variant of the divider |
color | 'neutral' | 'primary' | 'secondary' | 'accent' | 'info' | 'success' | 'warning' | 'danger' | 'primary' | Color theme for the text (with-text variant only) |
weight | 'soft' | 'solid' | 'soft' | Line weight/opacity - soft for subtle, solid for prominent |
text | string | undefined | Text to display (only for with-text variant) |
className | string | undefined | Additional CSS classes |
Accessibility
- Uses semantic
role="separator"for screen readers - Includes
aria-orientationattribute for horizontal and vertical variants - For with-text variant, uses
aria-labelto announce the text content - Dividers are non-interactive and purely presentational
- Color contrast meets WCAG AA standards for all weight variants
- Works correctly in both light and dark modes