Skip to content
Glint UI

Separator

A hairline between sections — a line, and deliberately nothing more.

Usage

import { Separator, SeparatorOrientation } from "@glint/components/separator.slint";
import { Tokens } from "@glint/theme/tokens.slint";
export component AppWindow inherits Window {
width: 560px;
height: 200px;
background: Tokens.color-background;
VerticalLayout {
alignment: center;
padding: 24px;
Separator {
orientation: SeparatorOrientation.horizontal;
}
}
}

Separator renders a 1px hairline divider that automatically stretches along its layout’s long axis while pinning its thickness.

Examples

Orientations

Separators support horizontal and vertical orientations via orientation: SeparatorOrientation.horizontal and orientation: SeparatorOrientation.vertical.

Captioned separator

Provide text to turn the separator into a captioned divider with centered label text.

API Reference

Properties

PropertyTypeDefaultDescription
orientationin SeparatorOrientationSeparatorOrientation.horizontalhorizontal (default) or vertical. Ignored while there is a caption, which is horizontal by construction.
textin stringno defaultCaption centred in the rule; empty (the default) is the bare hairline.

Enums

EnumValues
SeparatorOrientationhorizontal, vertical

Accessibility

  • Decorative by construction. Separator is a hairline Rectangle with no accessible-role, no label and no focus behaviour, so it never appears in the accessibility tree and the keyboard passes over it. A rule that a reader cannot see is not a rule they are missing: what separates the sections for them is the sections’ own names.
  • Grouping is a role, not a line. Where the split is structural — a form broken into parts, a menu into runs — the grouping has to be carried by something that announces it: GroupBox for a titled frame, a named region for a pane, or a menu separator, which belongs to the row under it and is drawn by MenuPanel rather than by this component (ADR-0012). Reach for Separator when the line is the whole intent.