Separator
A one-pixel rule between blocks of content, horizontal or vertical. Wraps @base-ui/react/separator, which owns the `role` and `aria-orientation` semantics; this file owns exactly two things — the `bg-border` colour and the axis geometry.
Preview
Rendered from the story the storybook (a11y) CI gate runs axe against — the preview can't show something that hasn't been verified.
Install
Two equivalent paths — the URL works in any shadcn-CLI setup; the alias works once you've registered @interlace in your components.json.
npx shadcn@latest add https://ds.interlace.tools/r/separator.jsonnpx shadcn@latest add @interlace/separatorHistory
This component is at v1.1.0, first shipped in @interlace/ui 1.0.0. The version is stamped as a banner into the file the install writes, so the copy in your tree says which one you have — compare it with the number above before deciding whether to re-run the install.
@interlace/ui 1.0.01 entry
- Addedminor
The component floor reaches every tier: form, overlay, navigation and display primitives were modelled to the portable 26-rule floor with skeletons, locked breakpoints, and AA contrast measured per composite rather than eyeballed.
Components- @interlace/input
- @interlace/textarea
- @interlace/select
- @interlace/checkbox
- @interlace/radio-group
- @interlace/switch
- @interlace/slider
- @interlace/number-field
- @interlace/form
- @interlace/label
- @interlace/dialog
- @interlace/alert-dialog
- @interlace/sheet
- @interlace/popover
- @interlace/tooltip
- @interlace/hover-card
- @interlace/dropdown-menu
- @interlace/context-menu
- @interlace/tabs
- @interlace/accordion
- @interlace/collapsible
- @interlace/breadcrumb
- @interlace/pagination
- @interlace/toast
- @interlace/card
- @interlace/badge
- @interlace/avatar
- @interlace/alert
- @interlace/progress
- @interlace/skeleton
Import
Single named export.
import { Separator } from '@/components/ui/separator';Anatomy
Extracted from the primitive's JSDoc header. The source is the only documentation that can't drift.
Separator (Base UI Separator — a div) One part, no children, no slots. `orientation` defaults to `horizontal` and is forwarded to Base UI as well as switching the geometry, so the visual axis and the announced one cannot disagree.
API reference
Parsed from the type declarations in the source — the same file the install writes into your tree, so this table can't drift from the component you get.
SeparatorProps
| Prop | Type | Description |
|---|---|---|
| orientation | 'horizontal' | 'vertical' | — |
Accessibility
Every story for this component is rendered headlessly and checked with axe-core (wcag2aa, wcag22aa, best-practice, ACT) on every PR. That gate has no continue-on-error, so what ships has zero known violations.
What follows is what static analysis can see. Axe cannot press a key and never sees an overlay open, so the operable-without-a-mouse claim lives in Behavior instead, where the keyboard path is replayed step by step.
- Focus + keyboard behaviour
- Owned by @base-ui/react/separator — focus trapping, dismissal and typeahead come from the headless primitive, not from us.
- Focus ring (WCAG 2.2 SC 2.4.13)
- Not focusable — no focus indicator required.
- Reduced motion
- No animation to gate.
- ARIA in the source
- None — semantics come from the element or the Base UI primitive rather than hand-written ARIA.
Examples
1 more state from the same story file.
R-rule compliance
Every primitive in @interlace/ui models to the portable 26-rule floor enforced by the componentApi ESLint preset. The cells below pin exactly where each rule applies in this file.
| Rule | Concept | Where |
|---|---|---|
| R4 | Extends Base UI part props | `React.ComponentProps<typeof BaseSeparator>` |
| R6 | data-slot on root | `data-slot="separator"` |
| R7 | cn + ...rest | `cn('bg-border shrink-0', …, className)` + `{...props}` |
| R8 | Enum for axis | `orientation = horizontal |
| R12 | Reuse over wrap | Base UI owns the separator role + aria-orientation |
| R19 | Tokens only | `bg-border` |
| R25 | Server component | No hooks → no `'use client'` |
Dependencies
- Base UI primitive
- @base-ui/react/separator
- Lucide icons
- none
- NPM dependencies
@base-ui/react
- Registry dependencies
Source
The full implementation — components/ui/separator.tsx once installed.
import * as React from 'react';
// @interlace/separator v1.1.0 — Interlace design system.
// Docs, props and live preview: https://ds.interlace.tools/c/separator
// What changed since: https://ds.interlace.tools/c/separator#history
// Generated banner — keep it, the upgrade diff reads this version.
/**
* @interlace/ui — Separator
*
* A one-pixel rule between blocks of content, horizontal or vertical. Wraps
* @base-ui/react/separator, which owns the `role` and `aria-orientation`
* semantics; this file owns exactly two things — the `bg-border` colour and
* the axis geometry.
*
* The vertical form is `h-full w-px`, so it only draws inside a parent with a
* resolved height (a flex row, a fixed-height toolbar). In a plain block
* container it has nothing to be the full height OF and renders invisible.
*
* ## Anatomy
…51 more lines…Registry JSON
The raw registry record — what the shadcn CLI fetches.