Skip to content
Nana UI

Layout & Containers

Divider

A separator between content or layout regions. Supports text/icon labels, line styles, thickness and orientation.

View .md Download

Above

Below

The divider ships for all three targets. Pick the tab for your project — the CLI detects which you are on and serves the matching implementation.

npx @nana-tec/ui add divider

Lands as src/components/ui/divider/divider.tsx, styled with Tailwind classes that resolve to the design tokens. Requires Tailwind v4.

import { Divider } from "@/components/ui/divider";
export function Example() {
return (
<>
<Divider />
<Divider label="or" />
<Divider variant="dashed" thickness="medium" />
</>
);
}

With a label it renders a rule either side of the text; without one it is a single rule. decorative drops the separator role for a divider that is purely visual. orientation="vertical" stretches to its flex parent, so it needs a sized row around it.

Classes you pass to the React and Svelte components are merged with tailwind-merge, so an override wins rather than fighting. See Using Tailwind.

OR
Left Right

The React and Svelte props, read from the components’ own types:

Divider

PropTypeDefault
orientationDividerOrientation'horizontal'
variantDividerVariant'solid'
thicknessDividerThickness'thin'
labelReactNode
insetbooleanfalse
decorativebooleanfalse
childrenReactNode

Also accepts Omit<HTMLAttributes<HTMLDivElement>, 'children'>.

The attribute names, events and CSS hooks below are the Web Components reference.

Properties

PropertyAttributeTypeDefaultDescription
decorativedecorativebooleanfalsePurely visual — removes the separator role from the a11y tree
insetinsetbooleanfalsePull the rule in from the edges
labellabelstring | undefined—Convenience text label (equivalent to slotting text)
orientationorientationDividerOrientation'horizontal'Line direction
thicknessthicknessDividerThickness'thin'Line thickness
variantvariantDividerVariant'solid'Line style

Slots

SlotDescription
(default)Optional label content (text or an icon) centred in the rule

CSS parts

PartDescription
::part(line)The rule(s)
::part(label)The label wrapper

CSS custom properties

PropertyDescription
--nana-divider-colorLine colour
--nana-divider-thicknessLine thickness (overrides the thickness attribute)
--nana-divider-gradientGradient (gradient variant)
--nana-divider-label-colorColour of the slotted label text
SlotDescription
(default)Optional label content (text or an icon) centred in the rule
VariableDescription
--nana-divider-colorLine colour
--nana-divider-thicknessLine thickness (overrides the thickness attribute)
--nana-divider-gradientGradient (gradient variant)
PartDescription
lineThe rule(s) — two <hr> elements when a label is present
labelThe label wrapper
Explore Divider interactively Every state, prop, and edge case — with live controls — in Storybook.
View in Storybook