--- title: Divider summary: A divider is a horizontal line between blocks of content, with an optional text label on the left, in the center or on the right. description: Separate content with horizontal dividers. Add optional text labels aligned left, center, or right to keep layouts clear. source: core/scss/ui/_type.scss classnames: component: - class: hr desc: Applied to the hr element part: - class: hr-text desc: Divider with a label; the text sits in a child element modifier: - class: hr-text-spaceless desc: Removes the vertical margin direction: - class: hr-text-start desc: Moves the label to the leading edge - class: hr-text-end desc: Moves the label to the trailing edge color: - class: text-{color} desc: Any base color for a labelled divider --- import Example from '@components/Example.astro'; ## Default markup The `.hr-text` element draws a line with a label in the middle. For a line without text, use a plain `hr`.

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Alias, dolore dolores doloribus est ex.

See also

Dicta error hic illo iure necessitatibus nihil officiis omnis perferendis, praesentium repellendus rerum, saepe sed, sit!

## Text position Add `.hr-text-start` or `.hr-text-end` to move the label to the start or the end of the line. Without them it's centered.

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Alias, dolore dolores doloribus est ex.

Start divider

Dicta error hic illo iure necessitatibus nihil officiis omnis perferendis, praesentium repellendus rerum, saepe sed, sit!

Centered divider

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Alias, dolore dolores doloribus est ex.

End divider

Dicta error hic illo iure necessitatibus nihil officiis omnis perferendis, praesentium repellendus rerum, saepe sed, sit!

## Divider color A `text-*` class from the [color palette](/ui/base/colors) colors the divider.

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Alias, dolore dolores doloribus est ex.

Green divider

Dicta error hic illo iure necessitatibus nihil officiis omnis perferendis, praesentium repellendus rerum, saepe sed, sit!

Red divider

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Alias, dolore dolores doloribus est ex.

Primary divider

Dicta error hic illo iure necessitatibus nihil officiis omnis perferendis, praesentium repellendus rerum, saepe sed, sit!

## Accessibility - A divider that separates sections is decoration, so `hr` with no extra markup is enough - browsers already expose it as a separator. - When the divider carries a label, keep the label as text. Do not fake it with a `::before`, since generated content is not reliably read. - A vertical divider between inline items is decoration too. Use `aria-hidden="true"` if you build it from a `span` rather than an `hr`. - Do not use a divider to group form fields. Use a `fieldset` with a `legend`, which is what actually creates the group.