Skip to content

Calendar

A month in sight to choose one day. Month and day names, and whether the week starts on Sunday or Monday, follow the person’s language.

import { Calendar } from '@sypnia/ui/react'

On this page
  1. Choose a day
  2. Days that cannot be chosen
  3. Disabled
  4. When to use it
  5. For everyone
  6. Props

Choose a day

Today has a ring; the chosen day carries the light. Switch the page to Spanish: the week starts on Monday.

Day to restore, November 2026

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
1
2
3
4
5

The database will go back to how it was on Nov 17, 2026. Value: 2026-11-17

Code
import { useState } from 'react';
import { Calendar, useSypnia } from '@sypnia/ui/react';

export default function Basic() {
  const { format } = useSypnia();
  const [day, setDay] = useState('2026-11-17');
  return (
    <div className="sy-stack">
      <Calendar aria-label="Day to restore" value={day} onChange={setDay} />
      <p className="sy-text--sm sy-text--muted">The database will go back to how it was on {format.date(`${day}T12:00`)}. Value: <code>{day}</code></p>
    </div>
  );
}

Days that cannot be chosen

Backups exist for the last 30 days, and none was made on Sundays: those days are dimmed and skipped.

Backup to restore, November 2026

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
1
2
3
4
5
Code
import { Calendar } from '@sypnia/ui/react';

const noBackup = (date: string) => new Date(`${date}T12:00`).getDay() === 0;

export default function Limits() {
  return <Calendar aria-label="Backup to restore" defaultValue="2026-11-14" min="2026-10-18" max="2026-11-17" unavailable={noBackup} />;
}

Disabled

The chosen day stays in sight and nothing can be pressed.

Day of the next backup, November 2026

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
1
2
3
4
5
Code
import { Calendar } from '@sypnia/ui/react';

export default function States() {
  return <Calendar aria-label="Day of the next backup" disabled defaultValue="2026-11-21" />;
}

When to use it

Use it when

  • Choosing a day is the main task of the screen and there is room to keep the month in sight: scheduling, restoring a backup.
  • Some days cannot be chosen and the person should see which: min, max, unavailable.

Do not use it when

  • The date is one field among many in a form: DatePicker takes one line and opens this same calendar.
  • The date is far away and known by heart, like a birthday: DatePicker lets the person type it.
  • It is a period: DateRangePicker.

For everyone

  • Arrows move by day and by week; Page Up and Page Down by month (with Shift, by year); Home and End go to the ends of the week; Enter or Space chooses.
  • It is a grid: each day reads its full date («Tuesday, November 17, 2026»), and says if it is today, chosen or unavailable.
  • The month in sight is announced when it changes.
  • The value goes in and comes out as ISO text (2026-11-17), whatever the language shows.

Props

CalendarTypeDefault
aria-describedby string
aria-label

The name for screen readers when there is no Field around it.

string
aria-labelledby string
className string
defaultValue string
disabled boolean
id

Inside a Field it comes from the Field.

string
max

The last day that can be chosen.

string
min

The first day that can be chosen, as `2026-11-01`.

string
onChange ((date: string) => void)
unavailable

Days that cannot be chosen: return true for them.

((date: string) => boolean)
value

The chosen day, as `2026-11-17`.

string | null
  1. Choose a day
  2. Days that cannot be chosen
  3. Disabled
  4. When to use it
  5. For everyone
  6. Props

    Search pages, sections and terms