Calendar

Live in Codebase

The calendar component lets users select a date and includes built-in options to define minimum and maximum selectable dates.

AA

WCAG 2.1 accessibility compliant

Calendar

Live in Codebase

The calendar component lets users select a date and includes built-in options to define minimum and maximum selectable dates.

AA

WCAG 2.1 accessibility compliant

Calendar

The calendar component lets users select a date and includes built-in options to define minimum and maximum selectable dates.

When to use

When not to use

✅ Use when users need to select a single date or a date range.

⛔️ Don’t use for entering a date of birth, use an Input component instead.

✅ Automatically close the calendar after one date is chosen, unless selecting a range.

⛔️ Avoid using for dates more than 10 years in the past or future.

Anatomy

The Calendar component is composed of several key elements arranged in a structured layout:

  • Calendar Container – The main wrapper that defines boundaries with background, border, and padding.

  • Header Section – Displays the month and year, centered between left and right navigation chevrons.

  • Day Headers Row – Shows abbreviated day names (Su, Mo, Tu, We, Th, Fr, Sa) labeling each column.

  • Calendar Grid – A 6×7 grid of date cells displaying the current month along with adjacent dates for context.

  • Date Cells – Interactive areas representing each date, with visual states for selected, today, disabled, and default.

Element

Description

  1. Button, Left

Button, Lucide Icon chevron left

  1. Month, Year

Text

  1. Button, Right

Button, Lucide Icon chevron right

  1. Day

Text

  1. Date

Text

  1. Selected Date

Text

Spacing

Calendar uses semantic spacing tokens for consistent layout

Internal Spacing

Default size: p-md gap-md (16px padding, 16px gap)

Small size: p-sm gap-sm (12px padding, 12px gap)

Calendar grid: gap-sm between rows (12px)

Calendar days: gap-xxs between day cells (4px)

Day cells: min-w-[32px] min-h-[32px] with rounded-full selected state

When to use

When not to use

✅ Use when users need to select a single date or a date range.

⛔️ Don’t use for entering a date of birth, use an Input component instead.

✅ Automatically close the calendar after one date is chosen, unless selecting a range.

⛔️ Avoid using for dates more than 10 years in the past or future.

Anatomy

The Calendar component is composed of several key elements arranged in a structured layout:

  • Calendar Container – The main wrapper that defines boundaries with background, border, and padding.

  • Header Section – Displays the month and year, centered between left and right navigation chevrons.

  • Day Headers Row – Shows abbreviated day names (Su, Mo, Tu, We, Th, Fr, Sa) labeling each column.

  • Calendar Grid – A 6×7 grid of date cells displaying the current month along with adjacent dates for context.

  • Date Cells – Interactive areas representing each date, with visual states for selected, today, disabled, and default.

Element

Description

  1. Button, Left

Button, Lucide Icon chevron left

  1. Month, Year

Text

  1. Button, Right

Button, Lucide Icon chevron right

  1. Day

Text

  1. Date

Text

  1. Selected Date

Text

Spacing

Calendar uses semantic spacing tokens for consistent layout

Internal Spacing

Default size: p-md gap-md (16px padding, 16px gap)

Small size: p-sm gap-sm (12px padding, 12px gap)

Calendar grid: gap-sm between rows (12px)

Calendar days: gap-xxs between day cells (4px)

Day cells: min-w-[32px] min-h-[32px] with rounded-full selected state

When to use

When not to use

✅ Use when users need to select a single date or a date range.

⛔️ Don’t use for entering a date of birth, use an Input component instead.

✅ Automatically close the calendar after one date is chosen, unless selecting a range.

⛔️ Avoid using for dates more than 10 years in the past or future.

Anatomy

The Calendar component is composed of several key elements arranged in a structured layout:

  • Calendar Container – The main wrapper that defines boundaries with background, border, and padding.

  • Header Section – Displays the month and year, centered between left and right navigation chevrons.

  • Day Headers Row – Shows abbreviated day names (Su, Mo, Tu, We, Th, Fr, Sa) labeling each column.

  • Calendar Grid – A 6×7 grid of date cells displaying the current month along with adjacent dates for context.

  • Date Cells – Interactive areas representing each date, with visual states for selected, today, disabled, and default.

Element

Description

  1. Button, Left

Button, Lucide Icon chevron left

  1. Month, Year

Text

  1. Button, Right

Button, Lucide Icon chevron right

  1. Day

Text

  1. Date

Text

  1. Selected Date

Text

Spacing

Calendar uses semantic spacing tokens for consistent layout

Internal Spacing

Default size: p-md gap-md (16px padding, 16px gap)

Small size: p-sm gap-sm (12px padding, 12px gap)

Calendar grid: gap-sm between rows (12px)

Calendar days: gap-xxs between day cells (4px)

Day cells: min-w-[32px] min-h-[32px] with rounded-full selected state

Continue reading

Get in touch

Got a project in mind? Let’s chat. I’m always keen to hear about new ideas, collaborations, or challenges you’re looking to solve. Drop me a message and we can explore how to bring your vision to life together.

Get in touch

Got a project in mind? Let’s chat. I’m always keen to hear about new ideas, collaborations, or challenges you’re looking to solve. Drop me a message and we can explore how to bring your vision to life together.

Get in touch

Got a project in mind? Let’s chat. I’m always keen to hear about new ideas, collaborations, or challenges you’re looking to solve. Drop me a message and we can explore how to bring your vision to life together.