Skip to content
Glint UI

Collapsible

A trigger and the region it shows or hides, announcing its own expanded state.

Usage

import { Collapsible } from "@glint/components/collapsible.slint";
import { Tokens } from "@glint/theme/tokens.slint";
export component AppWindow inherits Window {
width: 560px;
height: 260px;
background: Tokens.color-background;
VerticalLayout {
alignment: center;
padding: 24px;
Collapsible {
title: "Advanced developer options";
Text {
text: "Enable verbose debugging and telemetry log capture.";
color: Tokens.color-muted-foreground;
}
}
}
}

Collapsible renders a standalone expandable button row that reveals or hides child content with smooth height transitions.

Examples

Controlled open state

Bind open with <=> to programmatically open or close the collapsible from external controls or state.

API Reference

Properties

PropertyTypeDefaultDescription
titlein stringno defaultTrigger label shown next to the chevron.
openin-out boolfalseTwo-way; when true, @children are visible.

Callbacks

CallbackDescription
toggled(bool)Fired with the new open value after a toggle click.

Accessibility

  • Expandable button role. The trigger row is an accessible-role: button with accessible-expandable: true and accessible-expanded reflecting the open state.
  • Keyboard activation. Focusing the trigger and pressing Space or Enter toggles the collapsible.
  • Content visibility. Collapsed content is hidden from screen readers and removed from the keyboard tab order while closed.
  • Focus ring. Displays a prominent keyboard focus ring when navigated using Tab.