Select
Dropdown for choosing one or many values, with optional search, grouped options, multi-select with caps, and a native variant.
Basic
Label, description, and help text
Combine label, sublabel, description, and help_text to render the full form-field chrome around the toggle.
Sets default tax and shipping rates.
Sizes
Pre-selected value
Pass value to set the initial selection. The toggle renders the matching option's label on first paint.
Disabled options
Mark individual options with disabled: true. They are visually muted, ignored by clicks, and skipped during keyboard navigation and typeahead.
Option formats
Options accept any shape Phoenix.HTML.Form.options_for_select/2 understands: bare strings, {label, value} tuples, atom-keyed keyword pairs, ranges, and more.
Grouped and nested options
Wrap options in {group_label, children} tuples. Groups can nest to any depth, and each level receives a --depth CSS variable for indentation.
Native mode
Pass native to render a plain HTML select. Drops search, multi-select, custom rendering, and affix slots, but keeps labels, sizing, and form-field binding.
Searchable
Pass searchable to add a sticky search input on top of the listbox. Filtering is case-insensitive, the query persists across close/reopen, and arrow keys forward to the listbox.
Search threshold
Set search_threshold to require a minimum query length before filtering kicks in. Below the threshold, the full list is shown and no on_search event is dispatched.
Listbox height
The listbox is capped at max-h-72 and shrinks to fit the space available, only opening on the other side once that space gets too small. Pass another max-h-* through class to change the cap, or max-h-none to use all the space on whichever side it opens.
Server-driven search
Pass on_search to delegate filtering to a LiveView handler. The component debounces input, shows a loading indicator, and patches the list in place while preserving open and highlight state.
Cascading selects
Drive each select's options from the previous one's value. A single phx-change fires for the whole form; the LiveView swaps the dependent options based on the new value and the listbox patches in place while preserving open state. Disable each dependent field until its parent has a value, and reset its selection if the parent changes to a value where the previous choice no longer applies.
Multiple selection
Pass multiple to accept several values. The dropdown stays open after each click for picking a few in a row, and form params arrive as a list.
Capped multi-select
Combine multiple with max to cap how many values can be picked. Once the cap is reached, additional selections are ignored until something is deselected.
Clearable
Pass clearable to expose a clear button in the toggle. Clicking the active option also deselects it, and pressing Backspace while the toggle is focused clears the selection.
Multi-select with chip toggle labels
Combine multiple with a :toggle_label slot to render each selection as a colored chip instead of a comma-separated list. The slot is invoked once per selected option and runs inside the default toggle chrome.
Inner affixes
:inner_prefix sits inside the toggle border, before the value area. :inner_suffix replaces the default chevron, so render your own indicator if it is still needed.
Outer affixes (input group)
:outer_prefix and :outer_suffix sit beside the field, sharing a border to form a single input group. Match the affix child's size to the select's.
Header and footer slots
:header and :footer stay pinned in the listbox while the options scroll. Drop filter chips above the list, or a 'create new' action below it.
Footer action with LiveView event
:footer can host a LiveView-bound action like 'Create new'. The handler appends to the options assign and the listbox patches in place, so the dropdown stays open and context is preserved.
Create new via modal
Combine the :footer slot with JS helpers to drive a full create flow. The footer button chains Fluxon.close_select/1 with Fluxon.open_dialog/1 client-side, so the dropdown collapses as the modal animates in. On submit, the handler appends the new option, pre-selects it by setting the form value, and chains Fluxon.close_dialog/2 with Fluxon.open_select/2 on the socket. The listbox patches in place and reopens with the new tag already selected.
Create new tag
Give the tag a short, recognizable name.
Custom option rendering
Pass an :option slot to fully control each row. The {label, value} tuple is yielded to the slot, and the wrapping element exposes data-highlighted and data-selected for styling.
User picker (option and toggle label together)
Pair :option and :toggle_label to render rich rows in the dropdown and a compact chip in the toggle. The :option slot drives the listbox; :toggle_label drives the selected-value display while keeping the default chrome (border, focus ring, chevron, clear button).
Custom toggle label
Use :toggle_label to customize how the selected value is rendered while keeping the default chrome (border, focus ring, chevron, clear button, affixes).
Custom toggle (full replacement)
Use :toggle to replace the entire trigger element. The component still wires up open/close, keyboard, and ARIA, but the visual design (border, padding, hover, focus, indicator) is yours. The slot is invoked once per selected option, so set an initial value or render the field only after a selection exists.
Form integration
Bind to a Phoenix form field with field={f[:...]}. Name, value, id, and validation errors are derived from the form, and a hidden native select keeps standard form submissions and validations working.
Validation errors
Pass errors as a list of strings to render messages and apply invalid styling. Bound forms populate this automatically once the input has been touched.
This field is required
This field is required
Pick at least one advisory