Date Picker

A component for selecting a single date using dropdown menus.

Installation

Import the component from the passport-ui package.

components/example.tsx
1
2
import { DatePicker } from "passport-ui";
import { useState } from "react";

Usage

Basic example showing how to use the component.

components/example.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
function DatePickerExample() {
const [date, setDate] = useState<Date | undefined>();
return (
<div className="w-sm">
<DatePicker
date={date}
onSelect={setDate}
placeholder="Pick a date"
/>
</div>
);
}

Additional resources

Documentation and examples are available in Storybook.