component

Calendar

props · 46 shown · 46 total

State

  • displayDate svelte
    Date

    Bindable current display date (the month/year shown in the header).

  • Date
    default new Date()

    Initial display + focus date. Does not select the date.

  • "days" "months" "years"

    Which view to show on mount. Falls back to the leaf view if the value isn't included in `views`. A controlled `view` outside `views` falls back to this value first.

  • selection svelte
    CalendarSelection

    Bindable current selection. `null` when nothing is selected.

  • view svelte
    CalendarView

    Bindable current view (`"days" | "months" | "years"`).

Appearance

  • "transparent" "surface.peak" "surface.hill" "surface.base" "surface.valley" "surface.ground"
    default "surface.peak"

    Panel background token (inherited from Panel).

  • "none" "default" "bold" "muted" "accent"
    default "default"

    Panel border token (inherited from Panel).

  • false CardFrameProps<TCardSlot>
    default {}

    The calendar's card frame. The calendar always renders inside its own Card: the period label ("July 2024") is the card heading, the Day/Month/Year tabs and the prev/next arrows sit in the header trailing, Today/Reset in the footer and the grid is the content. Pass Card props (`background`, `contentBackground`, `eyebrow`, `footer`…) to restyle or extend it. A consumer `heading` wins the heading row; the live period label then moves to the subheading (or, when `subheading` is set too, into the content above the grid) — it is never dropped. `false` opts out of the frame: a bare Panel root with the legacy DOM (the header/footer rows inside the calendar). Composites that already provide a surface — the InputDatetime popover — pass `false`.

  • "primary" "secondary" "tertiary"
    default secondary

    Panel emphasis variant (inherited from Panel).

  • "inherit" "danger" "neutral" "primary" "success" "warning"
    default "neutral"

    Color palette (inherited from Panel).

  • "lg" "md" "sm" "xs" "2xl" "xl" "none" "10xl" "11xl" "2xs" "3xl" "3xs" "4xl" "4xs" "5xl" "6xl" "7xl" "8xl" "9xl"
    default "sm"

    Panel padding token (inherited from Panel).

  • "lg" "md" "sm" "xs" "inherit" "2xl" "xl" "none" "2xs" "3xl" "4xl" "5xl" "6xl" "inner" "full"
    default "lg"

    Panel radius token (inherited from Panel).

  • "lg" "md" "sm" "xs" "xl" "none"
    default "none"

    Panel shadow token (inherited from Panel).

  • "lg" "md" "sm" "xs"
    default "md"

    Visual size variant — controls font size and minimum height.

  • boolean
    default false

    Render the panel surface with a translucent background (inherited from Panel).

Layout

  • "label" "dropdown"
    default "label"

    What the caption row shows. `label`: prev/next chevrons around the centered period title — the title is a Button that switches to the next coarser view (days → months → years → days) when `views` has more than one entry. `dropdown`: a month Select and a year Select side by side (the year range spans `minValue`–`maxValue`, or ±10 years when unbounded).

  • boolean
    default false

    Stretch the calendar to fill its container. By default it sizes to its content.

  • "grid" "strip"
    default "grid"

    How the days render. `grid`: the month grid. `strip`: one row of `stripDays` consecutive days (weekday above the number), with its own prev/next chevrons; the caption row above still steps whole months. The strip is days-only — the caption title is static and the view tabs are not shown. Needs `"days"` in `views` (falls back to the grid otherwise).

  • number
    default 1

    Number of month grids to render side by side in the day view (clamped 1–3). Range selection and keyboard navigation span them. Ignored in month/year views.

  • boolean
    default true

    Render the caption row (prev/next + period title, or the month/year Selects). Set to false to drive navigation entirely from the actions API.

  • boolean
    default false

    Show a Reset button in the footer (clears the selection).

  • boolean
    default false

    Render the formatted current selection above the grid (e.g. "May 9, 2026"). Reserves vertical space so the grid never shifts.

  • boolean
    default true

    Show a Today button in the footer.

  • boolean
    default false

    Show the Day/Month/Year segmented control (in the card header in card mode, above the caption row with `card={false}`). The caption title already switches views, so this is off by default.

  • number
    default 5

    Days a strip shows (`layout: "strip"`), clamped to 3–14. The window is centered on the focused date when the calendar mounts.

