Skip to Content

Time Picker

A time selection component with separate hour, minute, and optional second inputs. Used by RenderFormFields for ColumnTypeEnum.TIME fields.


Import

import { TimePicker } from "@phpcreation/frontend-components-react-nextjs-bundle/components/TimePicker";

Props

PropTypeDefaultDescription
valuestring""Controlled time value (HH:mm:ss)
onChange(value: string) => voidChange handler
showSecondsbooleanfalseShow seconds input
disabledbooleanfalseDisable the input
classNamestringAdditional CSS classes

Usage

import { TimePicker } from "..."; <TimePicker value={startTime} onChange={setStartTime} showSeconds={false} />

With React Hook Form

<FormField control={form.control} name="startTime" render={({ field }) => ( <FormItem> <FormLabel>Start Time</FormLabel> <FormControl> <TimePicker value={field.value} onChange={field.onChange} /> </FormControl> <FormMessage /> </FormItem> )} />

Last updated on