Time selection input — styled native <input type="time">.
Wraps the browser's native time picker with PhiaUI's input styling (borders, focus ring, size variants, error state). Supports standalone use or Phoenix form field integration with changeset error display.
Present in every major UI kit: Mantine TimeInput, Ant Design TimePicker,
MUI TimePicker, React Aria TimeField.
Zero JavaScript — uses the native browser time control.
Examples
<%!-- Standalone --%>
<.time_picker id="start" name="start_time" label="Start Time" value="09:00" />
<%!-- With seconds --%>
<.time_picker id="dur" name="duration" with_seconds={true} />
<%!-- Form field integration --%>
<.time_picker
id="event_time"
name={@form[:time].name}
value={@form[:time].value}
errors={Enum.map(@form[:time].errors, &translate_error/1)}
label="Event Time"
/>
Summary
Functions
Attributes
id(:string) - HTMLidfor the input and labelforlink. Defaults tonil.name(:string) - HTMLnamefor form submission. Defaults tonil.value(:string) - Current time value as"HH:MM"or"HH:MM:SS". Defaults tonil.label(:string) - Label text rendered above the input. Defaults tonil.description(:string) - Helper text rendered below the label. Defaults tonil.errors(:list) - List of error message strings. Defaults to[].with_seconds(:boolean) - Whentrue, setsstep="1"so seconds are shown in the native picker. Defaults tofalse.disabled(:boolean) - Disables the input. Defaults tofalse.size(:atom) - Input height/padding::sm(h-8),:default(h-10),:lg(h-12). Defaults to:default. Must be one of:sm,:default, or:lg.class(:string) - Additional CSS classes merged onto the input. Defaults tonil.- Global attributes are accepted. HTML attributes forwarded to the
<input>element. Supports all globals plus:["required", "placeholder", "phx-debounce", "autocomplete", "min", "max"].