# Confirm before applying

> Column picks stay a draft until OK, so a shift change applies once.

A shadcn/ui block from the [@reui](https://reui.io) registry, listed on [shadcn.exchange](https://shadcn.exchange/r/reui/c-time-picker-10).

- Page, with a live preview: https://shadcn.exchange/r/reui/c-time-picker-10
- Screenshot: https://abzjhwgwpdpz7ua5.public.blob.vercel-storage.com/shots/reui/c-time-picker-10-light-333767525e048b08.png
- Registry item: https://reui.io/r/new-york-v4/c-time-picker-10.json
- Listed: 2026-10-13, source last changed 2026-10-13

## Install

```bash
npx shadcn@latest add https://reui.io/r/new-york-v4/c-time-picker-10.json
```

Run it in a project that has shadcn/ui set up. It adds the files below and installs what they depend on.

## Dependencies

- Registry items: `field`, `@reui/time-picker`

## Files

### `c-time-picker-10.tsx`

```tsx
"use client"

import { useId, useState } from "react"
import { TimePicker } from "@/components/reui/time-picker"

import {
  Field,
  FieldDescription,
  FieldLabel,
} from "@/components/ui/field"

export function Pattern() {
  const id = useId()
  /* Only a committed value reaches this state. Column picks, Now and Clear
     stay a draft in the popover until OK, and closing it discards them, so
     the roster never sees a half-made change. */
  const [shiftStart, setShiftStart] = useState<string | null>("08:00")

  return (
    <div className="mx-auto flex w-full max-w-xs flex-col gap-3">
      <Field>
        <FieldLabel id={`${id}-label`} htmlFor={id}>
          Shift start
        </FieldLabel>
        <TimePicker
          id={id}
          aria-labelledby={`${id}-label`}
          aria-describedby={`${id}-hint`}
          value={shiftStart}
          onValueChange={setShiftStart}
          minuteStep={15}
          /* Also adds OK to the footer, drawn as the primary button. */
          requireConfirm
        />
        <FieldDescription id={`${id}-hint`}>
          Changes apply when you press OK.
        </FieldDescription>
      </Field>
      {/* Announced once per applied change, not on every pick in the
          columns. */}
      <p role="status" className="text-muted-foreground text-sm">
        {shiftStart ? `Shift starts at ${shiftStart}` : "No shift start set"}
      </p>
    </div>
  )
}
```
