Skip to Content

Divider

A brandless separator element wrapping <hr>. Supports horizontal and vertical orientations. All visual styling is driven by CSS custom properties.

Demo


Usage

import { Divider } from '@froglet/ui' // Horizontal (default) <Divider /> // Vertical <div style={{ display: 'flex', height: '4rem', alignItems: 'center' }}> <span>Left</span> <Divider orientation="vertical" /> <span>Right</span> </div>

Props

PropTypeDefaultDescription
orientation"horizontal" | "vertical""horizontal"Visual and semantic orientation.
classNamestringAdditional CSS classes.
refReact.Ref<HTMLHRElement>Forwarded to the underlying <hr>.
...propsHTMLAttributes<HTMLHRElement>All standard global HTML attributes.

CSS Custom Properties

TokenDefaultDescription
--divider-border-width1pxLine thickness.
--divider-border-stylesolidLine style (solid, dashed, dotted, etc.).
--divider-border-colorLine color. Renders as currentColor when unset.
--divider-margin1rem 0Surrounding space (horizontal). Use 0 1rem for vertical.
--divider-width100%Width of the horizontal divider.
--divider-height100%Height of the vertical divider.

Accessibility

  • The <hr> element has implicit role="separator" with aria-orientation="horizontal".
  • When orientation="vertical", aria-orientation="vertical" is set explicitly.
Last updated on