Files
2025-06-08 16:43:24 -04:00

3.1 KiB

title, description, component, links
title description component links
Calendar A calendar component that allows users to select dates. true
source doc api
https://github.com/huntabyte/shadcn-svelte/tree/next/sites/docs/src/lib/registry/ui/calendar https://bits-ui.com/docs/components/calendar https://bits-ui.com/docs/components/calendar#api-reference
<script> import ComponentPreview from "$lib/components/component-preview.svelte"; import Callout from "$lib/components/callout.svelte"; import PMAddComp from "$lib/components/pm-add-comp.svelte"; import PMInstall from "$lib/components/pm-install.svelte"; import Steps from "$lib/components/steps.svelte"; import Step from "$lib/components/step.svelte"; import InstallTabs from "$lib/components/install-tabs.svelte"; </script>

Blocks

We have built a collection of 30+ calendar blocks that you can use to build your own calendar components.

See call calendar blocks in the Blocks Library page.

About

The <Calendar /> component is built on top of the Bits UI Calendar component, which uses the @internationalized/date package to handle dates.

If you're looking for a range calendar, check out the Range Calendar component.

Installation

{#snippet cli()} {/snippet} {#snippet manual()}

Install bits-ui and @internationalized/date:

Copy and paste the component source files linked at the top of this page into your project.

{/snippet}

Date Picker

You can use the <Calendar /> component to build a date picker. See the Date Picker page for more information.

Examples

Range Calendar

Month and Year Selector

Date of Birth Picker

Date and Time Picker

Natural Language Picker

This component uses the chrono-node library to parse natural language dates.

Upgrade Guide

You can upgrade to the latest version of the <Calendar /> component by running the following command:

When you're prompted to overwrite the existing files, select Yes. If you have made any changes to the Calendar component, you will need to merge your changes with the new version.

Installing Blocks

After upgrading the Calendar component, you can add the new blocks with the following:

This will add the latest version of the calendar blocks.