ui/combobox
Types
pub type MenuTrigger {
Input
Focus
Manual
}
Constructors
-
Input -
Focus -
Manual
Keyboard messages for combobox component.
pub type Msg {
Open
Close
MoveNext
MovePrev
MoveFirst
MoveLast
Select
TypeAhead(String)
SelectAndClose
Clear
}
Constructors
-
OpenOpen the dropdown (ArrowDown, ArrowUp, Alt+ArrowDown, Alt+ArrowUp)
-
CloseClose the dropdown (Escape)
-
MoveNextMove to next option (ArrowDown)
-
MovePrevMove to previous option (ArrowUp)
-
MoveFirstMove to first option (Home)
-
MoveLastMove to last option (End)
-
SelectSelect the currently highlighted option (Enter)
-
TypeAhead(String)Type-ahead search (Character keys)
-
SelectAndCloseSelect and close (Enter)
-
ClearClear the input (Escape when open)
Values
pub fn allows_custom_value() -> attribute.Attribute(a)
pub fn aria_activedescendant(
id: String,
) -> attribute.Attribute(a)
Attribute to indicate the currently active descendant.
pub fn aria_controls(id: String) -> attribute.Attribute(a)
Attribute to indicate controls relationship.
pub fn aria_expanded(expanded: Bool) -> attribute.Attribute(a)
Attribute to indicate expanded state.
pub fn chevron_icon(
attributes: List(attribute.Attribute(a)),
) -> element.Element(a)
pub fn combobox(
attributes: List(attribute.Attribute(a)),
) -> element.Element(a)
pub fn disabled() -> attribute.Attribute(a)
pub fn empty_state(
attributes: List(attribute.Attribute(a)),
) -> element.Element(a)
pub fn input_field(
attributes: List(attribute.Attribute(a)),
) -> element.Element(a)
pub fn invalid() -> attribute.Attribute(a)
pub fn keymap(
key_event: keyboard.KeyEvent,
is_open: Bool,
) -> option.Option(Msg)
Keymap for combobox keyboard navigation. Follows WAI-ARIA combobox pattern:
- ArrowDown/ArrowUp: Open dropdown and navigate
- Alt+ArrowDown/Alt+ArrowUp: Open dropdown
- Escape: Close dropdown
- Enter: Select highlighted option
- Character: Type-ahead search and filter
pub fn listbox(
attributes: List(attribute.Attribute(a)),
children: List(element.Element(a)),
) -> element.Element(a)
pub fn listbox_element_id() -> String
Get the element ID for the combobox listbox.
pub fn menu_trigger(mt: MenuTrigger) -> attribute.Attribute(a)
pub fn option(
attributes: List(attribute.Attribute(a)),
label: String,
option_value: String,
) -> element.Element(a)
pub fn option_element_id(index: Int) -> String
Get the element ID for a combobox option at the given index.
pub fn option_group(
attributes: List(attribute.Attribute(a)),
label: String,
children: List(element.Element(a)),
) -> element.Element(a)
pub fn placeholder(placeholder: String) -> attribute.Attribute(a)
pub fn required() -> attribute.Attribute(a)
pub fn size(s: Size) -> attribute.Attribute(a)
pub fn value(val: String) -> attribute.Attribute(a)
pub fn variant(v: Variant) -> attribute.Attribute(a)