Forms
Navigation & layout
Data display & feedback
Date & time
Browse components
← All components
Calendar Year Picker
Year grid for jumping to a different year.
Install
npx shadcn@latest add https://ui.anuragroy.dev/r/calendar-year-picker.jsonPreview
Loading preview…
Installation
Add the component from this site. The shadcn CLI fetches the registry JSON over HTTPS — no named registry submission required.
Terminal
npx shadcn@latest add https://ui.anuragroy.dev/r/calendar-year-picker.jsonGitHub fallback if the website is down:
Terminal
npx shadcn@latest add https://raw.githubusercontent.com/anurag-roy/ui.anuragroy.dev/main/public/r/calendar-year-picker.jsonUsage
Import paths follow your components.json aliases. After install, the default path is @/components/ui/calendar-year-picker.
Import
import { CalendarYearPicker } from "@/components/ui/calendar-year-picker"example.tsx
import { CalendarYearPicker } from "@/components/ui/calendar-year-picker"export function Example() { return <CalendarYearPicker defaultValue={2026} />}API Reference
CalendarYearPicker
| Prop | Type | Default |
|---|---|---|
| value | number | — |
| defaultValue | number | — |
| onValueChange | (year: number) => void | — |
| startYear | number | — |
| endYear | number | — |
- startYear — Defaults to selected year − 6.
- endYear — Defaults to selected year + 5.