Separator
An <hr>: a 1 px border/subtle line, Figma's Divider (7370:95). Decorative by default; spacing comes first, a line only when spacing is not enough (the Figma doc).
Import
import { Separator } from '@nizivo/react/separator';
// Once per app (Getting started), after
// @nizivo/tokens/tokens.css and @nizivo/react/css/base.css
import '@nizivo/react/css/separator.css';Decorative by default
A Separator is decorative unless you say otherwise: it renders <hr role="none">, so a screen
reader skips it, as Figma's Divider (7370:95) intends ("spacing first, a line only when spacing is
not enough"). Most lines between actions, rows or card sections only draw. Pass
decorative={false} for a break that means something on its own, such as the rule above an order
total or between two groups of settings: the <hr> keeps its implicit separator role, with
aria-orientation when it is vertical.
<>
<Separator decorative={false} />
<Inline gap="3">
<span>Edit</span>
<Separator orientation="vertical" />
<span>Archive</span>
</Inline>
</>Until 2026-10-18 the default was decorative={false} (the maintainer's decision M35 changed it
before 0.1.0).
Static or interactive
Server. It ships no client JavaScript when a Server Component renders it, in every Next.js build
mode; its code is bundled only when a client component (a 'use client' file) imports it. How to
choose.
In a client app (a Vite or React Router single-page app, or a 'use client' file) it is an ordinary React component: event handlers, refs and state work as usual. In a client app.
Examples
Basic
Decorative is the default (M35, Figma Divider 7370:95): the line between two actions only draws. The rule above the total means something on its own, so it says so with decorative={false} and a screen reader hears a separator there.
Archive
import type { JSX } from 'react';
import { Inline } from '@nizivo/react/inline';
import { Stack } from '@nizivo/react/stack';
import { Separator } from '@nizivo/react/separator';
export function SeparatorExample(): JSX.Element {
return (
<Stack gap="3">
<div>Subtotal</div>
<Separator decorative={false} />
<div>Total</div>
<Inline gap="3">
<span>Edit</span>
<Separator orientation="vertical" />
<span>Archive</span>
</Inline>
</Stack>
);
}
Props
An <hr>: a 1 px border/subtle line, Figma's Divider (7370:95). Decorative by default; spacing comes first, a line only when spacing is not enough (the Figma doc).
Server component Renders data-slot="separator" with the class nz-separator. Props: SeparatorProps. Source: src/separator/separator.tsx.
| Name | Type | Default | Description |
|---|---|---|---|
decorative | boolean | true | Purely visual, hidden from assistive technology ( |
orientation | Orientation"horizontal""vertical" | 'horizontal' | A vertical separator stretches to the height of its flex row. |
render | RenderProp<SeparatorState> | – |
- Also takes every attribute of
<hr>exceptchildren. (Omit<ComponentPropsWithRef<"hr">, "children">)
render takes an element, or, in client code, a function of the props and this state (SeparatorState):
| Name | Type | Default | Description |
|---|---|---|---|
decorativerequired | boolean | – | |
orientationrequired | Orientation"horizontal""vertical" | – |
Other exports
SeparatorPropstypeimport type { SeparatorProps } from '@nizivo/react/separator'The props of
Separator, listed above.SeparatorStatetypeimport type { SeparatorState } from '@nizivo/react/separator'The render state of
Separator, listed above.
Data attributes and slots
Style parts by class (.nz-<slot>) and state by data attribute. Attribute meanings come from contracts/vocabulary.json.
| Slot | Rendered by | Data attributes |
|---|---|---|
separator.nz-separator | Separatorroot (takes render) |
|
CSS hooks
Set a hook on the component's class or any ancestor to restyle it without specificity games; leave it unset for the default shown.
| Hook | Default | Read as |
|---|---|---|
--nz-separator-color | --nz-border-subtle |
|
Layers: nz.components. Classes: .nz-separator.
Tokens this stylesheet reads (2)
--nz-border-subtle, --nz-border-width-default
Accessibility
Nothing in this component takes focus or keyboard input.
Keyboard
None.
Figma
Node ids from design/component-map.json, which nz gen writes from component.json. The links open the Nizivo Figma library, which may ask you to sign in.
- Canonical: none
- Ghost masters: none
Select
A single-choice list box with a button trigger, groups and separators, backed by a hidden native select so forms submit and reset as usual.
Sidebar
The app's main navigation on screens 640 px and wider, with the store at the top, the destinations, and Settings at the foot. It is 264 px wide from 1280 px and folds to a 72 px icon rail below that, where each destination's Tooltip names it.