Date Picker
A date selection component, often combined with a calendar in a popover or input.
<script lang="ts">
import { DatePicker } from "coss-svelte";
</script>
<DatePicker />
Installation
Install the component package, shared coss-svelte theme, and Bits UI peer.
npm install coss-svelte @coss-svelte/theme bits-uiUsage
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.
| Prop | Type | Default | Description |
|---|---|---|---|
bind:value | DateValue | - | Current value for the component. Bind with `bind:value` when supported. |
bind:open | boolean | false | Open state for the popup or disclosure. Bind with `bind:open`. |
locale | string | "en-US" | Locale used for deterministic numeric parsing and formatting. |
label | string | "Pick a date" | Accessible label or fallback visible label for the control. |
previousMonthLabel | string | "Previous month" | Accessible label for the previous-month navigation button. |
nextMonthLabel | string | "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