Skip to content

Design system

Documentation

DesignComponents / Divider

Components / Divider

Beta

Divider

Separate related content with a shared, optionally semantic boundary.

On this page

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

Try the props

Choose the separator direction and spacing around it.

Section ASection B

Divider property playground

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

Component API
PropTypeDefaultDescriptionConstraints
orientation"horizontal" | "vertical""horizontal"Boundary direction.A vertical divider needs a parent with meaningful height.
decorativebooleantrueHides decorative rules from the accessibility tree.Set false when the separator conveys a meaningful boundary.
spacing"sm" | "md" | "lg""md"Margin around the rule.The control does not add layout gaps to its siblings.
classNamestring—Additional classes on the separator.Keep the rule visible in both themes.

Tokens

Component tokens
TokenRoleEffective valueUsage
borderRule colorDefault boundaryMatches other semantic separators.
--space-2 / --space-4 / --space-6Spacingsm / md / lgKeeps separation aligned with the spacing rhythm.

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.

  • Card provides a full content surface.
  • Spacing describes the shared rhythm.