Date Picker

A field that opens a calendar to pick a day, one press like a Select: the whole field opens it, its icon is only a picture, and the picked day is written in it.

import {
  DatePicker,
  DatePickerCalendar,
  DatePickerContent,
  DatePickerField,
} from "@produkto/ui/DatePicker";
import { Label } from "@produkto/ui/Label";

const Example = () => (
  <div className="flex w-full max-w-xs flex-col gap-2">
    <Label htmlFor="date-picker-preview">Label</Label>
    <DatePicker>
      <DatePickerField id="date-picker-preview" placeholder="Placeholder" />
      <DatePickerContent>
        <DatePickerCalendar />
      </DatePickerContent>
    </DatePicker>
  </div>
);

export default Example;

Usage

import {
  DatePicker,
  DatePickerCalendar,
  DatePickerContent,
  DatePickerTrigger,
  DatePickerValue,
} from "@produkto/ui/DatePicker";
import { Calendar04Icon } from "@hugeicons/core-free-icons";
import { Icon } from "@produkto/ui/Icon";
const [date, setDate] = useState<Date>();

return (
  <DatePicker value={date} onValueChange={setDate}>
    <DatePickerTrigger className="w-70">
      <Icon icon={Calendar04Icon} />
      <DatePickerValue placeholder="Placeholder" />
    </DatePickerTrigger>
    <DatePickerContent>
      <DatePickerCalendar />
    </DatePickerContent>
  </DatePicker>
);

Examples

Appearances

appearance paints the field on the kit's one scale: solid, the default, soft on the grey wash, outline with only its line, and transparent with neither until it is hovered.

import {
  DatePicker,
  DatePickerCalendar,
  DatePickerContent,
  DatePickerField,
  type DatePickerFieldAppearance,
} from "@produkto/ui/DatePicker";
import { Label } from "@produkto/ui/Label";

const variants: { appearance: DatePickerFieldAppearance; label: string }[] = [
  { appearance: "solid", label: "Solid" },
  { appearance: "soft", label: "Soft" },
  { appearance: "outline", label: "Outline" },
  { appearance: "transparent", label: "Transparent" },
];

const Example = () => (
  <div className="flex w-full max-w-xs flex-col gap-4">
    {variants.map((variant) => (
      <div className="flex flex-col gap-2" key={variant.appearance}>
        <Label htmlFor={`date-picker-appearance-${variant.appearance}`}>
          {variant.label}
        </Label>
        <DatePicker>
          <DatePickerField
            id={`date-picker-appearance-${variant.appearance}`}
            placeholder="Placeholder"
            appearance={variant.appearance}
          />
          <DatePickerContent>
            <DatePickerCalendar />
          </DatePickerContent>
        </DatePicker>
      </div>
    ))}
  </div>
);

export default Example;

Sizes

size sets its height: sm 32px, base 40px (the default) or lg 48px, a Button's height at the same size, the large one written at 16px on a phone.

import {
  DatePicker,
  DatePickerCalendar,
  DatePickerContent,
  DatePickerField,
} from "@produkto/ui/DatePicker";
import type { InputSize } from "@produkto/ui/Input";
import { Label } from "@produkto/ui/Label";

const variants: { size: InputSize; label: string }[] = [
  { size: "sm", label: "Small" },
  { size: "base", label: "Base" },
  { size: "lg", label: "Large" },
];

const Example = () => (
  <div className="flex w-full max-w-xs flex-col gap-4">
    {variants.map((variant) => (
      <div className="flex flex-col gap-2" key={variant.size}>
        <Label htmlFor={`date-picker-size-${variant.size}`}>
          {variant.label}
        </Label>
        <DatePicker>
          <DatePickerField
            id={`date-picker-size-${variant.size}`}
            placeholder="Placeholder"
            size={variant.size}
          />
          <DatePickerContent>
            <DatePickerCalendar />
          </DatePickerContent>
        </DatePicker>
      </div>
    ))}
  </div>
);

export default Example;

Border radius

borderRadius sets its corners on the kit's one scale: none, xs 4px, sm 6px, base 8px (the default), lg 12px, xl 16px, or full to round it.

