Skip to content

Divider ​

A horizontal/vertical divider that separates content.

Horizontal ​

Basic divider

With content ​

Content position

TextLeft alignedRight aligned

Emphasized text

Section title

strong bolds the text (font-weight 600), useful as section titles for content groups.

Line style ​

variant line styles (default solid, see above)

soliddasheddotteddoubledouble-dasheddouble-dotted

variant is equivalent to the dashed boolean (the dashed attribute = variant="dashed"; an explicit variant takes priority). Line styles apply to the horizontal layout only — vertical dividers (direction="vertical") render solid lines regardless of variant (an existing boundary covering dashed/dotted/double/double-*).

Inset ​

inset / middle

inset — empty on the start sidemiddle — empty on both sides

Spacing size ​

size options

smallmedium (default)large

Dashed ​

Dashed (compat shorthand)

Vertical ​

Vertical divider

TextText

Stretches inside flex containers

Card ACard BCard C

A vertical divider stretches to the full row height inside flex/grid containers; in inline context it stays at 1em text height.

Vertical content alignment ​

In vertical mode, content-position accepts top (top-aligned) / center (default, centered) / bottom (bottom-aligned); the text reads horizontally while the vertical line runs on either side of it (top-aligned: the line extends downward from the text; bottom-aligned: upward; centered: a segment on each side). In horizontal mode only left / center / right apply — using a cross-direction value (e.g. horizontal + top, vertical + left) falls back to center with a console warning. The top/bottom inset goes through the --oas-divider-title-inset variable (default 5%).

Vertical text alignment

TopCenterBottom

Text orientation on a vertical divider: text-orientation="vertical" renders the text vertically (following the line direction, top to bottom); default horizontal reads normally. Only meaningful for vertical dividers (ignored on horizontal ones).

Vertical text orientation

Horizontal textVertical textTop

Vertical dividers also support inset spacing: inset (top-side spacing) / middle (both top and bottom spacing), sharing the same variables as horizontal dividers (--oas-divider-title-inset / --oas-divider-middle-inset).

Vertical inset

inset top spacemiddle both sides

Custom styling ​

The color attribute accepts 11 preset names (auto-adapting to light/dark themes) or any CSS color value (takes effect immediately, overriding presets and defaults); line width, spacing and the title-side gap go through CSS variables:

Preset palette

magentaredvolcanoorangegoldlimegreencyanbluegeekbluepurple

Custom color values (highest priority)

Teal dashedPurple solid

CSS variables

Compact spacingFixed 120px gap on the title side2px thick line
VariableDescriptionDefault
--oas-divider-widthLine width1px
--oas-divider-colorLine colorborder token
--oas-divider-spacingVertical spacing (default for size options; overrides all three once set)size-matched space token
--oas-divider-title-insetGap on the title side (content-position=left/right and inset)5%
--oas-divider-middle-insetGap on both sides for middle16.67%
--oas-divider-double-gapGap between the two lines of double3px

API ​

oas-divider ​

Attributes ​

AttributeDescriptionTypeDefault
colorColor: accepts 11 preset names (mapped to --oas-preset-* tokens) or any CSS color valuestring—
content-positionContent positionstring—
dashedDashedboolean—
directionDirectionDividerDirectionhorizontal
insetIndent: start-side inset of a horizontal line (default 5%, via --oas-divider-title-inset), aligned with the title insetboolean—
middleSymmetric inset: equal insets on both sides of a horizontal line (default 16.67%, via --oas-divider-middle-inset)boolean—
sizeSpacing tier: small / medium (default) / large; horizontal layout onlystring—
strongBolder divider title (font-weight 600)boolean—
text-orientationText orientation on a vertical divider: horizontal (default, reads normally) / vertical (vertical, top-to-bottom along the line); only meaningful for vertical dividersstring—
variantLine style: solid / dashed / dotted / double / double-dashed (double dashed) / double-dotted (double dotted); an explicit value takes precedence over the dashed boolean (compat form). Line styles apply to horizontal layout onlystring—

Slots ​

NameDescription
defaultContent in the middle of the divider

CSS Variables ​

CSS VariableDefault
--oas-divider-colorvar(--oas-color-border-strong)
--oas-divider-double-gap3px
--oas-divider-middle-inset16.67%
--oas-divider-spacingvar(--oas-space-4)
--oas-divider-title-inset5%
--oas-divider-width1px

Released under the MIT OR Apache-2.0 License.