Examples
Semantic separation
Use the separator role when the boundary is meaningful to the structure; decorative rules remain hidden from assistive technology.
Account details
ProfileSecurity
Horizontal and vertical semantic separators
import { Divider } from "@phuctech/ui/components/divider";
export function Example() {
return (
<div className="w-full max-w-lg">
<p>Account details</p>
<Divider decorative={false} spacing="sm" />
<div className="flex min-h-12 items-center gap-4">
<span>Profile</span><Divider orientation="vertical" decorative={false} spacing="sm" /><span>Security</span>
</div>
</div>
);
}
Try the props
Choose the separator direction and spacing around it.
Section ASection B
Divider property playground
import { Divider } from "@phuctech/ui/components/divider";
export function Example() {
return <Divider orientation="horizontal" spacing="md" decorative={false} />;
}When to use
Use Divider to separate peer sections or items. Prefer headings, spacing, or Card boundaries when they already provide enough structure.
Usage
import { Divider } from "@phuctech/ui/components/divider";
<Divider decorative={false} />API
Tokens
Accessibility
- Decorative rules use presentation semantics and are hidden from assistive technology.
- Non-decorative rules expose the separator role and orientation.
Do and don’t
Do
Use a semantic separator when the grouping boundary helps explain the page structure.
Don’t
Add separators between every line when spacing alone is enough.