Date Picker

A date selection component, often combined with a calendar in a popover or input.

Installation

Install the component package, shared coss-svelte theme, and Bits UI peer.

npm install coss-svelte @coss-svelte/theme bits-ui

Usage

Import the Svelte component exports directly from the package.

import { DatePicker } from "coss-svelte";

Anatomy

Date Picker exposes a single component export for the current implementation.

API Reference

DatePicker

A date selection component, often combined with a calendar in a popover or input.

PropTypeDefaultDescription
bind:valueDateValue-Current value for the component. Bind with `bind:value` when supported.
bind:openbooleanfalseOpen state for the popup or disclosure. Bind with `bind:open`.
localestring"en-US"Locale used for deterministic numeric parsing and formatting.
labelstring"Pick a date"Accessible label or fallback visible label for the control.
previousMonthLabelstring"Previous month"Accessible label for the previous-month navigation button.
nextMonthLabelstring"Next month"Accessible label for the next-month navigation button.
children : Snippet<[]>

Inherits from Bits UI DatePicker.Root and Bits UI DatePicker.Trigger.

Implementation Details

Status
Stable
Foundation
compound
Category
Selection & Input
Particles
9