Skip to main content

Module accordion

Module accordion 

Source
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§

AccordionOrientation
Orientation of an Accordion: how its header sits relative to its content. Vertical (the default) is a horizontal header row above the content; Horizontal is 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.