Skip to content

Picker dialog

The modal form of a date or time picker, with confirm, dismiss and mode-toggle slots.

import { PickerDialog } from '@windmorph/react';

Purpose

PickerDialog is the modal form of a date or time picker: it puts a DatePicker, DateRangePicker or TimePicker on a dialog surface with confirm and dismiss actions. Use it when a picker should interrupt the task; render the picker inline when it should sit in the layout.

It is controlled with open / onOpenChange (or uncontrolled with defaultOpen). The common pattern is to edit a draft value and apply it in onConfirm (and the confirmButton), so cancelling leaves the committed value untouched.

On compact windows M3 recommends a full-screen date picker: fullScreen="compact" (below 600px) or "always" fills the window and puts a close (x) button and a Save button, which calls onConfirm, at the top instead of the actions. Without onConfirm, the confirmButton takes Save's place.

When not to use

When the picker can sit inline in the layout, the docked form avoids a modal.

See also

  • Picker dialog on m3.material.io: Material's own guidelines, with anatomy and specs.
  • Date picker: Pick a single date or a range on a month grid or by typing, docked below a field or in a dialog.
  • Time picker: Pick an hour and minute on a clock dial or by typing, 12- or 24-hour.
  • Dialog: A modal surface for a focused task or a decision, with a title, content and actions, or full screen on compact windows.