TailwindLiveComponents.Listbox (tailwind_live_components v0.2.1) View Source

Link to this section Summary

Functions

Renders the listbox element

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 identifier
  • field - The field name
  • label - The text for the generated <label> element
  • value - The current value for the input
  • detail - Optional detail shown below the input
  • prompt - An option to include at the top of the options with the given prompt text
  • options - The options in the list box
  • error - Optional error message
  • theme - Optional theme to use for Tailwind classes