Chewypixel component
Date Picker
A date field that opens a calendar. Months slide in the direction you page, and arrow keys move between days.
Installation
npx shadcn@latest add @chewypixel/date-pickerUsage
"use client";
import { useState } from "react";
import { DatePicker } from "@/components/ui/calendar";
export function DeliveryDate() {
const [date, setDate] = useState<string>();
return <DatePicker value={date} onChange={setDate} placeholder="Pick a delivery date" />;
}Props
valueThe selected date, as YYYY-MM-DD.
string
onChangeCalled with the picked date, as YYYY-MM-DD.
(date: string) => void
minThe earliest date that can be picked, as YYYY-MM-DD.
string
maxThe latest date that can be picked, as YYYY-MM-DD.
string
formatHow the field shows the date, as a Day.js format.
string = "ddd, MMM D, YYYY"
placeholderShown while no date is picked. For an inline calendar, use Calendar instead of DatePicker.
string = "Pick a date"
Released under the MIT License.
More components
- Password InputA password field with a button that shows or hides what you typed. The eye icon swaps with a quick pop.
- Code InputOne box per digit for verification codes, with a blinking caret in the next box. Pasting a code and autofill from SMS both work.
- Copy ButtonAn icon button that copies text. The copy icon pops into a check, then back.
- ShimmerText with a band of light sweeping across it, for loading and thinking states.
See them in a real app
These components come from Mochi, our admin dashboard template built with Next.js, shadcn/ui and Motion.