Skip to main content
InputLevel 2

Date Picker

日期选择器

WebMobileDesktopDifficulty: Medium

A calendar that pops open on click so the user can pick a specific day, with invalid dates greyed out.

01

Live Demo

Actually clickable
Live Demo Playground
March 2026
MTWTFSS

Selected 12 3 2026

Past dates are greyed out and disabled. Today gets a ring around it.

What you just saw:Choosing a departure date when booking a flight, picking a visit day for an appointment, setting a date range in an analytics dashboard — a month calendar that pops up on click.

02

What it actually is

The hard part of a date picker is not popping up a calendar — it is making the constraints legible. Birth dates cannot be in the future, past dates must be greyed out, and the allowed span has to be explained. All of that has to be visible directly on the calendar.

date pickercalendar pickerdate fielddate selectorcalendar popover
03

Anatomy · What it's made of

  1. Trigger触发框

    Shows the chosen date or a placeholder

  2. Calendar月历

    A 7×6 grid

  3. Valid / Disabled可选/禁用日

    Disabled days greyed out and unclickable

  4. Selected选中日

    Filled with the primary color

  5. Range Highlight区间高亮

    Highlights the middle of a selected range

04

When to Use

When it fits, and when it doesn't
Date Picker usage recommendations
SituationUse it?
The user needs to pick one specific dateYes
The date has validity constraints (no past dates)Yes
Getting it wrong is costly (appointments, lease terms, invoices)Yes
The user needs to pick a range of datesDepends
Only an approximate month or year is neededDepends

Making someone open a calendar twice just to fill in a date is often worse than letting a text field accept a format like 2026-03-15.

Remember: never make users fail on format. Accept several input formats and correct them afterward.

05

Similar Patterns

Don't mix these up
06

How to tell AI

Three levels of prompt

Add the component name and specifics

Add a date picker: defaults to today, past dates cannot be selected and are greyed out in the month calendar, and the chosen date is written back into the input.

07

Don't just say this to AI

Bad → Better

Don't say this to AI

Add something for picking a date.

Say this instead

Add a Date Picker: defaults to today, past dates greyed out and disabled, the selected day filled with the primary color, today marked with an outline, arrow keys to move, Enter to select, Esc to close.

08

Share this card

Social-ready

Turn this pattern into a 3:4 or 1:1 knowledge card and export it as PNG right in the browser. No backend needed.