Skip to content

Separator

hc-separator is a thin divider line. Apply .hc-separator to a native <hr> — the element already carries the implicit role="separator" and aria-orientation="horizontal" semantics, so this only swaps the browser’s default rule for a single hairline drawn from a token. Pure CSS, no JavaScript.

The default. A full-width hairline with margin above and below.

Account settings


Billing

Set data-orientation="vertical" for an inline divider — for example between items in a horizontal toolbar or link row. The line stretches to the height of its flex row.

There is no HTML element for a vertical separator, and a plain <hr> reports aria-orientation="horizontal", so add aria-orientation="vertical" to keep the semantics correct.

The vertical variant relies on align-self: stretch, so its parent should be a flex row (the row’s height sets the line’s length). A min-block-size fallback keeps it visible outside a stretch context.

  • A separator between content sections is meaningful structure, not decoration — <hr> exposes it to screen readers via the implicit separator role, which most reading cursors announce.
  • For a vertical separator, always add aria-orientation="vertical"; the default for the role is horizontal.
  • If a divider is purely visual and the surrounding structure already conveys the grouping, you can hide it with role="none" / aria-hidden="true" so it is not announced twice. Most page-section rules should keep the default semantics.

Component tokens (in component.tokens.json):

Token pathPurpose
separator.colorLine color (defaults to the border token).
separator.sizeLine thickness (1px).
separator.spacingMargin — block for horizontal, inline for vertical.
Show the generated CSS variables
--hc-separator-color | -size | -spacing
  • Toolbar — uses vertical separators to group its action clusters.
  • Card — a horizontal separator pairs well between a card header and its body.