MonTueWedThuFriSatSun

Code

<!-- pearl-calendar.free.js: download it from the Install section below and host it with your site -->
<script src="/pearl-calendar.free.js" defer></script>

<pearl-calendar
  value="2026-11-19"
  name="date"
  size="42"
  theme="light"
></pearl-calendar>

<script>
  document.querySelector('pearl-calendar').addEventListener('change', (e) => {
    console.log(e.detail.value);
  });
</script>

In context

MonTueWedThuFriSatSun
Nov 10 – Nov 19 · 9 nights in Lisbon
Trip dates: a range
MonTueWedThuFriSatSun
Delivery on Nov 24, 9:00 – 13:00
Mint, only the next three weeks Pro

Install · Free Web Component

One file, no dependencies. Aurora preset, every other option included. Host it yourself so your visitors never load anything from our servers.

1. Install with one command — or download the file
shadcn CLI · React
npx shadcn@latest add https://www.ui-design.co/r/pearl-calendar.json
2. Load it and use the element
HTML
<!-- pearl-calendar.free.js: download it from the Install section below and host it with your site -->
<script src="/pearl-calendar.free.js" defer></script>

<pearl-calendar
  value="2026-11-19"
  name="date"
  size="40"
  theme="light"
></pearl-calendar>

<script>
  document.querySelector('pearl-calendar').addEventListener('change', (e) => {
    console.log(e.detail.value);
  });
</script>
3. React + TypeScript (optional)

The shadcn command adds a typed React wrapper for you. Using the file directly? Custom elements work in React as-is; for type checking add:

TypeScript
// pearl-calendar.d.ts
declare namespace JSX {
  interface IntrinsicElements {
    'pearl-calendar': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & {
      value?: string;
      mode?: 'single' | 'range';
      min?: string;
      max?: string;
      'week-start'?: 0 | 1 | '0' | '1';
      locale?: string;
      month?: string;
      size?: number | string;
      theme?: 'light' | 'dark';
      name?: string;
      label?: string;
      disabled?: boolean | '';
      sound?: boolean | '';
    };
  }
}

Pro · React + TypeScript Pro

One payment of $4.99, yours forever. Use it in unlimited personal and commercial projects; no resale.

  • React component (controlled or uncontrolled) with TypeScript types and the full source
  • Sunset, Mint and Mono tints, plus custom tints from Brand Fit
  • The vanilla Web Component with every tint, a demo page, README and license

Attributes & props

NameTypeDefaultDescription
value string''The chosen day as a local ISO date, '2026-11-19'. In range mode both ends with a slash: '2026-11-10/2026-11-19'. Fires change with detail.value.
mode 'single' | 'range''single'One day, or a range: the first click sets the start, the second the end. change fires once the range is complete, with detail.start and detail.end.
min / max yyyy-mm-dd—First and last day that can be picked. Days outside lose their well, and the month arrows stop at the edge.
week-start 0 | 110 starts the week on Sunday, 1 on Monday. weekStart in React.
locale BCP 47 tagpage languageLanguage of the month title, the weekday names and each day's spoken label, e.g. 'de' or 'pt-BR'. Defaults to <html lang>, then English.
month yyyy-mmmonth of the valueThe month on show. Without it the calendar opens on the value, or on today. A month event (detail.month) fires when the user moves; el.show("2027-01") moves it from script.
size number (px)40Size of one day cell; the slab, the type and the arrows scale with it. 44 and up is comfortable on touch screens.
theme 'light' | 'dark''light'White porcelain or dark. Follows data-ui-theme on any ancestor when not set.
name string—Form field name: a hidden input carries the value into the surrounding form.
label string—What the dates are for ("Trip dates") — read out by screen readers before the month.
disabled booleanoffDims it and ignores input.
sound booleanoffA porcelain tap on a pick and a tick when the month changes. Also on for everything inside an element with data-ui-sound="on".
tint Pro'aurora' | 'sunset' | 'mint' | 'mono' | object'aurora'Colours of the halo, the band of light and the chosen number, or a custom tint. Free build ships Aurora only.

It is a WAI-ARIA date grid with one tab stop: the arrows move by day and week, Home / End go to the ends of the week, Page Up / Page Down change month (with Shift, year), Enter or Space picks. Every day is a real button with its full date as its label. Days from the neighbouring months are dimmed and can be picked — the grid slides over to them. Clicking the month title returns to today, which carries a small tinted dot. Values are local dates: nothing is ever parsed as UTC, so a day cannot slip across a time zone. All CSS, no WebGL; reduced motion keeps the pearl and the light and drops the hop, the pour and the slide.

More components