Divider
A horizontal or vertical line used to separate content sections.
@volvo-cars/css v2.5.1
Use a classless <hr /> for the default 1px divider with standard vertical spacing and the primary ornament color.
Show code
<p>Content above the divider.</p><hr /><p>Content below the divider.</p>Custom styling
Section titled “Custom styling”Adding any class to <hr> removes the default styles. Rebuild with utility classes: border-t for the line, my-* for spacing, and optional width or color classes.
Use w-sm mx-auto for a short centered divider, or border color utilities like border-primary or border-secondary to change the line color.
Vertical divider
Section titled “Vertical divider”Use border-l on a <div> with role="separator" and aria-orientation="vertical". The parent must have a defined height.
Accessibility
Section titled “Accessibility”- A plain
<hr />has an implicitseparatorrole. No extra attributes needed - For vertical dividers, add
role="separator"andaria-orientation="vertical"since<div>has no semantic meaning - Decorative dividers that don’t convey structure can use
role="presentation"to hide them from assistive technology