# Shadcn Form Validation

> Form field with validation

- Type: example, free and open source (MIT)
- Component: [Time Picker](https://reui.io/components/time-picker.md)
- Page: https://reui.io/components/time-picker/c-time-picker-12
- Docs (Base UI): https://reui.io/docs/components/base/time-picker.md
- Docs (Radix UI): https://reui.io/docs/components/radix/time-picker.md
- MCP: `get_example("c-time-picker-12")`
- Registry item: https://reui.io/r/styles/base-nova/c-time-picker-12.json
- Uses: Button, Field, Time Picker

## Best for

A native form that reads the time from FormData on submit, swaps in a FieldError when empty and clears it on Reset

## Agent notes

- `onSubmit` only copies `deliveryTime` into local `booked` state; post it to your API there

## Install

```bash
npx shadcn@latest add @reui/c-time-picker-12
```

## About Shadcn Time Picker

### When to use

- Appointment, pickup and delivery slots kept on minute steps inside opening hours
- Recurring times of day in settings, such as a daily digest, a standup or a shift start
- Meeting start and end times, and a publish time set beside a chosen day

### When not to use

- A booking card with a day, a list of open slots, a duration and a confirm step: use the [Schedule blocks](https://reui.io/blocks/application/schedule.md)
- A day or a range of days picked with no time of day: use [Calendar](https://reui.io/components/calendar.md) (`get_component("calendar")`)
- A whole data entry page where the time is one field among many: use the [Form blocks](https://reui.io/blocks/application/form.md)

### Agent notes

- A `value` or `defaultValue` set in code shows as given, never snapped to the steps, `min` or `max`; only picks, typing and Now snap
- On `TimePickerTrigger`, `aria-label` replaces the shown value in the accessible name; point `aria-labelledby` at a visible label
- Inside a right to left `dir` wrapper, pass `dir` to `TimePickerContent` too, because the popover portals out of the wrapper

Every ReUI item has a twin like this one; the index is https://reui.io/llms.txt. Agents with the ReUI MCP (https://reui.io/docs/mcp) get the same guidance from the getters named above.
