www/apps/ui/app/components/date-picker/page.mdx
import { ComponentExample } from "@/components/ComponentExample" import { ComponentReference } from "@/components/ComponentReference"
export const metadata = {
title: Date Picker,
}
A component for rendering date picker inputs with range and presets.
In this guide, you'll learn how to use the Date Picker component.
<ComponentExample name="date-picker-demo" />import { DatePicker } from "@medusajs/ui"
<DatePicker />
Manage and store the value of the date picker in a state variable for controlled behavior. This is also useful for form integration.
<ComponentExample name="date-picker-controlled" />Enable time selection with different granularity levels for precise scheduling.
<ComponentExample name="date-picker-with-time" />Restrict date selection to a specific range by setting minimum and maximum values.
In the example below, you can only select dates within the next 30 days. Dates outside the range are disabled.
<ComponentExample name="date-picker-min-max" />Disable specific dates like weekends and holidays to prevent selection of unavailable dates.
The example below disables weekends and holidays like Christmas.
<ComponentExample name="date-picker-business-hours" />Different levels of time precision from date-only to second-precision selection.
<ComponentExample name="date-picker-granularity" />The following example shows how to use the date picker in a form, with simulated form submission.
<ComponentExample name="date-picker-form" hideFeedback />