Date Picker
A controlled single-date picker — atomx ships it as a block composing Popover, Calendar, and Button so you get a consistent API instead of wiring the primitives together yourself.
Install
npx shadcn@latest add https://atomx.acau.net/r/date-picker.jsonThis installs the DatePicker block and its three registry dependencies — popover, calendar, and button — in one step.
Why a block?
Upstream shadcn/ui documents Date Picker only as a composition pattern — a Popover wrapping a Calendar behind a Button trigger. That leaves every team to re-implement the same plumbing: open/close state, the formatted trigger label, the placeholder fallback, and the onChange wiring.
atomx ships DatePicker as a first-class block so you get:
- A stable
value/onChangeAPI you can drop into any form. - The Popover + Calendar + Button composition handled for you.
- The popover closing automatically once a date is picked.
- Full access to the source after install — customize it freely.
If you need range selection, multiple months, or preset shortcuts, copy the block and extend it. The primitives (Popover, Calendar, Button) are installed alongside it.
Usage
DatePicker is controlled — you own the selected Date in state and pass it back via value.
import { useState } from "react"
import { DatePicker } from "@/components/date-picker/date-picker"
export function Example() {
const [date, setDate] = useState<Date | undefined>(undefined)
return (
<DatePicker value={date} onChange={setDate} placeholder="Pick a date" />
)
}Preview
Props
| Prop | Type | Default | Notes |
|---|---|---|---|
value | Date | undefined | undefined | Controlled selected date. |
onChange | (date: Date | undefined) => void | — | Called with the new date when the user picks a day. |
placeholder | string | "Pick a date" | Trigger label shown when no date is selected. |
disabled | boolean | false | Disables the trigger button. |
className | string | — | Applied to the trigger button; use to override width. |
Dates are formatted with the built-in Date.prototype.toLocaleDateString() — no extra date library is required.
Data Table
A feature-rich data table with sorting, filtering, pagination, row selection, expansion, inline editing, row pinning, and virtualisation. Built on TanStack Table v8.
Dialog
A modal dialog built on Radix UI's Dialog primitive, with an accessible overlay, close button, header, footer, and portal rendering.