Time Picker
Basic Usage
The TimePicker field renders a time selection input. By default, it uses the 12-hour format with AM and PM:
use InertiaUI\Forms\Fields\TimePicker;
TimePicker::make('start_time');Time Formats
By default, the picker displays times as h:mm A and submits them as HH:mm. The following methods change these formats.
24-Hour Format
To switch to the 24-hour format, call the use24HourTime method:
TimePicker::make('start_time')->use24HourTime();This also changes the PHP field's display format from h:mm A to HH:mm. Direct standalone components don't receive the serialized PHP field config, so pass display-format="HH:mm" to them explicitly.
Show Seconds
The showSeconds method adds a seconds selector. It changes the value format to HH:mm:ss and adds seconds to the display format:
TimePicker::make('timestamp')->showSeconds();Display and Value Format
To customize how the time is displayed and submitted, you may use the displayFormat and valueFormat methods:
TimePicker::make('start_time')
->displayFormat('hh.mm A') // What the user sees: 02.30 PM
->valueFormat('HH.mm'); // What gets submitted: 14.30Both methods accept the following tokens:
| Token | Description | Example |
|---|---|---|
HH | 24-hour hour (padded) | 00-23 |
H | 24-hour hour | 0-23 |
hh | 12-hour hour (padded) | 01-12 |
h | 12-hour hour | 1-12 |
mm | Minutes (padded) | 00-59 |
ss | Seconds (padded) | 00-59 |
A | AM/PM | AM, PM |
a | am/pm | am, pm |
The default display format is h:mm A, and the default value format is HH:mm. In the PHP field config, the use24HourTime method changes the display format to HH:mm, and the showSeconds method adds seconds to both formats. Both methods reset the formats this way, so call displayFormat and valueFormat after them. Direct standalone components should receive the matching display-format and value-format props explicitly.
Once you configure a minimum, a maximum, or disabled values, backend validation parses the submitted value using the valueFormat. The step methods still only affect the picker.
Steps
Minute Step
The minuteStep method sets the increment of the minute choices:
TimePicker::make('appointment')->minuteStep(15); // 00, 15, 30, 45
TimePicker::make('meeting')->minuteStep(30); // 00, 30Hour Step
The hourStep method sets the increment of the hour choices:
TimePicker::make('shift_start')
->use24HourTime()
->hourStep(2); // 00, 02, 04, 06, ...In the default 12-hour picker, the same step starts at 1, so hourStep(2) shows 1, 3, 5, ....
Second Step
The secondStep method sets the increment of the second choices. It requires the showSeconds method:
TimePicker::make('precise_time')
->showSeconds()
->secondStep(15); // 00, 15, 30, 45Step methods only change the choices the picker shows. Pass positive increments. Direct Vue and React props normalize a zero or negative step back to 1. Step methods don't add Laravel validation, such as "minutes must be divisible by 15". To reject submitted times outside your step pattern on the server, add the rule yourself using the rules method or a custom rule.
Available Times
These methods limit the times the user may pick. Backend validation enforces the same limits.
Min and Max Time
The minTime and maxTime methods limit the picker's choices to a time window. Backend validation also rejects submitted values outside that window:
TimePicker::make('appointment')
->minTime('09:00')
->maxTime('17:00');The footer Now action uses the same picker choices. It resolves the current clock time to the closest visible hour, minute, and second, and it disables itself when that value falls outside the minTime and maxTime window.
Disabled Hours, Minutes, and Seconds
You may disable specific values in the picker using the disabledHours, disabledMinutes, and disabledSeconds methods:
// Disable lunch hour and after-hours
TimePicker::make('meeting_time')
->disabledHours([0, 1, 2, 3, 4, 5, 6, 7, 12, 18, 19, 20, 21, 22, 23]);
// Disable specific minutes
TimePicker::make('schedule')
->disabledMinutes([15, 45]);
// Disable specific seconds (requires showSeconds)
TimePicker::make('precise_time')
->showSeconds()
->disabledSeconds([0, 30]);Hours use the 24-hour format, from 0 to 23. Minutes and seconds range from 0 to 59. The footer Now action is disabled when the current resolved picker value uses a disabled hour, minute, or second. Backend validation rejects submitted values that use a disabled value too. Disabled seconds are only enforced when showSeconds is enabled.
Picker Options
These options change the trigger and the footer of the dropdown.
Placeholder
The placeholder method sets the text of the empty trigger. The default is Select time:
TimePicker::make('start_time')->placeholder('Choose a start time');Clearable
The clearable method lets the user clear the selected time:
TimePicker::make('reminder')->clearable();Footer Actions
Every time picker dropdown includes a Now action. It selects the current clock time using the closest visible picker choices, so it respects the minuteStep, hourStep, and secondStep methods. The Now action is disabled when the current resolved value falls outside the configured minimum and maximum, or uses a disabled hour, minute, or second.
The clearable method also adds a footer Clear action, plus a clear button on the trigger once the field has a value.
All shared field methods stay available. See Form Class, Model Binding, Validation, Conditional Visibility, Authorization, and Styling.
Using the Component Directly
Each stack exports the TimePicker component from its components subpath. Vue uses v-model, while React uses a controlled value with onValueChange:
<script setup lang="ts">
import { ref } from 'vue'
import { TimePicker } from '@inertiaui/form-vue/components'
const followUpAt = ref<string | null>('09:30:15')
const error = ref<string | null>(null)
const saving = ref(false)
const fieldParts = {
dropdown: 'max-h-64',
option: 'font-medium',
selectedOption: 'bg-blue-50',
}
const trackBlur = () => {}
</script>
<template>
<TimePicker
v-model="followUpAt"
id="follow-up-time"
name="follow_up_at"
label="Follow-up time"
help="Business hours only."
placeholder="Choose a time"
:error="error"
:invalid="!!error"
required
:precognitive="false"
:disabled="saving"
use-24-hour-time
:hour-step="1"
:minute-step="15"
show-seconds
:second-step="15"
min-time="08:00:00"
max-time="18:00:00"
:disabled-hours="[0, 1, 2, 3, 4, 5, 6, 22, 23]"
:disabled-minutes="[5, 55]"
:disabled-seconds="[0, 30]"
clearable
display-format="HH:mm:ss"
value-format="HH:mm:ss"
badge="Office"
badge-class="bg-zinc-100 text-zinc-700"
label-trailing="Required"
label-trailing-class="text-zinc-500"
tooltip="Unavailable times are disabled in the picker."
help-position="below"
layout="stacked"
control-position="start"
label-class="font-medium"
help-class="text-zinc-500"
error-class="text-red-600"
wrapper-class="max-w-sm"
control-class="bg-white"
class="font-medium"
:part-classes="fieldParts"
:label-sr-only="false"
title="Choose follow-up time"
data-testid="follow-up-time"
@blur="trackBlur"
/>
</template>import { useState } from 'react'
import { TimePicker } from '@inertiaui/form-react/components'
const fieldParts = {
dropdown: 'max-h-64',
option: 'font-medium',
selectedOption: 'bg-blue-50',
}
export default function FollowUpTimePicker() {
const [followUpAt, setFollowUpAt] = useState<string | null>('09:30:15')
const [error] = useState<string | null>(null)
const [saving] = useState(false)
const trackBlur = () => {}
return (
<TimePicker
value={followUpAt}
onValueChange={setFollowUpAt}
id="follow-up-time"
name="follow_up_at"
label="Follow-up time"
help="Business hours only."
placeholder="Choose a time"
error={error}
invalid={Boolean(error)}
required
precognitive={false}
disabled={saving}
use24HourTime
hourStep={1}
minuteStep={15}
showSeconds
secondStep={15}
minTime="08:00:00"
maxTime="18:00:00"
disabledHours={[0, 1, 2, 3, 4, 5, 6, 22, 23]}
disabledMinutes={[5, 55]}
disabledSeconds={[0, 30]}
clearable
displayFormat="HH:mm:ss"
valueFormat="HH:mm:ss"
badge="Office"
badgeClass="bg-zinc-100 text-zinc-700"
labelTrailing="Required"
labelTrailingClass="text-zinc-500"
tooltip="Unavailable times are disabled in the picker."
helpPosition="below"
layout="stacked"
controlPosition="start"
labelClass="font-medium"
helpClass="text-zinc-500"
errorClass="text-red-600"
wrapperClass="max-w-sm"
controlClass="bg-white"
class="font-medium"
partClasses={fieldParts}
labelSrOnly={false}
title="Choose follow-up time"
data-testid="follow-up-time"
onBlur={trackBlur}
/>
)
}Native attributes and listeners target the trigger element. See Native Attributes And Events.