ui/grid_list
Types
Keyboard messages for grid list component.
pub type Msg {
MoveDown
MoveUp
MoveRight
MoveLeft
MoveRowStart
MoveRowEnd
MoveGridFirst
MoveGridLast
Select
ExtendSelectionDown
ExtendSelectionUp
ExtendSelectionRight
ExtendSelectionLeft
}
Constructors
-
MoveDownMove to next row (ArrowDown)
-
MoveUpMove to previous row (ArrowUp)
-
MoveRightMove to next column (ArrowRight)
-
MoveLeftMove to previous column (ArrowLeft)
-
MoveRowStartMove to first item in row (Home)
-
MoveRowEndMove to last item in row (End)
-
MoveGridFirstMove to first item in grid (Ctrl+Home)
-
MoveGridLastMove to last item in grid (Ctrl+end)
-
SelectSelect the currently focused item (Enter or Space)
-
ExtendSelectionDownExtend selection with Shift+Arrow (multi-select mode)
-
ExtendSelectionUpExtend selection with Shift+Arrow (multi-select mode)
-
ExtendSelectionRightExtend selection with Shift+Arrow (multi-select mode)
-
ExtendSelectionLeftExtend selection with Shift+Arrow (multi-select mode)
pub type SelectionMode {
None
Single
Multiple
}
Constructors
-
None -
Single -
Multiple
Values
pub fn activedescendant(id: String) -> attribute.Attribute(a)
pub fn aria_label(label: String) -> attribute.Attribute(a)
pub fn grid_item_element_id(row: Int, col: Int) -> String
Get the element ID for a grid item at the given row and column.
pub fn grid_list(
attributes: List(attribute.Attribute(a)),
children: List(element.Element(a)),
) -> element.Element(a)
pub fn grid_list_item(
attributes: List(attribute.Attribute(a)),
children: List(element.Element(a)),
) -> element.Element(a)
pub fn grid_row_element_id(row: Int) -> String
Get the element ID for a grid row at the given index.
pub fn keymap(
key_event: keyboard.KeyEvent,
multi_select: Bool,
) -> option.Option(Msg)
Keymap for grid list keyboard navigation. Follows WAI-ARIA grid pattern:
- ArrowDown: Move to next row
- ArrowUp: Move to previous row
- ArrowRight: Move to next column
- ArrowLeft: Move to previous column
- Home: Move to first item in row
- End: Move to last item in row
- Ctrl+Home: Move to first item in grid
- Ctrl+End: Move to last item in grid
- Enter/Space: Select focused item
- Shift+Arrow: Extend selection (multi-select mode)
pub fn selection_mode(m: SelectionMode) -> attribute.Attribute(a)
pub fn size(s: Size) -> attribute.Attribute(a)
pub fn variant(v: Variant) -> attribute.Attribute(a)