Lotus.Web.SelectComponent (Lotus Web v0.14.5)
View SourceA Tailwind-styled, accessible single-select dropdown.
Props:
- id - required, base id for button & listbox
- name - required, posted param name
- options - required, list of {label, value}
- value - current value (string/integer)
- label - optional label text
- prompt - optional prompt text when no value is selected
- disabled - boolean
- errors - list of error strings (shown under the field)
Emits:
- updates the hidden
<input name>sophx-changeon the surrounding form receives the change as usual.
Summary
Functions
Callback implementation for Phoenix.LiveComponent.handle_event/3.
Callback implementation for Phoenix.LiveComponent.update/2.
Functions
Callback implementation for Phoenix.LiveComponent.handle_event/3.
Attributes
id(:string) (required)name(:string) (required)options(:list) (required)value(:any) - Defaults tonil.label(:string) - Defaults tonil.floating_label(:boolean) - Defaults tofalse.prompt(:string) - Defaults tonil.disabled(:boolean) - Defaults tofalse.errors(:list) - Defaults to[].show_icons(:boolean) - Defaults tofalse.class(:string) - Defaults tonil.
Callback implementation for Phoenix.LiveComponent.update/2.