A selectable calendar component for Svelte with week and day selection modes.
npm install syai-calendar
This package uses Tailwind CSS for styling. Your project must have Tailwind CSS installed and configured.
<script>
import { SelectableCalendar, MonthlyCalendar, YearCalendar } from 'syai-calendar';
import { CalendarDate } from '@internationalized/date';
</script>
<!-- Day/Week selection -->
<SelectableCalendar
mode="week"
minValue={new CalendarDate(2024, 1, 1)}
maxValue={new CalendarDate(2024, 12, 31)}
theme={{
bg: '#ffffff',
text: '#1a1a2e',
muted: '#64748b',
border: '#e2e8f0',
hover: '#e0f2fe',
selected: '#0284c7',
selectedText: '#ffffff',
todayBorder: '#0ea5e9'
}}
/>
<!-- Month selection -->
<MonthlyCalendar
theme={{ bg: '#ffffff', text: '#1a1a2e' }}
/>
<!-- Year selection -->
<YearCalendar
theme={{ bg: '#ffffff', text: '#1a1a2e' }}
/>
mode: "day" | "week" - Selection modevalue: { start: DateValue; end: DateValue } | null - Current selectiononValueChange: (value) => void - Callback when selection changesminValue/maxValue: Date constraintstheme: Custom CSS variable valuesvalue: { start: DateValue; end: DateValue } | nullonValueChange: (value) => voidminValue/maxValue: Date constraintstheme: Custom CSS variable valuesnpm run dev
npm run build
npm run check
MIT