How to use
Divider is a horizontal or vertical rule for separating content — sections of a page, items in a list, a sidebar from its main content. It optionally carries an inline label ("OR", a date, a section name), splitting the line into two segments around it instead of just interrupting it.
import { Divider } from "oks-ui";orientation defaults to horizontal. A vertical Divider needs an explicit height from its container (flex/grid context) to actually render a visible line — it doesn't invent a height on its own the way a horizontal rule fills its container's width.
<Divider />
<div className="flex h-6 items-center gap-3">
<span>Profile</span>
<Divider orientation="vertical" />
<span>Settings</span>
</div>variant controls how the line relates to its container's edges: fullWidth (the default) spans edge to edge; inset stops short of one end (useful in a list where the line shouldn't run under a leading icon); middle stops short of both ends.
<Divider variant="inset" />
<Divider variant="middle" />lineStyle switches between solid (the default), dashed, and dotted. color takes the usual semantic palette, and thickness lets you override the line weight directly when the default doesn't match a specific design need.
<Divider lineStyle="dashed" color="primary" />
<Divider thickness={2} />Pass children and Divider renders as two line segments with the content between them — the standard "OR" pattern between two sign-in options, a date separator in a message list, a small section label inline in a long form. labelPlacement moves the label toward the start, center (default), or end of the line.
<Divider>OR</Divider>
<Divider labelPlacement="start">Yesterday</Divider>All available props for Divider. See the full component page for an interactive playground.
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | — | Optional inline label; renders the line in two segments around it. |
children
ReactNode
Default: —
Optional inline label; renders the line in two segments around it.
| Prop | Type | Default | Description |
|---|---|---|---|
orientation | "horizontal" | "vertical" | horizontal | Line direction. |
variant | "fullWidth" | "inset" | "middle" | fullWidth | Inset behavior at the line's ends. |
lineStyle | "solid" | "dashed" | "dotted" | solid | Line style. |
color | "default" | "primary" | "secondary" | "info" | "success" | "warning" | "danger" | string | default | Line color. |
colorDepth | 50 | 100 | ... | 950 | 300 | Shade depth for the selected color. |
thickness | number | string | — | Line thickness override. |
orientation
"horizontal" | "vertical"
Default: horizontal
Line direction.
variant
"fullWidth" | "inset" | "middle"
Default: fullWidth
Inset behavior at the line's ends.
lineStyle
"solid" | "dashed" | "dotted"
Default: solid
Line style.
color
"default" | "primary" | "secondary" | "info" | "success" | "warning" | "danger" | string
Default: default
Line color.
colorDepth
50 | 100 | ... | 950
Default: 300
Shade depth for the selected color.
thickness
number | string
Default: —
Line thickness override.
| Prop | Type | Default | Description |
|---|---|---|---|
labelPlacement | "start" | "center" | "end" | center | Where a label renders along the line, when children are provided. |
labelPlacement
"start" | "center" | "end"
Default: center
Where a label renders along the line, when children are provided.
| Prop | Type | Default | Description |
|---|---|---|---|
className | string | — | Class applied to the root element. |
className
string
Default: —
Class applied to the root element.