Autocomplete
Searchable single-select combobox with grouped options and custom row templates.
Basic
Label, description, and help text
Combine label, sublabel, description, and help_text to build the full form-field chrome around the input.
Tailors the dashboard and report set we surface for you.
Sizes
Grouped and nested options
Wrap options in {group_label, children} tuples. Groups can nest to any depth, and empty groups are hidden automatically while filtering.
Search modes
search_mode picks how the typed query matches each label during client-side filtering. Always case insensitive.
Search threshold
Set search_threshold to require a minimum number of characters before the listbox opens or filtering runs.
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. The class also lands on the input wrapper, so keep the cap large enough to be irrelevant to a single-line field.
Open on focus
open_on_focus opens the listbox the moment the input gets focus, even with an empty query.
Clearable selection
Pass clearable to render a clear button inside the input whenever a value is selected. Clearing resets the selection and re-shows every option.
Inner affixes
:inner_prefix and :inner_suffix sit inside the input border, so icons like a leading search glyph travel with the field.
Outer affixes (input group)
:outer_prefix and :outer_suffix sit beside the field, sharing borders with it to form a single input group. Match the affix child's size to the autocomplete's.
Header and footer slots
:header and :footer stay pinned in the listbox regardless of the active query. Drop filter chips above the list, or a 'create new' action below it.
Custom option rendering
Pass an :option slot to fully control how each row renders. The {label, value} tuple is yielded to the slot, and the wrapping element exposes data-highlighted and data-selected for styling.
Custom empty state
Provide an :empty_state slot to replace the default text-only 'no results' message with a richer block. Falls back to no_results_text when the slot is omitted.
Create new department
Server-driven search
Pass on_search to hand filtering to a LiveView event. The component dispatches the event with %{"query" => query, "id" => component_id} and shows a loading indicator while the LiveView assigns fresh options.
Search debouncing
debounce sets the milliseconds the component waits between keystrokes before dispatching on_search. Keeps request volume down on busy fields.
Form integration
Bind to a Phoenix form field with field={f[:assigned_to_id]}. Name, value, id, and validation errors are derived from the form automatically.
Disabled
Validation errors
Pass errors as a list of strings to render messages and apply invalid styling. Bound forms populate this automatically from the changeset.
This field is required
This field is required
Pick at least one advisory