import {
  DatePicker,
  DatePickerCalendar,
  DatePickerContent,
  DatePickerField,
} from "@produkto/ui/DatePicker";
import type { InputBorderRadius } from "@produkto/ui/Input";
import { Label } from "@produkto/ui/Label";

const variants: { borderRadius: InputBorderRadius; label: string }[] = [
  { borderRadius: "none", label: "None" },
  { borderRadius: "xs", label: "xs" },
  { borderRadius: "sm", label: "sm" },
  { borderRadius: "base", label: "base" },
  { borderRadius: "lg", label: "lg" },
  { borderRadius: "xl", label: "xl" },
  { borderRadius: "full", label: "full" },
];

const Example = () => (
  <div className="flex w-full max-w-xs flex-col gap-4">
    {variants.map((variant) => (
      <div className="flex flex-col gap-2" key={variant.borderRadius}>
        <Label htmlFor={`date-picker-radius-${variant.borderRadius}`}>
          {variant.label}
        </Label>
        <DatePicker>
          <DatePickerField
            id={`date-picker-radius-${variant.borderRadius}`}
            placeholder="Placeholder"
            borderRadius={variant.borderRadius}
          />
          <DatePickerContent>
            <DatePickerCalendar />
          </DatePickerContent>
        </DatePicker>
      </div>
    ))}
  </div>
);

export default Example;

Range

mode="range" picks a first day and then a last, closes on the last and writes both ends in the field, beside mode="single", the default, which picks one day.

import {
  DatePicker,
  DatePickerCalendar,
  DatePickerContent,
  DatePickerField,
} from "@produkto/ui/DatePicker";
import { Label } from "@produkto/ui/Label";

const Example = () => (
  <div className="flex w-full max-w-xs flex-col gap-4">
    <div className="flex flex-col gap-2">
      <Label htmlFor="date-picker-single">Single</Label>
      <DatePicker defaultValue={new Date(2026, 0, 15)}>
        <DatePickerField id="date-picker-single" placeholder="Placeholder" />
        <DatePickerContent>
          <DatePickerCalendar />
        </DatePickerContent>
      </DatePicker>
    </div>
    <div className="flex flex-col gap-2">
      <Label htmlFor="date-picker-range">Range</Label>
      <DatePicker
        defaultValue={{
          from: new Date(2026, 0, 15),
          to: new Date(2026, 0, 22),
        }}
        mode="range"
      >
        <DatePickerField id="date-picker-range" placeholder="Placeholder" />
        <DatePickerContent>
          <DatePickerCalendar />
        </DatePickerContent>
      </DatePicker>
    </div>
  </div>
);

export default Example;

Input

DatePickerInput, in place of the field, takes a typed date such as 15 Jan 2026, opens the calendar from its button, a click or ArrowDown, and writes a picked day in the field.

import {
  DatePicker,
  DatePickerCalendar,
  DatePickerContent,
  DatePickerInput,
} from "@produkto/ui/DatePicker";
import { Label } from "@produkto/ui/Label";

const Example = () => (
  <div className="flex w-full max-w-xs flex-col gap-2">
    <Label htmlFor="date-picker-input">Label</Label>
    <DatePicker>
      <DatePickerInput id="date-picker-input" placeholder="Placeholder" />
      <DatePickerContent>
        <DatePickerCalendar />
      </DatePickerContent>
    </DatePicker>
  </div>
);

export default Example;

Trigger

DatePickerTrigger, in place of the field, opens the calendar from an outline Button of its own, with DatePickerValue writing the picked day on it.

import {
  DatePicker,
  DatePickerCalendar,
  DatePickerContent,
  DatePickerTrigger,
  DatePickerValue,
} from "@produkto/ui/DatePicker";
import { Label } from "@produkto/ui/Label";

const Example = () => (
  <div className="flex w-full max-w-xs flex-col gap-2">
    <Label htmlFor="date-picker-trigger">Label</Label>
    <DatePicker>
      <DatePickerTrigger id="date-picker-trigger">
        <DatePickerValue placeholder="Placeholder" />
      </DatePickerTrigger>
      <DatePickerContent>
        <DatePickerCalendar />
      </DatePickerContent>
    </DatePicker>
  </div>
);

