Skip to content

Date Display

Free

A date, a time, or a date range as text, in the order and words of the reader's language, in any time zone.

  • React Aria
  • React 19
  • Tailwind CSS 4

Added Nov 9, 2026 · MIT + Commons Clause

Playground

Loading the preview

Props

Pass the date and a style. Add DateDisplayEmpty for the text that shows when the date is missing.

order-dates.tsx

DateDisplay

<time>
PropTypeDefaultDescription
refRef<HTMLElement>—The root element: a <time> for one date, a <span> for a range (each end is a <time> inside it), so the ref is an HTMLElement, not an HTMLTimeElement: read the ISO value from the dateTime of the <time> elements, not from the root of a range.
dateStyle"full""long""medium""short"—full, long, medium (the default when no style and no format is set), short.
timeStyle"full""long""medium""short"—full, long, medium, short. Alone: a time only. With dateStyle: the date and the time.
format—Own Intl.DateTimeFormat options (weekday, month, hour, hourCycle, …), which replace the two styles. The zone label goes here too: timeZoneName short ("EDT"), shortOffset ("GMT+9"), long. Intl does not take timeZoneName with dateStyle or timeStyle.
dateRequiredDateLike | null—The date: a Date, an ISO string, epoch milliseconds, or a CalendarDate, CalendarDateTime, or ZonedDateTime. null, undefined, and a value that is not a date show the empty text.
endDateLike | null—The end of a range. The text comes from formatRangeToParts: "Oct 3 – 9, 2026". The end prints in the zone of date, so give both ends the same kind of value (two days, or two instants). A range renders a <span> with one <time> around each end (see DateDisplay).
relativebooleanfalseWrite the day as a word when it is yesterday, today, or tomorrow in the zone of the text: "Today", "Tomorrow, 9:30 AM", "Today, 2–4 PM" (a time range on one day; whole hours drop the ":00"), and "Mon – Wed, Nov 9 – 11" for days of the coming week. The words come from Intl.RelativeTimeFormat, and they show only after hydration (the server day is not the reader's day) or with now. Default false.
nowDateLike—A fixed now for relative (tests, stories): with it, no clock runs.
timeZonestring—The IANA zone of the text ("America/New_York"). Default: the zone of a ZonedDateTime, else the runtime zone. Pass it in a server-rendered app: the server zone and the reader's zone can print two different days.
localestring—The BCP 47 language tag ("en-GB", "ja-JP-u-ca-japanese"). Default: the DisplayLocaleProvider locale, else "en-US". It sets the words, the order, the digits, the calendar system, and dir.
tooltipbooleantrueShow the ISO value with its offset in a Tooltip on hover. Default true.
childrenReactNode—A DateDisplayEmpty part: the words of no value. With a value, they are not drawn.
...props<time> attributes—Every other attribute goes to the <time>.

DateDisplayEmpty

<div>
PropTypeDefaultDescription
data-slotstring—The data-slot of the root: the item's own slot ("time-ago"). Default "empty-value".
From Base UIUseRenderBase UI docs
render—Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render.
...props<div> attributes—Every other attribute goes to the <div>, with a ref.
  • Use dateStyle and timeStyle for the common forms, or format for any other Intl options.
  • Use end for a range. The shared parts show once.
  • Use relative for today, yesterday, and tomorrow as words.
  • Use timeZone to show the moment in another zone.
  • For the time since a moment, such as 5 min ago, use Time Ago.
  • For the live time now, use a Clock.
  • For a date that people pick, use a Date Picker.

Built with

Installs with Date Display

Components
Full Value
  1. AddedDate Display, with Full Value.
Open the release