Skip to content
Dalvan UI

Divider

Separate adjacent content with a horizontal or vertical rule.

Playground

Draft
Published
<div class="dv-grid dv-gap-150 dv-p-150 dv-appearance-paper" style="min-block-size: 7rem">
  <span>Draft</span>
  <hr class="dv-divider" />
  <span>Published</span>
</div>

Usage

After setting up the CSS, apply dv-divider to an hr for a thematic break. Hide a purely decorative divider from assistive technology.

<hr class="dv-divider" />

Examples

Line styles and labels

The default is solid. Dashed and dotted styles work with both orientations. A direct label is centered by default. Label-start and label-end place it at an edge.


Archive
<div class="dv-grid dv-gap-150 dv-p-150 dv-appearance-paper" style="inline-size: 100%">
  <hr class="dv-divider dv-divider--dashed" />
  <div class="dv-divider dv-divider--dotted dv-divider--label-end">
    <span class="dv-divider__label">Archive</span>
  </div>
</div>

Vertical divider

Use a flex row so the divider can stretch across its height. Give a meaningful vertical separator an explicit orientation.

Draft Published
<div class="dv-flex dv-gap-150 dv-p-150 dv-appearance-paper">
  <span>Draft</span>
  <div class="dv-divider dv-divider--vertical" role="separator" aria-orientation="vertical"></div>
  <span>Published</span>
</div>

API reference

Class or attributeBehavior
dv-dividerdv-divider--verticalHorizontal by default. The vertical modifier changes the axis.
dv-divider--soliddv-divider--dasheddv-divider--dottedChoose one line style.
dv-divider__labeldv-divider--label-startdv-divider--label-endOptional direct label and its placement. Vertical labels use vertical writing.

Customization

Set length on the divider itself. A horizontal rule consumes inline space and a vertical rule consumes block space.

PropertyEffect and defaults
--dv-divider-lengthLength along the divider axis. Defaults to auto.
--dv-divider-thicknessDefaults to 1px.
--dv-divider-color / --dv-divider-foreground-weightLine color and its foreground mix. The default weight is 24%.
--dv-divider-label-gapGap between the label and each line segment. Defaults to space-100.