Divider

Layout & Structure
stable

Horizontal or vertical separator rendered as a semantic <hr> with color, thickness and inset support.

Structure

Anatomy

Visual breakdown of the component's internal structure with BEM class call-outs.

Anatomy of OrigamDividerSchematic of the Divider component with 3 numbered parts. HORIZONTAL 1 VERTICAL 2 Rendered as <hr> — native HTML separator with role="separator"
Anatomy of <origam-divider>. Horizontal ① is full-width; vertical ② is inline-flex with height: auto. Both render as a native <hr>.
1.origam-divider
Root <hr> element. In horizontal mode: display: block; flex: 1 1 100%. aria-orientation="horizontal".
2.origam-divider--vertical
Vertical variant modifier. Switches to display: inline-flex, height: auto, align-self: stretch. aria-orientation="vertical".
3.origam-divider--inset
Inset modifier. Adds margin-inline-start so the line aligns with list item content.

API

Props

All props accepted by this component, with their type, default value and description.

inset
boolean
false
Adds a margin-inline-start indent so the divider aligns with list content.
length
number | string
Constrains the divider length. Horizontal → max-width; vertical → max-height. Accepts CSS lengths or numbers (px).
thickness
number | string
Overrides the border width (stroke thickness) of the divider.
id
string
class
string | Array<string> | object
style
string | Array<string> | object | StyleValue
color
Intent or custom color for the divider line.
bgColor
Background color override. Useful for styled label dividers.
margin
boolean | number | string
Shorthand margin applied to all sides.
marginTop
boolean | number | string
marginLeft
boolean | number | string
marginBottom
boolean | number | string
marginRight
boolean | number | string
marginBlock
boolean | number | string
marginInline
boolean | number | string
marginInlineStart
boolean | number | string
marginInlineEnd
boolean | number | string
marginBlockStart
boolean | number | string
marginBlockEnd
boolean | number | string
direction
TDirection
'horizontal'
Controls the divider orientation. Horizontal renders as a full-width line; vertical as an inline inline block.

API

Exposed members

Properties and methods accessible via template ref (defineExpose). Use them for programmatic control.

<T extends object>(props: T, exclude?: string[]) => Partial<T>
Utility to forward a filtered subset of props to a child component.
Ref<string>
Reactive CSS string generated by useStyle from the computed dividerStyles.
string
Unique style-sheet ID for this instance.
() => void
Injects the computed style sheet into the document. Called automatically on mount.
() => void
Removes the injected style sheet. Called automatically on unmount.
Ref<boolean>
True once the style sheet has been injected into the DOM.

Customisation

CSS variables

CSS custom properties exposed by this component. Override them to customise the component without losing theme compatibility.

Global opacity of the divider line. Token: {opacity.100} resolves to 1; the component overrides to 0.12 by default in SCSS.
Stroke thickness for the horizontal divider. Overridden by the thickness prop.
Stroke thickness for the vertical divider. Overridden by the thickness prop.
Maximum width for horizontal dividers. Set by the length prop.
Maximum height for vertical dividers. Set by the length prop.
Leading indent applied when inset=true.

Inclusion

Accessibility

ARIA roles, keyboard navigation and focus management. Sourced from the real component template.

ARIA roles

separator

Notes

  • Renders as a native <hr> element which has an implicit role="separator". The aria-orientation attribute matches the direction prop (horizontal or vertical).
  • When used purely for visual decoration, pass role="presentation" via attrs to remove the element from the accessibility tree.

Foundation

Design tokens

Excerpt from this component's token declarations — the --origam-<component>---<property> variables, declared in its hand-maintained token sheet with no build step.

Source
color
var(--origam-color__border---subtle)
Default divider color. References the subtle border semantic token.
dimension
var(--origam-border__width---thin)
Default stroke thickness. Overridden by the thickness prop.
number
var(--origam-opacity---100)
Token default opacity (1). SCSS overrides to 0.12 for a subtle separator effect.
dimension
var(--origam-space---0)
Default block margin (0). Use the margin prop for spacing.

Interactive

Playground

Edit props live and see the component update in real time. The generated code snippet updates as you change values.

Rendering the live preview…

Usage

Examples

Ready-to-paste code snippets for your templates.

Horizontal divider

vue

Vertical divider

vue

Colored & inset

vue