Separator
The line draws itself from the centre outward, then its label fades in.
See it as an AI agent does.See this component the way an AI agent does.
Installation
npx shadcn@latest add @keyframery/separatorThis adds components/keyframery/separator.tsx and its primitive to your project, and installs UI SDK. The motion tokens are added to your global CSS the first time you install a component.
Usage
import { Separator } from "@/components/keyframery/separator"
export default function Usage() {
return <Separator />
}Examples
Horizontal and vertical
Between sections or between items in a row. decorative hides it from screen readers when it only adds space.
With a label
Put a SeparatorLabel between two separators for an “or” line.
Motion
| Move | What you see |
|---|---|
| Draw | The line draws itself from the centre outward; vertical lines draw top to bottom. |
| Fade | A label in the middle fades in after the line. |
Timing and springiness follow the motion style you set. To change how fast this separator moves, pass speed:
<Separator speed="fast">
…
</Separator>"fast" is 0.6×, "slow" 1.4×, and a number sets the multiplier. With reduced motion turned on, nothing moves: changes happen at once or with a short fade.
Theming
Set these CSS variables on the component or a parent. Leave them unset to follow the light and dark theme. The open Customize panel below the preview lets you try these settings.
| Variable | What it changes | Default |
|---|---|---|
--separator-line | Divider colour | --border |
--separator-ink | Divider label | --muted-foreground |
--separator-thickness | Line thickness | 1px |
--separator-label-gap | Space either side of a label | 0.75rem |
--separator-font | Label size | 12px |
API reference
Every part takes className and children. Parts from UI SDK also take render, to draw your own element, and a function of their state for className and style. Props not listed here are in the UI SDK separator reference.
Separator
Renders a <div>, and takes its props too.
Prop
Type
Other parts
These take the props of the element they render, and nothing else:
SeparatorLabel: a<span>
Accessibility
Keyboard, focus and screen-reader behaviour come from UI SDK and are not changed. More in Accessibility.
Swap the import
Already using UI SDK's separator with your own styles? Keep your markup and change one line. The primitive adds motion and nothing else.
// Before
import { … } from "@ui-sdk/react/separator"
// After: same parts, same props, now animated
import { … } from "@/components/keyframery/primitives/separator"Questions
How does the animated Separator for UI SDK move?
Draw: The line draws itself from the centre outward; vertical lines draw top to bottom. Fade: A label in the middle fades in after the line.
Do I need Motion or Framer Motion for the animated Separator?
No. Every move is plain CSS, so there is nothing to install besides the component and UI SDK.
Can I keep my own styling and only take the motion?
Yes. Import from @/components/keyframery/primitives/separator instead. It has the same parts and props as @ui-sdk/react/separator and adds motion only.
What happens to the Separator when someone turns on reduced motion?
Nothing moves. State changes happen at once, or with a short fade.