Cally Calendar Components for Date Pickers & Ranges

Category: Date & Time , Javascript , Recommended | September 8, 2026
AuthorWickyNilliams
Last UpdateSeptember 8, 2026
LicenseMIT
Views775 views
Cally Calendar Components for Date Pickers & Ranges

Cally is a JavaScript Web Component library for single-date calendars, date ranges, multiple-date selection, and multi-month calendar views. It uses standard custom elements and works in plain HTML, React, Vue, and Svelte projects.

Cally focuses on the calendar layer of a date picker. Your app or component library handles the input, toggle button, and popup. The package is less than 9KB min/gzip and has one runtime dependency, Atomico.

For React and shadcn/ui projects, compare this Flexible Date & Date Range Picker For Shadcn/ui.

Key Features:

  • Single-date, multiple-date, and date-range selection.
  • One or more months per calendar page.
  • Minimum and maximum dates plus custom disabled-date rules.
  • Week numbers and configurable weekday labels.
  • Month and year select components for quick calendar navigation.
  • Locale-aware labels through Intl.DateTimeFormat and RTL layouts.
  • Keyboard and screen reader support within the calendar components.
  • CSS parts, day-specific parts, and accent-color custom properties.
  • Framework-independent Web Components with TypeScript types.

How to use it:

1. Importing Cally registers its custom elements. Install the package from npm and import it into your JavaScript or TypeScript file, or load the ESM build from unpkg.

# NPM
npm install cally
# JavaScript / TypeScript
import "cally";
# CDN
<script type="module" src="https://unpkg.com/cally"></script>

2. Use <calendar-date> with <calendar-month> for single-date selection. Date values use the YYYY-MM-DD ISO 8601 format.

<calendar-date value="2026-09-08">
  <calendar-month></calendar-month>
</calendar-date>

3. Use <calendar-range> for a date range. The value uses YYYY-MM-DD/YYYY-MM-DD.

<calendar-range value="2026-09-08/2026-09-14">
  <calendar-month></calendar-month>
</calendar-range>

4. Use <calendar-multi> for multiple individual dates. Its value is a space-separated list of ISO dates.

<calendar-multi value="2026-09-08 2026-09-12 2026-09-18">
  <calendar-month></calendar-month>
</calendar-multi>

5. Set months on the parent calendar and offset on each month for a multi-month calendar.

<calendar-range months="2">
  <calendar-month></calendar-month>
  <calendar-month offset="1"></calendar-month>
</calendar-range>

6. Place <calendar-select-month> and <calendar-select-year> inside a date, range, or multi calendar when direct month and year navigation is useful.

<calendar-date min="2020-01-01" max="2030-12-31">
  <calendar-select-month></calendar-select-month>
  <calendar-select-year slot="heading" max-years="20"></calendar-select-year>
  <calendar-month></calendar-month>
</calendar-date>

Cally Component API Reference:

<calendar-date>, <calendar-range>, and <calendar-multi> Values

Componentvalue FormatDescription
<calendar-date>YYYY-MM-DDThe selected date.
<calendar-range>YYYY-MM-DD/YYYY-MM-DDThe selected start and end dates.
<calendar-multi>Space-separated YYYY-MM-DD valuesThe selected individual dates.

Shared Properties and Attributes

The following public properties belong to <calendar-date>, <calendar-range>, and <calendar-multi>. The value format differs by component as shown above.

PropertyAttributeTypeDefaultDescription
valuevaluestring""The selected date, range, or dates for the current component.
minminstring""The earliest selectable date.
maxmaxstring""The latest selectable date.
todaytodaystring""The date that the calendar considers today.
focusedDatefocused-datestringundefinedThe date considered focused by the calendar.
firstDayOfWeekfirst-day-of-weeknumber1The first weekday, where Sunday is 0 and Monday is 1.
showOutsideDaysshow-outside-daysbooleanfalseShows dates outside the displayed month.
showWeekNumbersshow-week-numbersbooleanfalseShows week numbers.
localelocalestring | undefinedundefinedSets the locale used for date formatting. The browser locale is used when unset.
monthsmonthsnumber1The number of months displayed per page.
pageBypage-by"months" | "single""months"Moves previous and next navigation by the displayed month count or by one month.
formatWeekdayformat-weekday"narrow" | "short""narrow"Sets the weekday header format.
isDateDisallowedNone(date: Date) => boolean() => falseReturns true for dates that cannot be selected.
getDayPartsNone(date: Date) => string() => ""Returns one or more CSS part names for an individual date.

<calendar-range> Specific Property

