Pallas UI
DocsComponents
Core Concepts
    • Introduction
    • Getting Started
    • Theming
    • Color Tokens
    • Spacing & Sizing
    • Layout Guide
    • AspectRatio
    • Box
    • Flex
    • Grid
    • Shapes
Previews
    • Accordion
    • Alert
    • Avatar
    • Badge
    • Breadcrumb
    • Button
    • Carousel
    • Checkbox
    • Combobox
    • Command
    • Date Picker
    • Form
    • Input
    • Input OTP
    • Label
    • MenuBar
    • Modal
    • Popover
    • Progress
    • Radio Group
    • Segmented
    • Select
    • Separator
    • Sheet
    • Sidebar
    • Skeleton
    • Slider
    • Spinner
    • Steps
    • Switch
    • Tabs
    • Textarea
    • Toast
    • Tooltip
    • Typography
  1. Components
  2. Date Picker

Date Picker

A date input component that allows users to enter and edit dates.

Installation

The Date Picker is built using a composition of the <Popover /> and the <DayPicker /> components.

Install the following dependencies

npm install date-fns react-day-picker

Make sure you have the required components

You'll need the Popover and DayPicker components.

Usage

'use client'
 
import { Button } from '@/components/ui/button'
import { DayPicker } from '@/components/ui/daypicker'
import Popover from '@/components/ui/popover'
import { css } from '@styled-system/css'
import { styled } from '@styled-system/jsx'
import { icon } from '@styled-system/recipes'
import { format } from 'date-fns'
import { Calendar as CalendarIcon } from 'lucide-react'
import * as React from 'react'
 
export default function Example() {
  const [date, setDate] = React.useState<Date>()
 
  return (
    <Popover.Root>
      <Popover.Trigger asChild>
        <Button
          variant="outlined"
          className={css({
            width: '280px',
            justifyContent: 'flex-start',
            textAlign: 'left',
            fontWeight: 'normal',
            color: !date ? 'text.muted' : undefined,
          })}
        >
          <CalendarIcon className={icon()} />
          {date ? format(date, 'PPP') : <span>Pick a date</span>}
        </Button>
      </Popover.Trigger>
      <Popover.Content css={{ width: 'auto', padding: 0 }}>
        <DayPicker mode="single" selected={date} onSelect={setDate} initialFocus />
      </Popover.Content>
    </Popover.Root>
  )
}

Examples

Date Range Picker

With Presets

Built with ❤️ by the carbonteq team. The source code is available on GitHub.

© 2025 Pallas UI. All rights reserved.