Divider
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.
<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-startso the line aligns with list item content.
API
Props
All props accepted by this component, with their type, default value and description.
- insetbooleanfalse
- Adds a margin-inline-start indent so the divider aligns with list content.
- lengthnumber | string
- Constrains the divider length. Horizontal → max-width; vertical → max-height. Accepts CSS lengths or numbers (px).
- thicknessnumber | string
- Overrides the border width (stroke thickness) of the divider.
- idstring
- classstring | Array<string> | object
- stylestring | Array<string> | object | StyleValue
- color
- Intent or custom color for the divider line.
- bgColor
- Background color override. Useful for styled label dividers.
- marginboolean | number | string
- Shorthand margin applied to all sides.
- marginTopboolean | number | string
- marginLeftboolean | number | string
- marginBottomboolean | number | string
- marginRightboolean | number | string
- marginBlockboolean | number | string
- marginInlineboolean | number | string
- marginInlineStartboolean | number | string
- marginInlineEndboolean | number | string
- marginBlockStartboolean | number | string
- marginBlockEndboolean | number | string
- directionTDirection'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
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.
- colorvar(--origam-color__border---subtle)
- Default divider color. References the subtle border semantic token.
- dimensionvar(--origam-border__width---thin)
- Default stroke thickness. Overridden by the thickness prop.
- numbervar(--origam-opacity---100)
- Token default opacity (1). SCSS overrides to 0.12 for a subtle separator effect.
- dimensionvar(--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
Vertical divider
Colored & inset