@midstem/chronous-svelte
v1.0.0
Published
Headless Svelte 5 primitives for @midstem/chronous
Maintainers
Readme
Chronous Svelte
Chronous is a headless calendar for Svelte 5. It handles time zones, recurrence and event layout; you control the markup and styles. No stylesheet is required.
Installation
npm install @midstem/chronous-svelte temporal-polyfillTemporal is available in current Chrome, Edge and Firefox, but not yet in Safari. Install the polyfill for Safari and other browsers without native Temporal, then import temporal-polyfill/global once in your app entry point before rendering the calendar. The Vue package includes the core engine.
Basic usage
<script lang="ts">
import { Calendar } from '@midstem/chronous-svelte'
let range = $state({
view: 'week' as const,
currentDate: '2026-03-18',
timeZone: 'Europe/Kyiv'
})
const events = [
{ id: 'standup', start: '2026-03-18T09:00', duration: 'PT30M' }
]
</script>
<Calendar.Root {range} {events} class="h-full overflow-auto rounded-xl border">
{#snippet children()}
<Calendar.Header>
<Calendar.DayHeadings class="border-l py-2 text-center" />
</Calendar.Header>
<Calendar.AllDayRow />
<Calendar.TimeGrid hourHeight={48}>
{#snippet children()}
<Calendar.TimeAxis>
{#snippet children()}
<Calendar.TimeLabels />
{/snippet}
</Calendar.TimeAxis>
<Calendar.DayColumns>
{#snippet children()}
<Calendar.TimeSlots class="border-t" />
<Calendar.TimedEvents class="rounded bg-blue-700 text-white">
{#snippet children({ event })}{event.id}{/snippet}
</Calendar.TimedEvents>
<Calendar.NowMarker />
{/snippet}
</Calendar.DayColumns>
{/snippet}
</Calendar.TimeGrid>
{/snippet}
</Calendar.Root>Documentation
See the Svelte documentation for more examples, components, typed event data, navigation and how to load Temporal correctly. It also explains browser support and the behavior when Temporal is unavailable.
License
MIT