export default Example;

Multiple

mode="multiple" on DatePickerMonth, the calendar the picker opens, turns each day on or off on its own, beside mode="single", which picks one day.

November 2026
November 2026
import { DatePickerMonth } from "@produkto/ui/DatePicker";
import { Label } from "@produkto/ui/Label";

const today = new Date();

const day = (date: number) =>
  new Date(today.getFullYear(), today.getMonth(), date);

const Example = () => (
  <div className="flex flex-wrap items-start gap-4">
    <div className="flex flex-col gap-2">
      <Label id="date-picker-month-single">Single</Label>
      <DatePickerMonth
        aria-labelledby="date-picker-month-single"
        mode="single"
        selected={day(14)}
      />
    </div>
    <div className="flex flex-col gap-2">
      <Label id="date-picker-month-multiple">Multiple</Label>
      <DatePickerMonth
        aria-labelledby="date-picker-month-multiple"
        mode="multiple"
        selected={[day(6), day(14), day(22)]}
      />
    </div>
  </div>
);

export default Example;

Caption layout

captionLayout="dropdown" puts a month select and a year select in the caption, for dates far from today, beside "label", the default, which writes the month and steps with the arrows.

November 2026
November 2026
import { DatePickerMonth } from "@produkto/ui/DatePicker";
import { Label } from "@produkto/ui/Label";

const Example = () => (
  <div className="flex flex-wrap items-start gap-4">
    <div className="flex flex-col gap-2">
      <Label id="date-picker-caption-label">Label</Label>
      <DatePickerMonth
        aria-labelledby="date-picker-caption-label"
        mode="single"
      />
    </div>
    <div className="flex flex-col gap-2">
      <Label id="date-picker-caption-dropdown">Dropdown</Label>
      <DatePickerMonth
        aria-labelledby="date-picker-caption-dropdown"
        captionLayout="dropdown"
        mode="single"
      />
    </div>
  </div>
);

export default Example;

Locale

locale takes a date-fns locale: the months and days are named in its language and the week starts where it does, here on Monday for French, beside the default, English.

November 2026
novembre 2026
import { DatePickerMonth } from "@produkto/ui/DatePicker";
import { Label } from "@produkto/ui/Label";
import { fr } from "date-fns/locale";

const Example = () => (
  <div className="flex flex-wrap items-start gap-4">
    <div className="flex flex-col gap-2">
      <Label id="date-picker-locale-default">English</Label>
      <DatePickerMonth
        aria-labelledby="date-picker-locale-default"
        mode="single"
      />
    </div>
    <div className="flex flex-col gap-2">
      <Label id="date-picker-locale-fr">French</Label>
      <DatePickerMonth
        aria-labelledby="date-picker-locale-fr"
        locale={fr}
        mode="single"
      />
    </div>
  </div>
);

export default Example;

Week start

weekStartsOn={1} begins each week on Monday, beside the default, which starts where the locale does, Sunday in English.

November 2026
November 2026
import { DatePickerMonth } from "@produkto/ui/DatePicker";
import { Label } from "@produkto/ui/Label";

const Example = () => (
  <div className="flex flex-wrap items-start gap-4">
    <div className="flex flex-col gap-2">
      <Label id="date-picker-week-start-sunday">Sunday</Label>
      <DatePickerMonth
        aria-labelledby="date-picker-week-start-sunday"
        mode="single"
      />
    </div>
    <div className="flex flex-col gap-2">
      <Label id="date-picker-week-start-monday">Monday</Label>
      <DatePickerMonth
        aria-labelledby="date-picker-week-start-monday"
        mode="single"
        weekStartsOn={1}
      />
    </div>
  </div>
);

export default Example;

Week numbers

showWeekNumber adds a column with the number of each week of the year, beside a month as it is by default, without one.

November 2026
November 2026
45
46
47
48
49
import { DatePickerMonth } from "@produkto/ui/DatePicker";
import { Label } from "@produkto/ui/Label";

