Skip to content

Published on 13/10/2026

The Mystery of shadcn’s Date Picker Presets: Where’s the Code?

If you have worked with modern React applications recently, you have likely encountered shadcn/ui. Rather than shipping as an npm dependency, it popularized a copy-and-paste philosophy built atop Radix UI and Tailwind CSS. It gives developers total ownership over their component code.

However, new adopters often hit a confusing moment when implementing the Date Picker. In the official documentation, there is an attractive example: "Date Picker with Presets." It features a dropdown allowing users to select "Today," "Tomorrow," or "In a week." Naturally, developers look for the presets prop or inspect the core component—only to find that preset functionality is completely absent from the base code.

The Illusion of the Kitchen-Sink Component

Traditional component libraries like Material UI or Ant Design condition us to expect monolithic APIs. In those ecosystems, adding presets usually looks like passing an array of strings or configuration objects into a prop: <DatePicker presets={['today', 'tomorrow']} />.

When developers pull the calendar.tsx primitive from shadcn/ui, they expect the same batteries-included treatment. Instead, the primitive contains only the core calendar logic provided by React DayPicker wrapped in Tailwind styles. The presets are nowhere to be seen because, in shadcn, the "Date Picker with Presets" is not a component at all—it is a recipe.

Composition Over Configuration

This deliberate absence highlights shadcn’s core philosophy: composition over configuration. Instead of bloating a single component with endless edge cases and configuration flags, shadcn encourages you to assemble independent primitives.

If you inspect the actual code block beneath the documentation example, you will notice what is really happening:

  • A standard Popover wraps the interface.
  • A Select component renders the quick options ("In a week", "In a month").
  • A Calendar component renders the interactive date grid.
  • A utility library like date-fns handles date math (such as addDays(new Date(), 7)).

The presets exist purely in user-land code. They are not bundled into the UI primitive because your application's presets will inevitably differ from anyone else's. An airline booking app needs "Flexible dates," while an issue tracker needs "End of Sprint."

Why This Architecture Wins

While this approach requires a few more lines of code in your feature directory, it solves several long-term maintenance headaches:

  • Zero Bundle Bloat: If only one form in your app needs date presets, the rest of your date pickers remain lightweight.
  • Complete Design Control: You are never locked into how a third-party maintainer decided a preset menu should look or animate.
  • Trivial Business Logic Integration: Connecting preset changes to custom analytics, state managers, or API mutations requires no awkward event bridging.

The Takeaway

When you browse shadcn/ui, you are not browsing an API catalog; you are browsing an architectural guide. The missing presets in the core Date Picker are not an omission—they are an invitation to build interfaces through composable building blocks rather than rigid props.