StartFoundationsComponentsContent

Divider

A divider is a thin line between two groups of content.

Stable Figma
OverviewUsageAPIAccessibility

Signed in as ada@example.com

Sign out of all devices

<p>Signed in as ada@example.com</p>
<tk-divider></tk-divider>
<p>Sign out of all devices</p>

Anatomy

Part What it is
tk-divider the element; never focusable, ignores the pointer
rule part the line; one segment, or one on each side of a label
label part an optional centered label, horizontal only

Orientation

Bold Italic Link
<div style="display: flex; align-items: center; gap: var(--space-8); height: 32px">
  <tk-button variant="ghost">Bold</tk-button>
  <tk-button variant="ghost">Italic</tk-button>
  <tk-divider orientation="vertical"></tk-divider>
  <tk-button variant="ghost">Link</tk-button>
</div>
  • horizontal (default): a full-width line in a vertical flow.
  • vertical: a full-height line in a row. Put it in a flex row or give it a height; on its own it is only one line of text tall.

Label

Text in the default slot splits the line around a centered label, such as "OR" between two alternatives.

Continue with email OR Continue with Google
<tk-button full-width>Continue with email</tk-button>
<tk-divider>OR</tk-divider>
<tk-button variant="outline" full-width>Continue with Google</tk-button>

The label works on horizontal dividers only; a vertical divider ignores it. Screen readers read the label as the divider's name.

Spacing, inset, and strength

Set spacing and color with CSS custom properties on the element. The line spans its container by default; to inset it, give the element a margin.

<tk-divider style="--tk-divider-spacing: var(--space-16)"></tk-divider>
<tk-divider style="--tk-divider-color: var(--border-default)"></tk-divider>
<tk-divider style="margin-inline: var(--space-16)"></tk-divider>
  • --tk-divider-spacing: space on both sides of the line, along its axis.
  • --tk-divider-color: the line color; var(--border-default) gives a stronger line between larger areas.
  • --tk-divider-thickness: 1px by default; rarely changed.

Decorative

Add decorative when the nearby structure already shows the grouping, such as between two landmark sections or items of a real list. It hides the divider from screen readers. A divider with a label is never hidden.

<tk-divider decorative></tk-divider>