PUI. Select. Primitive
(pui v1.0.0)
Copy Markdown
Zero-style, hook-wired select parts.
The root accepts search_event and search_debounce for server-backed
search. Add search/1 inside the listbox content when the select is
searchable; the host LiveView owns querying and re-rendering the options.
Parts
| Part | Description |
|---|---|
root/1 | Hook root and remote-search configuration |
input/1 | Hidden form value |
trigger/1 | Accessible select trigger |
value/1 | Selected label or placeholder |
content/1 | Listbox content |
search/1 | Zero-style search input |
item/1 | Select option |
Summary
Functions
Renders the zero-style search input for a searchable select.
Functions
Attributes
id(:string) (required)trigger_id(:string) (required)- Global attributes are accepted.
Slots
inner_block(required)
Attributes
id(:string) (required)name(:string) - Defaults tonil.value(:string) - Defaults tonil.- Global attributes are accepted.
Attributes
value(:string) (required)id(:string) - Defaults tonil.- Global attributes are accepted.
Slots
inner_block(required)
Attributes
id(:string) (required)value(:string) - Defaults tonil.search_event(:string) - Defaults tonil.search_debounce(:integer) - Defaults to300.- Global attributes are accepted.
Slots
inner_block(required)
Renders the zero-style search input for a searchable select.
Place this part inside content/1. The surrounding root/1 controls whether
typing dispatches a LiveView search event through search_event.
Attributes
id(:string) (required)listbox_id(:string) - Defaults tonil.placeholder(:string) - Defaults to"Search item...".- Global attributes are accepted.
Attributes
id(:string) (required)listbox_id(:string) (required)invalid(:boolean) - Defaults tofalse.- Global attributes are accepted.
Slots
inner_block(required)
Attributes
placeholder(:string) - Defaults to"Select an item".- Global attributes are accepted.
Slots
inner_block