TailwindLiveComponents.Listbox (tailwind_live_components v0.1.0) View Source
Link to this section Summary
Link to this section Functions
Renders the listbox element
<.listbox form={:basket} field={:fruit} prompt="Select Fruit" options={[
%{value: "apple", display: "Apple", detail: "yummy apple"},
%{value: "banana", display: "Banana", detail: "yummy banana"},
%{value: "cherry", display: "Cherry", detail: "yummy cherry"}
]} />
Options
form
- The form identifierfield
- The field namelabel
- The text for the generated<label>
elementdetail
- Optional detail shown below the inputprompt
- An option to include at the top of the options with the given prompt textoptions
- The options in the list boxerror
- Optional error messagetheme
- Optional theme to use for Tailwind classes
Renders the listbox element
Options
option
- The value field for the optionindex
- The index position in the option listselected
- Boolean indicating whether this option is selectedoption_id
- The DOM id to use for this option