Advanced select components for PhiaUI.
Provides three higher-level selection patterns beyond the native <select>:
tree_select/1+tree_select_option/1— hierarchical dropdown with expand/collapse via thePhiaTreeSelectJS hook.rich_select/1+rich_select_option/1— visible option list where each option has an avatar/icon, title, and optional description. Pure HEEx.visual_select/1+visual_select_item/1— grid of image/icon tiles backed by radio inputs. Pure HEEx.
Summary
Functions
Renders a visible list of rich radio options — each with avatar/icon + title + description.
Pure HEEx, no JS required. Use phx-click or wrap in a Phoenix form for submission.
Standalone rich select option row — for composable usage outside rich_select/1.
Renders a hierarchical tree-select dropdown.
Renders a single tree node: expand toggle (if children) + clickable label. Children are rendered recursively, initially hidden (managed by JS hook).
Renders a grid of visual radio-backed option tiles. Each tile can display an image, an icon, a label, and a description. Pure HEEx — no JS required.
Standalone visual select tile — for composable usage outside visual_select/1.
Functions
Renders a visible list of rich radio options — each with avatar/icon + title + description.
Pure HEEx, no JS required. Use phx-click or wrap in a Phoenix form for submission.
Attributes
id(:string) - HTML id for the fieldset. Defaults tonil.value(:string) - Currently selected option value. Defaults tonil.name(:string) - Name attribute for the hidden radio inputs. Defaults to"rich_select".on_change(:string) - LiveView event name fired viaphx-clickwhen an option is selected. Defaults tonil.placeholder(:string) - Optional prompt text shown above the options list (aria-label fallback). Defaults tonil.options(:list) - List of option maps. Supported keys::value(required) — option value string:label(required) — display title:description— optional subtitle text:icon— Lucide icon name string:avatar_src— URL for an avatar image
Defaults to
[].size(:atom) - Controls option row height and text size. Defaults to:default. Must be one of:sm,:default, or:lg.class(:string) - Additional CSS classes. Defaults tonil.
Standalone rich select option row — for composable usage outside rich_select/1.
Attributes
value(:string) (required) - Option value.label(:string) (required) - Display title.description(:string) - Optional subtitle text. Defaults tonil.icon(:string) - Lucide icon name. Defaults tonil.avatar_src(:string) - Avatar image URL. Defaults tonil.selected(:boolean) - Whether this option is currently selected. Defaults tofalse.name(:string) - Radio input name. Defaults to"rich_select".on_change(:string) - LiveView event name. Defaults tonil.class(:string) - Additional CSS classes. Defaults tonil.
Renders a hierarchical tree-select dropdown.
The trigger button opens a popover panel. Nodes with children show an expand
toggle. Selecting a leaf fires on_change via the PhiaTreeSelect JS hook.
The tree structure is passed via data-options (JSON) and rendered client-side.
A hidden <input> carries the selected value for form submission.
Attributes
id(:string) (required) - Unique ID — required for PhiaTreeSelect hook.value(:string) - Currently selected node value. Defaults tonil.placeholder(:string) - Text shown when no value is selected. Defaults to"Select…".options(:list) - Nested option list. Each map:%{label: String, value: String, children: [...]}. Children are optional.Defaults to
[].on_change(:string) - LiveView event name fired when a node is selected. Defaults tonil.disabled(:boolean) - Disables the trigger. Defaults tofalse.class(:string) - Additional CSS classes on the root element. Defaults tonil.
Renders a single tree node: expand toggle (if children) + clickable label. Children are rendered recursively, initially hidden (managed by JS hook).
Attributes
option(:map) (required) - Option map:%{label, value, children: [...]}.selected_value(:string) - Currently selected value. Defaults tonil.level(:integer) - Nesting depth (0 = root). Defaults to0.id_prefix(:string) - ID prefix for expand toggles. Defaults to"ts".
Renders a grid of visual radio-backed option tiles. Each tile can display an image, an icon, a label, and a description. Pure HEEx — no JS required.
Attributes
id(:string) - HTML id for the fieldset. Defaults tonil.name(:string) (required) - Name attribute for the radio inputs.value(:string) - Currently selected option value. Defaults tonil.cols(:integer) - Number of grid columns (2, 3, or 4). Defaults to3.options(:list) - List of option maps. Supported keys::value(required):label— display text below the tile:icon— Lucide icon name (shown if no image):image_src— image URL for the tile thumbnail:description— small descriptive text
Defaults to
[].class(:string) - Additional CSS classes on the grid container. Defaults tonil.
Standalone visual select tile — for composable usage outside visual_select/1.
Attributes
value(:string) (required) - Option value.label(:string) - Display label below the tile. Defaults tonil.image_src(:string) - Thumbnail image URL. Defaults tonil.description(:string) - Small descriptive text. Defaults tonil.selected(:boolean) - Whether this item is currently selected. Defaults tofalse.name(:string) - Radio input name. Defaults to"visual_select".class(:string) - Additional CSS classes. Defaults tonil.