Default
Account details
Billing
Show the codeHide the code
Default, code
<div className="flex max-w-md flex-col gap-stack-md text-body-md text-fg"><p>Account details</p><Divider /><p>Billing</p></div>A 1px line between content; decorative unless it separates groups.
These are the real React components. Use them with a mouse, touch or keyboard, and switch the theme and density for every example at once.
Account details
Billing
Default, code
<div className="flex max-w-md flex-col gap-stack-md text-body-md text-fg"><p>Account details</p><Divider /><p>Billing</p></div>With a label, code
<div className="max-w-md"><Divider label="or" /></div>Workspace
Personal
Separates groups, code
<div className="flex max-w-md flex-col gap-stack-md text-body-md text-fg"><p>Workspace</p><Divider decorative={false} /><p>Personal</p></div>Vertical, code
<div className="flex h-10 items-center gap-gap-md text-body-md text-fg"><span>Edit</span><Divider orientation="vertical" /><span>Share</span></div>The 3 design tokens Divider reads, with the value each has in the theme and density chosen above. Change a token and the component follows, in Figma and in code.
| Token | Value now | CSS variable |
|---|---|---|
| color.border.default | … | --sd-color-border-default |
| color.text.secondary | … | --sd-color-text-secondary |
| spacing.gap.md | … | --sd-spacing-gap-md |
The npm package isn’t published yet. When it is, this is the install line; until then, this page runs the same build of the package (from commit fa3abf8).
Install
npm i @superduperui/react @superduperui/tokensImport
import { Divider } from "@superduperui/react"Divider also takes the props of the React Aria component it’s built on.
| Prop | Type | What it does |
|---|---|---|
label | string | Optional text in the middle ("or"). Only for horizontal dividers. |
decorative | booleanDefault true | true (default): purely visual, hidden from screen readers. false: a real separator between groups of content (role="separator"), announced. |
orientation | unknownDefault 'horizontal' |
Screen readers announce Decorative: nothing. Semantic: "separator".
WCAG 2.2 AAA criteria the component meets in Comfortable density: 1.4.6, 1.4.9, 2.3.2.
Not interactive: density changes spacing only.
| axe-core (WCAG A, AA, AAA and best practice) | 100 runs across every story, theme, density and width: 0 violations |
|---|---|
| Rendered text contrast | 85 text runs: 0 below 7:1, lowest 11.42:1 |
| Target size | 0 targets: 0 under 44px in Comfortable |
| Focus appearance (2.4.13) | 0 focus stops in 0 browser engines: all pass |
Manual passes with VoiceOver and NVDA haven’t been done yet.
The Figma component is Divider, with Orientation (Horizontal, Vertical). The Figma library isn’t published yet.
Figma to code: Orientation → orientation (Horizontal = "horizontal", Vertical = "vertical"); Label → label when Show label.