Calendar

A monthly calendar grid for date selection, range selection, and LiveView-owned month navigation.

Static

June 2026

SunMonTueWedThuFriSat

Date Picker Composition

Calendar is the grid primitive. Pair it with popover and a hidden form input when you need a date-picker field.

Popover Date Picker

Interactive

Pass a select_event for date clicks and a nav_event for month navigation. The events carry different payloads — phx-value-date for selection, phx-value-year and phx-value-month for navigation.

Single Selection

July 2026

SunMonTueWedThuFriSat

Selected: No date selected

Monday Start

Set week_start to choose the first weekday. Use 0 for Sunday, 1 for Monday, up to 6 for Saturday.

Monday Start

June 2026

MonTueWedThuFriSatSun

Range Selection

Use mode="range" with selected (range start) and range_end to highlight a span of dates. Dates between the endpoints get the calendar-day-in-range style.

Date Range

June 2026

SunMonTueWedThuFriSat

Start

No date selected

End

No date selected

Disabled Dates

Pass a list of Date structs or ISO strings to disabled_dates . Disabled dates can't be clicked and render with reduced opacity.

Disabled Dates

June 2026

SunMonTueWedThuFriSat

Notes

  • The parent LiveView owns date state. Click a selected date again to clear it, or keep the date selected in your event handler.
  • Use select_event for date clicks and nav_event for month navigation. For year jumps, render your own controls around the calendar and assign year / month from the parent LiveView.
  • Each day is a native <button> — keyboard-focusable and operable. The grid uses role="grid" with role="gridcell" .
  • Days outside the displayed month are visually muted and marked with data-outside — they still render so the grid stays rectangular.