Components
Separator
A 1px divider in the toolbar's own hairline, with a labelled form for “or continue with email”. Decoration unless you say otherwise.
pnpm dlx shadcn@latest add @caliper/separatorWhen to use
Use it for
- Between rows of a list, groups in a toolbar or areas of a panel.
- A form that offers two ways in.
Skip it when
- Spacing; use gap. A line every few pixels turns a page into a ledger.
Decisions
Why it is built this way, so you know what to keep when you change your copy.
Behaviour
- Decorative by default
- A divider hidden from assistive technology says nothing a heading or list would not. Pass decorative={false} only when it divides regions people move between.
Styling
- One hairline, two weights
- The default is the border colour every surface uses; strong is for areas that are unrelated. There is no thicker line.
Installation
pnpm dlx shadcn@latest add @caliper/separator
Adds its 2 files to components/ui/, each with its own stylesheet, and installs their packages. No account needed. The first part also adds Caliper UI’s tokens; import them once as in Installation.
Usage
This is the code behind the preview above.
import { type ReactNode } from "react" import { cn } from "@/components/ui/lib/cn" import { Button } from "@/components/ui/button" import { Field } from "@/components/ui/field" import { Input } from "@/components/ui/input" import { Separator } from "@/components/ui/separator" function Panel({ title, context, children, className }: { title: ReactNode; context: ReactNode; children: ReactNode; className?: string }) { return ( <section className={cn("grid w-full max-w-md gap-5 rounded-overlay border border-border bg-background p-6 shadow-resting", className)}> <div className="grid gap-1"> {/* div, not p: titles here can hold a badge or a direction-aware block. */} <div className="font-medium">{title}</div> <p className="text-sm text-muted-foreground">{context}</p> </div> {children} </section> ); } export function SeparatorDemo() { return ( <Panel title="Sign in to Halden" context="Forma Studio uses single sign-on for 14 members." className="max-w-sm"> <div className="grid gap-2"> <Button variant="secondary">Continue with Google</Button> <Button variant="secondary">Continue with SAML SSO</Button> </div> <Separator label="or continue with email" /> <div className="grid gap-3"> <Field label="Email">{(control) => <Input {...control} type="email" placeholder="you@halden.app" />}</Field> <Button>Continue</Button> </div> <Separator /> <p className="text-center text-xs text-muted-foreground">New to Halden? Ask your workspace owner for an invite.</p> </Panel> ); }
API reference
Separator
component
Also accepts the native props of its root element and a ref.
Accessibility
It exposes separator semantics, with aria-orientation kept in step with state.
No custom key handling; Tab and the native activation keys do the work.
Motion
It declares no animation in its component source. Any transition comes from its stylesheet, which uses the duration tokens that collapse to instant under prefers-reduced-motion.