PropertyAttributeTypeDefaultDescription
tentativetentativestring""The tentative date during range selection, such as the selected range start.

Events

Cally emits non-bubbling custom events in response to user interaction. Programmatic changes to value do not emit change.

EventComponentsTypeFires When
changecalendar-date, calendar-range, calendar-multiEventThe selected value changes through user interaction.
focusdaycalendar-date, calendar-range, calendar-multiCustomEvent<Date>The focused day changes through keyboard navigation or previous/next controls.
rangestartcalendar-rangeCustomEvent<Date>The user starts a range selection.
rangeendcalendar-rangeCustomEvent<Date>The user finishes a range selection.

Method

MethodComponentsParametersDescription
focus(options?: FocusOptions & { target: "previous" | "next" | "day" }) => voidcalendar-date, calendar-range, calendar-multioptionsFocuses the month containing the focused date. target selects the previous button, next button, or day.

Shared CSS Parts

PartDescription
containerThe container for the entire component.
headerThe container for the heading and navigation buttons.
buttonAny button within the component.
previousThe previous-page button.
nextThe next-page button.
disabledA navigation button disabled by min or max.
headingThe heading that labels the calendar.
monthsThe default slot where month components are rendered.

Shared Slots

SlotDescription
DefaultHolds <calendar-month> components and other markup.
previousReplaces the content of the previous-page button.
nextReplaces the content of the next-page button.
headingReplaces the visible calendar heading. Cally keeps a separate visually hidden heading for accessibility.

<calendar-month>

<calendar-month> renders the grid of days and is designed for use inside <calendar-date>, <calendar-range>, or <calendar-multi>.

PropertyAttributeTypeDefaultDescription
offsetoffsetnumber0Sets the displayed month relative to the first month in a multi-month view.

CSS Custom Properties

PropertyDefaultDescription
--color-accentblackThe accent color used throughout the month component.
--color-text-on-accentwhiteThe text color used on the accent color.

CSS Parts

PartDescription
headingThe month heading.
tableThe calendar <table>.
trAny row in the table.
headThe table header row.
weekThe table body rows.
thThe table header cells.
tdThe table body cells.
col-weeknumberThe <col> for the week-number column.
col-1The <col> for the first weekday column.
col-2The <col> for the second weekday column.
col-3The <col> for the third weekday column.
col-4The <col> for the fourth weekday column.
col-5The <col> for the fifth weekday column.
col-6The <col> for the sixth weekday column.
col-7The <col> for the seventh weekday column.
weekdayThe weekday header cell.
weeknumberThe week-number cell.
buttonAny button in the month component.
dayThe buttons and headings for calendar days.
day-0Sunday day buttons and headings.
day-1Monday day buttons and headings.
day-2Tuesday day buttons and headings.
day-3Wednesday day buttons and headings.
day-4Thursday day buttons and headings.
day-5Friday day buttons and headings.
day-6Saturday day buttons and headings.
selectedSelected days.
todayThe current day.
disallowedDays rejected by isDateDisallowed.
outsideDays outside the displayed month.
range-startThe first day in a selected range.
range-endThe last day in a selected range.
range-innerDays between the range start and end.

Slot

SlotDescription
weeknumberHolds the heading for the week-number column when week numbers are shown. The default content is #.

<calendar-select-month>

PropertyAttributeTypeDefaultDescription
formatMonthformat-month"short" | "long""long"Uses short or long localized month names.

CSS Parts

PartDescription
labelThe <label> for the select.
selectThe <select> element.
optionEach month <option>.

<calendar-select-year>

PropertyAttributeTypeDefaultDescription
maxYearsmax-yearsnumber20Sets the maximum year count around the focused year. Parent min and max values can reduce the displayed range.

CSS Parts

PartDescription
labelThe <label> for the select.
selectThe <select> element.
optionEach year <option>.

Styling Cally:

Use CSS parts for individual controls and calendar states. <calendar-month> also exposes two custom properties for its accent colors.

calendar-range::part(months) {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
calendar-range::part(button) {
  border: 1px solid #bbb;
  border-radius: 4px;
  background: #fff;
}
calendar-month {
  --color-accent: #6d4aff;
  --color-text-on-accent: #fff;
}
calendar-month::part(range-inner) {
  border-radius: 0;
}

Official Guides:

Alternatives & Related Resources:

Changelog:

v0.9.2 (02/05/2026)

  • Fixed week-number calculations in non-GMT timezones.
  • Fixed numbered day CSS parts such as day-1 in non-GMT timezones.

You Might Be Interested In:


Leave a Reply