Design System

Component usage guide template

Browse Components

ui

Date Picker

A date picker component with support for date selection, time selection, and month picking.

1. Import
Import the Date Picker component from the design system.
import { DatePicker } from "@/design-system/components/ui/date-picker"
2. Props
Date Picker component props.
PropTypeDefault
labelstring | React.ReactNode--
valueDate--
onChange(date: Date | undefined) => void--
placeholderstring'Pick a date'
dateFormatstring'dd/MM/yyyy'
showTimebooleanfalse
timeOnlybooleanfalse
mode'single' | 'month''single'
errorstring--
requiredbooleanfalse
disabledbooleanfalse
disabledPastbooleanfalse
disabledFuturebooleanfalse
onDisabled(date: Date) => boolean--
size'xxs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl''md'
localestring | Locale--
cancelTextstring--
applyTextstring--
monthNamesstring[]--
3. Sizes
Available sizes for the Date Picker component.
4. Usages
Common Date Picker patterns and configurations.
import { DatePicker } from "@/design-system/components/ui/date-picker";
import { useState } from "react";

function Example() {
  const [value, setValue] = useState<Date | undefined>(undefined);

  return (
    <DatePicker
      label="Date"
      placeholder="Pick a date"
      value={value}
      onChange={setValue}
    />
  );
}