Divider
Horizontal or vertical separator rendered as a semantic <hr> with color, thickness and inset support.
Structure
Anatomie
Décomposition visuelle de la structure interne du composant avec les appels de classes BEM.
<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
Toutes les props acceptées par ce composant, avec leur type, valeur par défaut et 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
Membres exposés
Propriétés et méthodes accessibles via ref template (defineExpose). Utilisés pour le contrôle programmatique.
- <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.
Personnalisation
Variables CSS
Propriétés CSS personnalisées exposées par ce composant. Surchargez-les pour personnaliser sans perdre la compatibilité avec le thème.
- 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
Accessibilité
Rôles ARIA, navigation clavier et gestion du focus. Sourcé depuis le template réel du composant.
Rôles ARIA
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.
Fondation
Design tokens
Extrait des tokens de ce composant — les variables --origam-<composant>---<propriété>, déclarées dans sa feuille de tokens tenue à la main, sans étape de build.
- 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.
Interactif
Playground
Modifiez les props en direct et observez le composant se mettre à jour. Le snippet de code généré suit vos changements.
Rendu de l’aperçu en cours…
Usage
Exemples
Extraits de code prêts à coller dans vos templates.
Horizontal divider
Vertical divider
Colored & inset