const Example = () => (
  <div className="flex flex-wrap items-start gap-4">
    <div className="flex flex-col gap-2">
      <Label id="date-picker-week-numbers-off">Label</Label>
      <DatePickerMonth
        aria-labelledby="date-picker-week-numbers-off"
        mode="single"
      />
    </div>
    <div className="flex flex-col gap-2">
      <Label id="date-picker-week-numbers">Label</Label>
      <DatePickerMonth
        aria-labelledby="date-picker-week-numbers"
        mode="single"
        showWeekNumber
      />
    </div>
  </div>
);

export default Example;

Disabled days

disabled takes the days no one may pick, here the weekends, greyed out among the others, which can all be picked by default; DatePickerCalendar takes it too.

November 2026
import { DatePickerMonth } from "@produkto/ui/DatePicker";
import { Label } from "@produkto/ui/Label";

const Example = () => (
  <div className="flex flex-col gap-2">
    <Label id="date-picker-disabled-days">Label</Label>
    <DatePickerMonth
      aria-labelledby="date-picker-disabled-days"
      disabled={{ dayOfWeek: [0, 6] }}
      mode="single"
    />
  </div>
);

export default Example;

Clearable

clearable shows an X at the field's end once it holds a day, which takes the day away, or puts back resetTo on the DatePicker; by default a field has none.

import {
  DatePicker,
  DatePickerCalendar,
  DatePickerContent,
  DatePickerField,
} from "@produkto/ui/DatePicker";
import { Label } from "@produkto/ui/Label";

const Example = () => (
  <div className="flex w-full max-w-xs flex-col gap-4">
    <div className="flex flex-col gap-2">
      <Label htmlFor="date-picker-clearable-off">Label</Label>
      <DatePicker defaultValue={new Date(2026, 0, 15)}>
        <DatePickerField
          id="date-picker-clearable-off"
          placeholder="Placeholder"
        />
        <DatePickerContent>
          <DatePickerCalendar />
        </DatePickerContent>
      </DatePicker>
    </div>
    <div className="flex flex-col gap-2">
      <Label htmlFor="date-picker-clearable">Label</Label>
      <DatePicker defaultValue={new Date(2026, 0, 15)}>
        <DatePickerField
          clearable
          id="date-picker-clearable"
          placeholder="Placeholder"
        />
        <DatePickerContent>
          <DatePickerCalendar />
        </DatePickerContent>
      </DatePicker>
    </div>
  </div>
);

export default Example;

Disabled

disabled dims the field and keeps its calendar shut, beside one as it is by default.

import {
  DatePicker,
  DatePickerCalendar,
  DatePickerContent,
  DatePickerField,
} from "@produkto/ui/DatePicker";
import { Label } from "@produkto/ui/Label";

const Example = () => (
  <div className="flex w-full max-w-xs flex-col gap-4">
    <div className="flex flex-col gap-2">
      <Label htmlFor="date-picker-enabled">Label</Label>
      <DatePicker defaultValue={new Date(2026, 0, 15)}>
        <DatePickerField id="date-picker-enabled" placeholder="Placeholder" />
        <DatePickerContent>
          <DatePickerCalendar />
        </DatePickerContent>
      </DatePicker>
    </div>
    <div className="flex flex-col gap-2">
      <Label htmlFor="date-picker-disabled">Label</Label>
      <DatePicker defaultValue={new Date(2026, 0, 15)} disabled>
        <DatePickerField id="date-picker-disabled" placeholder="Placeholder" />
        <DatePickerContent>
          <DatePickerCalendar />
        </DatePickerContent>
      </DatePicker>
    </div>
  </div>
);

export default Example;

Invalid

error writes what is wrong under the field, turns its border to the destructive colour and describes it to screen readers, beside one without an error.

import {
  DatePicker,
  DatePickerCalendar,
  DatePickerContent,
  DatePickerField,
} from "@produkto/ui/DatePicker";
import { Label } from "@produkto/ui/Label";

const Example = () => (
  <div className="flex w-full max-w-xs flex-col gap-4">
    <div className="flex flex-col gap-2">
      <Label htmlFor="date-picker-valid">Label</Label>
      <DatePicker>
        <DatePickerField id="date-picker-valid" placeholder="Placeholder" />
        <DatePickerContent>
          <DatePickerCalendar />
        </DatePickerContent>
      </DatePicker>
    </div>
    <div className="flex flex-col gap-2">
      <Label htmlFor="date-picker-invalid">Label</Label>
      <DatePicker>
        <DatePickerField
          error="Description"
          id="date-picker-invalid"
          placeholder="Placeholder"
        />
        <DatePickerContent>
          <DatePickerCalendar />
        </DatePickerContent>
      </DatePicker>
    </div>
  </div>
);

