> ## Documentation Index
> Fetch the complete documentation index at: https://api.fanvue.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# DatePicker

> A calendar date picker supporting single-date and date-range selection with optional side-by-side month display and footer action buttons.

<Warning>
  This subpath needs the optional `react-day-picker` peer dependency: `pnpm add react-day-picker`.
  See [Subpath exports](/docs/ui/subpath-exports).
</Warning>

```tsx theme={null}
import { DatePicker } from "@fanvue/ui/date-picker";
import type {
  DatePickerOwnProps,
  DatePickerProps,
  DatePickerVariant,
  DateRange,
} from "@fanvue/ui/date-picker";
```

## Examples

## Default

<Frame>
  <iframe src={"https://main--697a1b6dd4dad73ee9c0e5f5.chromatic.com/iframe.html?id=components-datepicker--default&viewMode=story&shortcuts=false&singleStory=true&globals=theme:light"} width="100%" height="420" style={{border: "none", borderRadius: "8px"}} loading="lazy" title="DatePicker — Default" />
</Frame>

```tsx theme={null}
import { useState } from "react";
import { DatePicker } from "@fanvue/ui/date-picker";

const DEFAULT_MONTH = new Date(2026, 1);

function Example() {
  const [selected, setSelected] = useState<Date | undefined>();
  return (
    <DatePicker
      mode="single"
      defaultMonth={DEFAULT_MONTH}
      selected={selected}
      onSelect={setSelected}
      onApply={() => console.log("Applied:", selected)}
      onCancel={() => setSelected(undefined)}
    />
  );
}
```

## With Disabled Dates

<Frame>
  <iframe src={"https://main--697a1b6dd4dad73ee9c0e5f5.chromatic.com/iframe.html?id=components-datepicker--with-disabled-dates&viewMode=story&shortcuts=false&singleStory=true&globals=theme:light"} width="100%" height="420" style={{border: "none", borderRadius: "8px"}} loading="lazy" title="DatePicker — With Disabled Dates" />
</Frame>

```tsx theme={null}
import { useState } from "react";
import { DatePicker } from "@fanvue/ui/date-picker";

const DEFAULT_MONTH = new Date(2026, 1);

function Example() {
  const [selected, setSelected] = useState<Date | undefined>();
  return (
    <DatePicker
      mode="single"
      defaultMonth={DEFAULT_MONTH}
      selected={selected}
      onSelect={setSelected}
      disabled={{ before: new Date(2026, 1, 10) }}
    />
  );
}
```

## Without Footer

<Frame>
  <iframe src={"https://main--697a1b6dd4dad73ee9c0e5f5.chromatic.com/iframe.html?id=components-datepicker--without-footer&viewMode=story&shortcuts=false&singleStory=true&globals=theme:light"} width="100%" height="420" style={{border: "none", borderRadius: "8px"}} loading="lazy" title="DatePicker — Without Footer" />
</Frame>

```tsx theme={null}
import { useState } from "react";
import { DatePicker } from "@fanvue/ui/date-picker";

const DEFAULT_MONTH = new Date(2026, 1);

function Example() {
  const [selected, setSelected] = useState<Date | undefined>();
  return (
    <DatePicker
      mode="single"
      defaultMonth={DEFAULT_MONTH}
      selected={selected}
      onSelect={setSelected}
      showFooter={false}
    />
  );
}
```

## Single Selection

<Frame>
  <iframe src={"https://main--697a1b6dd4dad73ee9c0e5f5.chromatic.com/iframe.html?id=components-datepicker--single-selection&viewMode=story&shortcuts=false&singleStory=true&globals=theme:light"} width="100%" height="420" style={{border: "none", borderRadius: "8px"}} loading="lazy" title="DatePicker — Single Selection" />
</Frame>

```tsx theme={null}
import { useState } from "react";
import { DatePicker } from "@fanvue/ui/date-picker";

const DEFAULT_MONTH = new Date(2026, 1);

function Example() {
  const [selected, setSelected] = useState<Date | undefined>(new Date(2026, 1, 15));
  return (
    <DatePicker
      mode="single"
      defaultMonth={DEFAULT_MONTH}
      selected={selected}
      onSelect={setSelected}
      onApply={() => console.log("Applied:", selected)}
      onCancel={() => setSelected(undefined)}
    />
  );
}
```

## Custom Labels

<Frame>
  <iframe src={"https://main--697a1b6dd4dad73ee9c0e5f5.chromatic.com/iframe.html?id=components-datepicker--custom-labels&viewMode=story&shortcuts=false&singleStory=true&globals=theme:light"} width="100%" height="420" style={{border: "none", borderRadius: "8px"}} loading="lazy" title="DatePicker — Custom Labels" />
</Frame>

```tsx theme={null}
import { useState } from "react";
import { DatePicker } from "@fanvue/ui/date-picker";

const DEFAULT_MONTH = new Date(2026, 1);

function Example() {
  const [selected, setSelected] = useState<Date | undefined>();
  return (
    <DatePicker
      mode="single"
      defaultMonth={DEFAULT_MONTH}
      selected={selected}
      onSelect={setSelected}
      cancelLabel="Reset"
      applyLabel="Confirm"
      onApply={() => console.log("Applied:", selected)}
      onCancel={() => setSelected(undefined)}
    />
  );
}
```

## Props

## DatePicker

A calendar date picker supporting single-date and date-range selection with optional side-by-side month display and footer action buttons.

Built on top of [react-day-picker](https://react-day-picker.js.org/) — all `DayPickerProps` (except `numberOfMonths`) are forwarded.

<ParamField path="applyLabel" type="string" default="Apply">
  Label for the apply button.
</ParamField>

<ParamField path="cancelLabel" type="string" default="Cancel">
  Label for the cancel button.
</ParamField>

<ParamField path="className" type="string">
  Additional CSS class name for the outer container. Class name to add to the root element.
</ParamField>

<ParamField path="onApply" type="(() => void)">
  Callback fired when the Apply button is clicked.
</ParamField>

<ParamField path="onCancel" type="(() => void)">
  Callback fired when the Cancel button is clicked.
</ParamField>

<ParamField path="showFooter" type="boolean" default="true">
  Whether to render the cancel / apply footer buttons.
</ParamField>

<ParamField path="variant" type="&#x22;single&#x22; | &#x22;double&#x22;" default="single">
  Display one month or two side-by-side.
</ParamField>

## Exported types

Also exported from `@fanvue/ui/date-picker`: `DatePickerOwnProps`, `DatePickerProps`, `DatePickerVariant`, `DateRange`.

***

**Setup:** [Installation](/docs/ui/installation) · [Theming](/docs/ui/theming) · [Subpath exports](/docs/ui/subpath-exports)