Behavior

  • CalendarDayContentMap

    Content under each day's number — a caption (a price, a count) and/or dots — keyed by ISO date: `{ "2026-07-02": { caption: "9 624", feedback: "success" } }`. When any day of a month has content, that month's day cells become taller rectangles so every row stays aligned. Svelte, React and Vue also accept a `(date) => content` function.

  • Date Date[] { from: Date; to?: Date; } { dayOfWeek: number[]; } SerializableCalendarDateMatcher[]

    Dates to disable (un-selectable), in addition to the `minValue`/`maxValue` window. Accepts any {@link CalendarDateMatcher} (or an array): a date, a span, `{ dayOfWeek: [0, 6] }` for weekends, or a helper like `month(2026, 7)`.

  • CalendarHighlight[]

    Highlight rules — tint matched dates with a semantic color and intensity (e.g. holidays `strong`, weekends `subtle`). Each rule's `match` is a {@link CalendarDateMatcher}; rules are evaluated in order, first match wins.

  • CalendarLabels
    default English labels ("Previous", "Next", "Today", "Reset", "Day", "Month", "Year", …)

    Every user-facing and assistive string: nav chevron names, view-switcher tabs, footer buttons, day-cell names, the decade label. Explicit values win; with a non-English `locale` the view tabs and Today button are derived from `Intl`; everything else keeps its English default. Messages with values take a `{placeholder}` template or a function — only templates survive Astro hydration.

  • string

    BCP 47 locale tag used for label formatting and the first day of the week.

  • number
    default 3

    How many dots a day shows before the rest collapse into a `+N` count (clamped to at least 1). The real total still joins the day's accessible name (`labels.dayDots`).

  • Date

    Latest selectable date (inclusive). Later days render disabled.

  • Date

    Earliest selectable date (inclusive). Earlier days render disabled.

  • (date: Date) => void

    Fires when the displayed month/year changes (navigation, today, etc.).

  • (selection: CalendarSelection) => void

    Fires whenever the selected date or range changes.

  • onViewChange svelte
    (view: CalendarView) => void

    Fires when the active view changes (days/months/years).

  • boolean
    default false

    Enable start/end range selection. The first click sets the start, the second the end (sorted automatically); hovering previews the range.

  • "day" "page"
    default "page"

    How far the strip's own chevrons move it: `page` a whole window (`stripDays` days), `day` one day.

  • readonly CalendarView[]
    default ["days", "months", "years"]

    Which views the user can navigate between. The lowest-granularity entry (`days` < `months` < `years`) becomes the leaf — clicking a cell at the leaf emits a selection (first-of-month for `months`, January 1st for `years`). Pass a single-entry array to render an unswitchable picker.

Slots

  • renderDayContent slot svelte
    Snippet<[CalendarDayCellModel]>

    Custom content under a day's number, replacing the default caption and dots. Receives the day cell (its `content`, `dateValue`, `label`) and renders for every day that has `dayContent`.

Advanced

  • actions svelte
    CalendarActions null

    Imperative actions (prev/next/today/reset/setView/goToDate). Bindable.

  • element binding svelte
    HTMLDivElement null

    Bindable element reference for the root div (the card root in card mode, the bare Panel root with `card={false}`).

  • null string

    Stable identifier for the calendar root element.

  • CalendarPassThrough<RootElementAttributes>

    Per-slot style/attribute override bag — inject Panda styles or extra HTML attributes onto any rendered slot.

  • boolean
    default false

    Astro / vanilla: serialize the props into `data-calendar-root-config` so the client runtime hydrates this instance and `getPindoba(el, "calendar")` can `update()` it. Frameworks with their own reactivity don't need it.

Plus all standard <div> HTML attributes.

Type

  • Components
  • Blocks