Skip to content

DatePicker

Stable

An inline month calendar for recent dates, with day buttons, quick Today and Yesterday, and the choice repeated in words.

Also known as calendar, date input, date selector

Install with npm install @tattva/ui (setup), or copy the code from the kit in Downloads.

With a range and quick buttons

October 2026

Monday
Tuesday
Wednesday
Thursday
Friday
Saturday
Sunday

Pick a date

Days before 15 August 2026 and after today are shown but off. Today and Yesterday sit above the grid because both are allowed.

When to use it

Pick one date that is almost always recent, with big targets for a thumb and a plain-words check of what was chosen.

Made of: Today and Yesterday buttons · Month and year · Previous and next month buttons · Weekday headers · Day grid · Confirmation line

Use it for

  • The date something happened or was reported, when it was in the last few weeks.
  • A date that must stay inside a range, such as not in the future or not before another date.
  • A form on a phone, where the browser's own date picker looks different on every device.

Not for

  • A date far in the past or future, such as a birth date, where typing is faster: use TextField.
  • A calendar that opens from a button as a floating panel: use Popover.
  • A whole number, such as a day count: use NumberField.
  • Choosing from a short fixed list: use Select.

Do and avoid

October 2026

Monday
Tuesday
Wednesday
Thursday
Friday
Saturday
Sunday

Wed, 14 Oct 2026 · in 5 days

Do. A date in the next few weeks, picked in one tap.

March 1988

Monday
Tuesday
Wednesday
Thursday
Friday
Saturday
Sunday

Mon, 14 Mar 1988 · 14088 days ago

Avoid. Paging back decades to a birth date is slower than typing it.

Do

  • Use it for dates that are almost always recent.
  • Set max or min when a day is not allowed, so a wrong date cannot be picked.
  • Leave the confirmation line on. It is the quickest way to check the choice.
  • Keep the calendar in the page, close to the question it answers.

Avoid

  • Do not use it for dates years away. Typing is faster there.
  • Do not hide days that are off. Showing them tells people the limits.
  • Do not use it as a pop-up. It is built to sit in the page.
  • Do not use colour alone to say which day is today or chosen. The part already adds a ring and a bold number.

On a phone

  • The calendar is seven columns of 44px days on a touch screen, so it needs about 335px of width and fits a 360px phone.
  • Month arrows and day buttons are 44px, and the Today and Yesterday buttons are 44px tall.
  • Days are chosen by tapping; the arrow-key moves are for keyboards only.
  • The Today and Yesterday row does not wrap.

Build your next AI screen with Tattva.

Free and open, with the code. Start in one line.

Get started