ui/radio_group
Types
Keyboard messages for radio group component.
pub type Msg {
MoveNext
MovePrev
MoveFirst
MoveLast
Select
}
Constructors
-
MoveNextMove to next radio button (ArrowRight or ArrowDown)
-
MovePrevMove to previous radio button (ArrowLeft or ArrowUp)
-
MoveFirstMove to first radio button (Home)
-
MoveLastMove to last radio button (End)
-
SelectSelect the currently focused radio button (Space)
Values
pub fn keymap(key_event: keyboard.KeyEvent) -> option.Option(Msg)
Keymap for radio group keyboard navigation. Follows WAI-ARIA radio group pattern:
- ArrowRight/ArrowDown: Move to next radio button (wraps)
- ArrowLeft/ArrowUp: Move to previous radio button (wraps)
- Home: Move to first radio button
- End: Move to last radio button
- Space: Select the currently focused radio button
pub fn option(
attributes: List(attribute.Attribute(a)),
children: List(element.Element(a)),
) -> element.Element(a)
pub fn radio_element_id(index: Int) -> String
Get the element ID for a radio button at the given index.
pub fn radio_group(
attributes: List(attribute.Attribute(a)),
children: List(element.Element(a)),
) -> element.Element(a)
pub fn size(s: Size) -> attribute.Attribute(a)
pub fn variant(v: Variant) -> attribute.Attribute(a)