Smart and interactive input components for PhiaUI.
Provides inputs with advanced interaction patterns:
drag_number/1+form_drag_number/1— Figma-style scrubber: drag horizontally to change a numeric value (PhiaDragNumber hook).suggestion_input/1+form_suggestion_input/1— text input with an inline ghost-text suggestion; Tab accepts (PhiaSuggestionInput hook).emoji_picker/1— button that opens an emoji grid popover with category tabs and search (PhiaEmojiPicker hook).keyboard_shortcut_input/1+form_keyboard_shortcut_input/1— input that captures and displays a key combination (PhiaKeyShortcut hook).
Summary
Functions
Renders a numeric display that responds to horizontal drag (Figma scrubber style).
Drag left to decrease, right to increase. The PhiaDragNumber hook fires
pushEvent(on_change, %{value: newValue}) on each change.
A hidden <input> carries the value for form submission.
Renders a button that opens an emoji picker popover.
The PhiaEmojiPicker hook renders a category-tabbed grid with search.
Clicking an emoji fires on_pick via pushEvent.
FormField-integrated wrapper for drag_number/1.
FormField-integrated wrapper for keyboard_shortcut_input/1.
FormField-integrated wrapper for suggestion_input/1.
Renders an input that captures a keyboard shortcut.
Click to focus, press the key combination, and it is formatted and stored.
The PhiaKeyShortcut hook fires pushEvent(on_change, %{shortcut: "Ctrl+K"}).
Renders a text input with an inline ghost-text suggestion overlay.
The PhiaSuggestionInput hook positions a transparent <span> behind the
input showing the suggestion completion. Tab accepts, Esc dismisses.
Functions
Renders a numeric display that responds to horizontal drag (Figma scrubber style).
Drag left to decrease, right to increase. The PhiaDragNumber hook fires
pushEvent(on_change, %{value: newValue}) on each change.
A hidden <input> carries the value for form submission.
Attributes
id(:string) (required) - Root element ID — required for PhiaDragNumber hook.value(:any) - Current numeric value (integer or float). Defaults to0.min(:any) - Minimum allowed value. Defaults tonil.max(:any) - Maximum allowed value. Defaults tonil.step(:any) - Increment per pixel dragged. Defaults to1.unit(:string) - Unit suffix shown after the value (e.g. "px", "%"). Defaults tonil.on_change(:string) - LiveView event fired with%{value: N}. Defaults tonil.disabled(:boolean) - Disables drag interaction. Defaults tofalse.class(:string) - Additional CSS classes. Defaults tonil.
Renders a button that opens an emoji picker popover.
The PhiaEmojiPicker hook renders a category-tabbed grid with search.
Clicking an emoji fires on_pick via pushEvent.
Attributes
id(:string) (required) - Root ID — required for PhiaEmojiPicker hook.on_pick(:string) - LiveView event fired with%{emoji: "..."}on selection. Defaults tonil.trigger_label(:string) - Button label / emoji shown on the trigger. Defaults to"😊".placement(:atom) - Popover placement relative to the trigger. Defaults to:bottom. Must be one of:bottom,:top,:left, or:right.class(:string) - Additional CSS classes on the root element. Defaults tonil.
FormField-integrated wrapper for drag_number/1.
Attributes
field(Phoenix.HTML.FormField) (required) - A Phoenix.HTML.FormField struct.label(:string) - Label text. Defaults tonil.description(:string) - Helper text. Defaults tonil.min(:any) - Minimum value. Defaults tonil.max(:any) - Maximum value. Defaults tonil.step(:any) - Step per pixel. Defaults to1.unit(:string) - Unit suffix. Defaults tonil.class(:string) - Additional CSS classes. Defaults tonil.
FormField-integrated wrapper for keyboard_shortcut_input/1.
Attributes
field(Phoenix.HTML.FormField) (required) - A Phoenix.HTML.FormField struct.label(:string) - Label text. Defaults tonil.description(:string) - Helper text. Defaults tonil.placeholder(:string) - Placeholder text. Defaults to"Click to record shortcut…".on_change(:string) - LiveView event name. Defaults tonil.class(:string) - Additional CSS classes. Defaults tonil.
FormField-integrated wrapper for suggestion_input/1.
Attributes
field(Phoenix.HTML.FormField) (required) - A Phoenix.HTML.FormField struct.label(:string) - Label text. Defaults tonil.description(:string) - Helper text. Defaults tonil.suggestion(:string) - Ghost-text suggestion. Defaults tonil.on_accept(:string) - Accept event name. Defaults tonil.placeholder(:string) - Placeholder text. Defaults tonil.class(:string) - Additional CSS classes. Defaults tonil.
Renders an input that captures a keyboard shortcut.
Click to focus, press the key combination, and it is formatted and stored.
The PhiaKeyShortcut hook fires pushEvent(on_change, %{shortcut: "Ctrl+K"}).
Attributes
id(:string) (required) - Root ID — required for PhiaKeyShortcut hook.name(:string) - Hidden input name for form submission. Defaults tonil.value(:string) - Current shortcut string (e.g. "Ctrl+Shift+K"). Defaults tonil.placeholder(:string) - Placeholder text. Defaults to"Click to record shortcut…".on_change(:string) - LiveView event fired with%{shortcut: "..."}on capture. Defaults tonil.disabled(:boolean) - Disables the input. Defaults tofalse.class(:string) - Additional CSS classes. Defaults tonil.
Renders a text input with an inline ghost-text suggestion overlay.
The PhiaSuggestionInput hook positions a transparent <span> behind the
input showing the suggestion completion. Tab accepts, Esc dismisses.
Attributes
id(:string) (required) - Root ID — required for PhiaSuggestionInput hook.name(:string) - Input name for form submission. Defaults tonil.value(:string) - Current input value. Defaults to"".suggestion(:string) - Ghost-text suggestion shown inline. Tab key accepts it. Defaults tonil.on_accept(:string) - LiveView event fired when the user accepts the suggestion (Tab). Defaults tonil.on_change(:string) - LiveView event fired on input change. Defaults tonil.placeholder(:string) - Placeholder text. Defaults tonil.disabled(:boolean) - Disables the input. Defaults tofalse.class(:string) - Additional CSS classes. Defaults tonil.