Divider

Divider

HkDivider is the presentational rule line: one bare div carrying a 1px border, with four orthogonal modifier axes — orientation, tone, variant, spacing — plus a vertical-only length. It has no children, no text and no state, and it hides from the accessibility tree, so it never becomes a separator a screen reader announces.

  • A rule between two blocks of prose is a divider; a whole panel that needs a heading and a body is HkSectionCard.
  • To separate rows inside a list, the list's own row span is the right place — a divider between every row is chrome the list already owns.
  • A gap with no line in it is spacing, not a divider: spacing here only sizes the breathing room that comes with the rule itself.

Import

tsx
1
import { HkDivider } from "@celestia-island/hikari";
rust
1
2
use hikari_components::*;          // Divider, DividerOrientation, DividerTone, DividerVariant, DividerSpacing, DividerLength
use hikari_components::prelude::*; // rsx!, VNode

The Rust form is a plain function, Divider(DividerProps { … }). Every prop may be omitted inside rsx!; omitting all five yields the same bare hk-divider rule the Vue component renders by default.

Orientation and tone

orientation picks the axis: horizontal (the default) is the unmodified base class and takes the full inline width; vertical adds hk-divider-vertical and becomes a rule that stretches along the block axis of a flex row. tone is the ink weight — subtle is the default, faint is the lighter hairline used between zones, and input is the heavier line used to separate input rows. Only the non-default values emit a modifier class, so the class list stays as short as the configuration.

A vertical rule stretches through whatever height its flex row has — give it a row with alignItems: "stretch" (or the cross-axis default) and it spans the tallest neighbour, or pin a length and it centres itself at that size. An alignItems: "center" row is still fine for a stretched rule too, because align-self: stretch wins over the container's alignment.

Above the subtle rule.

Below it.

LeftRight

Variant, spacing and vertical length

variant swaps the stroke: solid is the default and emits nothing, dashed adds hk-divider-dashed. spacing is the breathing room around the rule — none (the default, no margin at all), then xs / sm / md / lg / xl, applied as margin-block on a horizontal rule and margin-inline on a vertical one, so the same step reads as vertical air or horizontal air depending on the axis.

length is the vertical rule's size along its own axis: stretch (the default) keeps align-self: stretch with height: auto; any other step centres the rule (align-self: center) and pins its height. Horizontal rules ignore length entirely — every length rule in the sheet is scoped under .hk-divider-vertical.

Dashed, with md spacing on both sides.

Solid without spacing.

ShortruleTall

API

Vue

Props

NameTypeDefaultRequired
orientationString as PropType<DividerOrientation>"horizontal"—
toneString as PropType<DividerTone>"subtle"—
variantString as PropType<DividerVariant>"solid"—
spacingString as PropType<DividerSpacing>"none"—
lengthString as PropType<DividerLength>"stretch"—

Rust

Props — Divider

PropTypeDefaultDescription
orientationDividerOrientationDividerOrientation::HorizontalThe rule's axis (Vue default "horizontal").
toneDividerToneDividerTone::SubtleColor weight (Vue default "subtle").
variantDividerVariantDividerVariant::SolidStroke (Vue default "solid").
spacingDividerSpacingDividerSpacing::NoneBreathing room (Vue default "none").
lengthDividerLengthDividerLength::StretchVertical height (Vue default "stretch").

Accessibility

  • The rule is aria-hidden="true" in both forms, so it is invisible to assistive technology: it cannot announce a boundary, and it cannot be focused or reached by the keyboard.
  • A visual separation that carries meaning — "these two groups are different things" — needs that meaning in the markup: a heading, a labelled group, or a role="separator" element you author yourself around the content. The divider is styling only.
  • Because the divider is decoration, a page that loses its stylesheet loses only the line. Nothing in a form or a list depends on the divider to be understood.

Related components

  • HkSectionCard — the titled section: a heading, a hint and a card, the structure a divider only hints at.
  • HkScrollContainer — the scroll region whose edges this family's other pages cover.
  • HkCard — the bordered surface a divided section usually sits in.