Svelte Date Picker

The date components in SvGrid are the ones the grid itself mounts when you edit a date cell, which means they are built for keyboard use and awkward input before they are built to look good in a screenshot. They also work perfectly well on their own, in any form, with no grid in sight.

There are three of them: SvCalendar for picking days out of a month, year or decade view, SvDateTimePicker for a masked input with a calendar and clock dropdown, and SvDateRangeInput for a start and end pair.

Install

npm i @svgrid/grid

Free and MIT-licensed in @svgrid/grid: no license key, no row cap, no watermark.

The code

<script lang="ts">
  import { SvDateTimePicker, SvCalendar } from '@svgrid/grid'

  let value = $state<Date | null>(new Date())
  let day = $state<Date | null>(null)
</script>

<SvDateTimePicker {value} hourFormat={24} onChange={(v) => (value = v)} />

<SvCalendar value={day} selectionMode="single" weekNumbers onChange={(d) => (day = d)} />

What you get

Live examples

Documentation

Related articles

Frequently asked questions

How do I add a date picker to a Svelte app?

Import SvDateTimePicker or SvCalendar from @svgrid/grid and bind a value. There is no separate package and no date library to add.

Can it pick a date range?

Yes. SvCalendar has a range selection mode with an optional presets rail, and SvDateRangeInput gives you a start and end field pair in one control.

Is the date picker free?

Yes. Every date and time component is MIT-licensed in @svgrid/grid, with no license key.

Does it work as a grid cell editor?

Yes, and that is where it came from. A column with editorType 'date' or 'datetime' opens the same component inline when the cell is edited.

Build something else

Get started · Browse the gallery · Pricing