export default Example;

API Reference

DatePicker

DatePickerProps · components/DatePicker/DatePicker.types.ts
PropTypeDefault
mode"single" | "range"-
valueDate | DateRange-
defaultValueDate | DateRange-
resetToDate | DateRange-
onValueChange((value: Date | undefined) => void) | ((value: DateRange | undefined) => void)-
defaultMonthDate-
openboolean-
defaultOpenboolean-
onOpenChange(open: boolean) => void-
localeLocale-
disabledboolean-
namestring-
formstring-
childrenReactNode-
maxDaysnumber-

DatePickerValue

DatePickerValueProps · also takes the props of <span>
PropTypeDefault
placeholderReactNode-
formatstring-

DatePickerTrigger

DatePickerTriggerProps · also takes the props of <button>
PropTypeDefault
hrefstring-
targetHTMLAttributeAnchorTarget-
relstring-
prefetchboolean-
appearanceButtonAppearance"solid" | "soft" | "outline" | "transparent""outline"
toneButtonTone"neutral" | "accent" | "destructive" | "success" | "warning" | "info"-
sizeButtonSize"xs" | "sm" | "base" | "lg"-
wrapboolean-
blockboolean-
mutedboolean-
alignButtonAlign"start" | "center" | "end"-
borderRadiusButtonBorderRadius"none" | "xs" | "sm" | "base" | "lg" | "xl" | "full"-
loadingboolean-
onClickMouseEventHandler<HTMLElement>-

DatePickerField

DatePickerFieldProps · also takes the props of <button>
PropTypeDefault
appearanceDatePickerFieldAppearance"solid" | "soft" | "outline" | "transparent"-
sizeInputSize"sm" | "base" | "lg"-
borderRadiusInputBorderRadius"none" | "xs" | "sm" | "base" | "lg" | "xl" | "full"-
clearableboolean-
showIconbooleantrue
placeholderReactNode-
errorReactNode-

DatePickerInput

DatePickerInputProps · also takes the props of <input>
PropTypeDefault
formatstring-
appearanceDatePickerFieldAppearance"solid" | "soft" | "outline" | "transparent"-
sizeInputSize"sm" | "base" | "lg"-
borderRadiusInputBorderRadius"none" | "xs" | "sm" | "base" | "lg" | "xl" | "full"-
clearableboolean-
errorReactNode-

DatePickerContent

DatePickerContentProps · takes the props of PopoverContent

DatePickerCalendar

DatePickerCalendarProps · also takes the props of PropsBase
PropTypeDefault
appearanceDatePickerCalendarAppearance"solid" | "soft" | "outline" | "transparent"-

DatePickerPreset

DatePickerPresetProps · also takes the props of <button>
PropTypeDefault
valuerequiredDatePickerSelection-
hrefstring-
targetHTMLAttributeAnchorTarget-
relstring-
prefetchboolean-
appearanceButtonAppearance"solid" | "soft" | "outline" | "transparent""outline"
toneButtonTone"neutral" | "accent" | "destructive" | "success" | "warning" | "info"-
sizeButtonSize"xs" | "sm" | "base" | "lg""sm"
wrapboolean-
blockboolean-
mutedboolean-
alignButtonAlign"start" | "center" | "end"-
borderRadiusButtonBorderRadius"none" | "xs" | "sm" | "base" | "lg" | "xl" | "full"-
loadingboolean-
onClickMouseEventHandler<HTMLElement>-

DatePickerMonth

DatePickerMonthProps · also takes the props of react-day-picker DayPicker
PropTypeDefault
appearanceDatePickerMonthAppearance"solid" | "soft" | "outline" | "transparent""transparent"
showOutsideDaysbooleantrue
captionLayoutstring"label"

DatePickerDay

DatePickerDayProps · takes the props of DayButtonProps