Date Picker

A controlled calendar popover for selecting dates. Opens inline above or below the trigger button and closes on selection.

Selected: none

Installation

npm install @bloomkit/react

Usage

import { useState } from "react";
import { DatePicker } from "@bloomkit/react";
 
export function MyForm() {
  const [date, setDate] = useState<Date | undefined>(undefined);
 
  return (
    <DatePicker
      value={date}
      onChange={(d) => setDate(d)}
      placeholder="Select date"
    />
  );
}

Controlled value

The DatePicker is fully controlled — pass value and onChange to manage the selected date externally:

const [startDate, setStartDate] = useState<Date | undefined>(undefined);
 
<DatePicker
  value={startDate}
  onChange={setStartDate}
  placeholder="Start date"
/>

Props

PropTypeDefaultDescription
valueDateThe currently selected date (controlled)
onChange(date: Date) => voidCalled when the user selects a date
placeholderstring"Select date"Text shown in the trigger button when no date is selected
classNamestring""Additional Tailwind classes applied to the trigger button