Expand description
Accordion — a collapsible section with a clickable header that shows or hides its content when activated.
In the default vertical mode a horizontally-spanning header row sits above the
content; clicking or pressing Space/Enter toggles visibility with an animated
height disclosure (via Collapse).
A horizontal mode flips the header into a narrow vertical strip with a rotated
label — used by top/bottom sides of a DockingLayout. Fill mode (.fill(true))
is designed for fixed-size slots such as Splitter panes: the content fills all
available space and collapse animation is driven externally by the enclosing
pane rather than by an internal height tween.
§Accessibility
The header is announced as Role::Button with aria-expanded reflecting the
current state, and aria-controls pointing at the content region
(Role::Region). Space/Enter toggle the disclosure; AT “click” actions are
also handled. The focus ring appears only on keyboard focus (not on pointer
clicks), matching the IntUI convention.
let expanded = Signal::new(false);
let _accordion = Accordion::new(lit!("Advanced settings"), expanded);Structs§
- Accordion
- A collapsible section widget whose header button shows or hides attached content.
Enums§
- Accordion
Orientation - Orientation of an
Accordion: how its header sits relative to its content.Vertical(the default) is a horizontal header row above the content;Horizontalis a narrow vertical header strip (rotated-90° label, left/right chevron) beside the content — used by top/bottom dock sides.
Constants§
- ACCORDION_
CORNER_ RADIUS - Corner radius of the keyboard-focus ring painted on the accordion header.
- ACCORDION_
HEADER_ HEIGHT - Height of the accordion header row in pixels (vertical mode).
- ACCORDION_
HEADER_ PADDING_ HORIZONTAL - Horizontal padding inside the accordion header on the leading and trailing edges.
- ACCORDION_
INDICATOR_ GAP - Gap between the disclosure indicator and the title label.
- ACCORDION_
INDICATOR_ SIZE - Size of the chevron disclosure indicator icon in pixels.