Blossom UI

Date picker

Date picker component with an accessible calendar, a range mode that highlights every day between two dates, min and max dates, locale support and keyboard navigation.

How to use it

Run npx @blossomui/react add date-picker, or copy src/components/UI/DatePicker/DatePicker.tsx into your React project and import it.

import { DatePicker, DateRangePicker } from './components/ui/DatePicker'

Props

DatePickerLabels

PropTypeDescription
choose (required)stringAccessible name of the calendar.
previousMonth (required)string
nextMonth (required)string
firstDay (required)stringHint of the range picker while it waits for the first day.
lastDay (required)stringHint of the range picker while it waits for the last day.

DatePickerProps

PropTypeDescription
requiredbooleanMarks the field as required: an asterisk is shown next to the label.
hintstringHelper text shown under the field.
errorstringError message. It is shown in red under the field and marks it as invalid.
labelsPartial<DatePickerLabels>Texts of the component. Pass only the ones you want to change, for example to translate it.
colorstringAccent color of this component: any CSS color. Without it the component uses `--blossom-accent`, which is pink by default.
valueDate | null
defaultValueDate | null
onChange(date: Date) => void
labelstring
placeholderstring
minDateDates before this one cannot be chosen.
maxDateDates after this one cannot be chosen.
localestringLocale used for the month names and the displayed date.
disabledboolean

DateRange

PropTypeDescription
start (required)Date | null
end (required)Date | null

DateRangePickerProps

PropTypeDescription
requiredbooleanMarks the field as required: an asterisk is shown next to the label.
hintstringHelper text shown under the field.
errorstringError message. It is shown in red under the field and marks it as invalid.
labelsPartial<DatePickerLabels>Texts of the component. Pass only the ones you want to change, for example to translate it.
colorstringAccent color of this component: any CSS color. Without it the component uses `--blossom-accent`, which is pink by default.
valueDateRange
defaultValueDateRange
onChange(range: { start: Date; end: Date }) => voidCalled once both days are chosen.
labelstring
placeholderstring
minDateDates before this one cannot be chosen.
maxDateDates after this one cannot be chosen.
localestringLocale used for the month names and the displayed dates.
disabledboolean

Getting started

  • Introduction
  • Installation
  • Changelog

Customization

  • Colors
  • Brand color
  • Texts and translation

Components

  • Accordion
  • Alert dialog
  • Alerts
  • Avatar
  • Badges
  • Banner
  • Breadcrumb
  • Buttons
  • Calendar
  • Cards
  • Carousel
  • Charts
  • Chip input
  • Collapsible
  • Color picker
  • Combobox
  • Command palette
  • Context menu
  • Copy button
  • Date picker
  • Drawer
  • Dropdown
  • Empty state
  • File upload
  • Footer
  • Forms
  • Hover card
  • Jumbotron
  • KBD
  • Menubar
  • Modal
  • Navbar
  • Navigation menu
  • Number input
  • OTP input
  • Pagination
  • Popover
  • Pricing
  • Progress
  • Rating
  • Resizable panels
  • Scroll area
  • Segmented control
  • Separator
  • Sidebar
  • Skeleton
  • Slider
  • Spinners
  • Stats
  • Stepper
  • Survey
  • Table
  • Tabs
  • Time picker
  • Timeline
  • Timer button
  • Toasts
  • Tooltip
  • Transfer list
  • Tree