Time picker
In reviewLive · web
Field + popover · 12-hour · AM / PM
Reminder time
Selected: 2:30 PM
Inline · 12 / 24h · 5-min step · no past times
09Hour
45Minute
Setting the hour · pick the hour, then the minute
Step 5 min · selectable from 9:41 AM onward
Selected: 9:45 AM
States · empty placeholder · disabled
Snooze until
Locked (server-set)
// Web: React, consuming @dizyx/nockerl-tokens. (Web is the laggard platform;// this is the intended API, not yet exported from @dizyx/nockerl-react (promotion tracked).// Neither app ships a custom time picker, so the web island is designed from the// laws, pairing with DatePicker's field + popover + accent vocabulary.)
export function ReminderForm() { const [at, setAt] = useState<{ hour: number; minute: number }>({ hour: 14, minute: 30 });
return ( <> {/* Field + popover, 12-hour with AM/PM. */} <TimePicker label="Reminder time" value={at} onChange={setAt} />
{/* Always-open inline clock, 24-hour, 5-minute step, no past times. */} <TimePicker label="Run at" value={at} onChange={setAt} inline use24Hour minuteStep={5} min={{ hour: 9, minute: 41 }} /> </> );}// Android: Jetpack Compose, Material 3 (BOM 2026.02.01). The app has no custom// time picker: chat/ui/ChatUtils.kt and inbox/ui/NotificationRow.kt only FORMAT// times (SimpleDateFormat("h:mm a") / DateTimeFormatter "MMM d, yyyy h:mm a").// Use the stock picker, themed by NockerlTheme (cyan accent, 12dp control radius).import androidx.compose.material3.TimePickerimport androidx.compose.material3.TimeInputimport androidx.compose.material3.rememberTimePickerState
val state = rememberTimePickerState( initialHour = 14, initialMinute = 30, is24Hour = false, // false → the AM/PM clock dial)
// The clock dial (hour ring → minute ring).TimePicker(state = state)
// Or the keyboard-first text entry (hour/minute fields + AM/PM toggle).TimeInput(state = state)
// Read back: state.hour (0..23) + state.minute (0..59).// macOS: SwiftUI. Nockerl Voice has no custom time picker; "clock" is an SF// Symbol and it only formats durations (HomeSection.duration). Use the stock// DatePicker with .hourAndMinute, tinted to the brand cyan from NockerlTheme.import SwiftUI
struct ReminderForm: View { @State private var at = Date()
var body: some View { DatePicker( "Reminder time", selection: $at, displayedComponents: .hourAndMinute // hour + minute only, no date ) .datePickerStyle(.stepperField) // or .wheel for spinning columns .tint(NockerlTheme.accent) // cyan selection }}Parameters
Section titled “Parameters”| Prop | Type | Default | Description |
|---|---|---|---|
label * | string | Persistent field label above the trigger (never placeholder-as-label). | |
value * | { hour: number; minute: number } | null | Selected time, hour in 0 to 23 (controlled). null renders the empty Set a time prompt. | |
onChange * | (t: { hour: number; minute: number }) => void | Fires on a dial pick, a spinbutton step/type, or an AM/PM flip. | |
inline | boolean | false | When true, the clock panel is always open (no field trigger / popover). |
use24Hour | boolean | false | Hides the AM/PM toggle and labels the dial 0 to 23. Toggleable in-panel via the 12h/24h switch. |
minuteStep | number | 1 | Quantises the minute (e.g. 5); the minute ring shows the stepped marks. |
min | { hour: number; minute: number } | Inclusive earliest selectable time. Earlier picks render dimmed but legible. | |
max | { hour: number; minute: number } | Inclusive latest selectable time. Later picks render dimmed but legible. | |
disabled | boolean | false | Inert and clearly seen (never faded to invisible). The trigger is non-interactive. |
| Parameter | Type | Default | Description |
|---|---|---|---|
state * | TimePickerState | From rememberTimePickerState(...). Holds hour, minute, and the dial/input mode. | |
initialHour | Int | 0 | Pre-selected hour (0 to 23). Passed to rememberTimePickerState. |
initialMinute | Int | 0 | Pre-selected minute (0 to 59). Passed to rememberTimePickerState. |
is24Hour | Boolean | locale default | When false, shows the AM/PM clock dial; when true, the 24-hour dial. |
colors | TimePickerColors | NockerlTheme | Dial face, selector, clock/period containers, all bound to the cyan accent tokens. |
layoutType | TimePickerLayoutType | adaptive | Forces Vertical / Horizontal arrangement of the dial + period toggle. |
TimeInput(state = state) shares the same TimePickerState but renders the
keyboard-first hour/minute fields + AM/PM toggle instead of the dial.
SwiftUI exposes the time picker as the standard DatePicker restricted to
.hourAndMinute. State is the bound selection; AM/PM vs. 24-hour follows the
device locale. There is no minute-step or bounds API short of a custom range.
| Style | Type | Default | Description |
|---|---|---|---|
selection * | Binding<Date> | Two-way bound time. Only the hour + minute components are read/written under .hourAndMinute. | |
displayedComponents | DatePickerComponents | .date | Set to .hourAndMinute for time-of-day (omit .date, which is the date picker). |
.datePickerStyle | DatePickerStyle | .automatic | .stepperField for hour/minute steppers, .wheel for spinning columns (the iOS-style wheel). |
in | ClosedRange / PartialRangeFrom<Date> | Optional selectable bounds, e.g. now... (no past times). | |
.tint | Color | accentColor | Selection color. Set to NockerlTheme.accent (brand cyan). |