# Duration Picker block

> Duration picker dialog with start and end time selects plus quick preset toggles

Modal for choosing a time span: start and end time Selects plus quick presets (30 min to 1 day) that auto-adjust the end time. Built with shadcn Dialog, Select, ToggleGroup, Field, Tooltip, Button. Time range picker, schedule, booking duration.

- Type: Pro block
- Category: [Dialog](https://web.dev.reui.io/blocks/application/dialog.md)
- Page: https://web.dev.reui.io/blocks/application/dialog/dialog-1
- Docs (Base UI): https://ui.shadcn.com/docs/components/base/dialog.md
- Docs (Radix UI): https://ui.shadcn.com/docs/components/radix/dialog.md
- MCP: `get_block("dialog-1")`
- Built with: Button, Dialog, Field, Item, Select, Toggle Group, Tooltip
- Installs with a ReUI Pro or Ultimate license; setup: https://web.dev.reui.io/docs/license-setup

## Best for

A start and end time on a 30 minute grid, where 6 presets keep the start, move the end and wrap past midnight

## Agent notes

- Apply only calls `setOpen`; read `startTime` and `endTime` there and hand the span to your scheduler
- Replace the 48 half hour `TIME_OPTIONS` and 6 `DURATION_PRESETS` in data.ts; a preset off the slot grid leaves the end at the start
- Times are HH:MM strings with no date, and `getDurationMinutes` counts an end at or before the start as the next day

## When not to use

- A full event form where the span sits beside a date, members and an image: use [Create Schedule](https://web.dev.reui.io/blocks/application/schedule/schedule-6.md) (`get_block("schedule-6")`)
- A single hour and minute field in a form, with no span or presets: use [Time Picker](https://web.dev.reui.io/components/time-picker.md) (`get_component("time-picker")`)

## Install

```bash
npx shadcn@latest add @reui/dialog-1
```

## About Dialog blocks

### When to use

- New record forms over the current page: a project, a quick task or entry, or a finance account
- Access flows: email invites with a role, an app picker and the consent step before a sync
- Pickers and account tasks: a time span, a starter template, settings, a checklist, cancellation or help

### When not to use

- A plain modal shell you fill with your own title, body and buttons: use [Dialog](https://web.dev.reui.io/components/dialog.md) (`get_component("dialog")`)
- A data entry layout that sits in the page itself rather than over it: use the [Form blocks](https://web.dev.reui.io/blocks/application/form.md)
- A one question confirm, such as deleting a record, with nothing to fill in: use [Alert Dialog](https://web.dev.reui.io/components/alert-dialog.md) (`get_component("alert-dialog")`)

### Agent notes

- Each root renders its own launch `Button` and starts `open` as true in `useState`; swap in your trigger and start it closed
- Primary actions only close through `setOpen`, fire a sonner `toast` or have no handler; wire your submit and API call there
- Each page.tsx centers the root in a `min-h-svh` main with an `sr-only` h1; mount only the root component inside your page

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