Skip to main content

Module radio_tile_group

Module radio_tile_group 

Source
Expand description

RadioTileGroup — an N-ary group of RadioTiles with single selection.

Like SegmentedControl, the tile count is not fixed: add any number of tiles, all sharing one Signal<usize>. The group owns:

  • Layout — an equal-size TileLayout::Row, an adaptive wrapping TileLayout::Grid, a full-width TileLayout::Column, or a compact fixed-height TileLayout::Vertical settings list. Row and Grid equalize tile size (uniform width + the tallest tile’s height) via a custom place_children measuring each tile height-for-width — stacks have no cross-axis stretch, so the group does the sizing.
  • Keyboard — the WAI-ARIA roving radiogroup pattern: the group is a single Tab stop; Arrow keys move selection (selection follows focus), Home/End jump, disabled tiles are skipped. Increment/Decrement AT actions mirror the arrows for switch access.
  • AccessibilityRole::RadioGroup with active_descendant pointing at the selected tile; each tile is Role::RadioButton and declares its siblings via push_to_radio_group (for “N of M”).
let selected = ctx.signal(0_usize);
RadioTileGroup::new(selected)
    .label(tr!(project_format()))
    .tile(RadioTile::new().icon(a).title(tr!(single_file())).description(tr!(single_file_desc())))
    .tile(RadioTile::new().icon(b).title(tr!(bundle())).description(tr!(bundle_desc())))
    .layout(TileLayout::Row)

Structs§

RadioTileGroup
An N-ary, single-selection group of selectable-card radios. See the module docs.

Enums§

TileLayout
How a RadioTileGroup arranges its tiles.