CLI previewInstall commands shown on this site are not released yet.

DocsComponentsData Display

Calendar

React example follows below.
ts
import { Calendar } from "@grassroot/ui-react";
const [date, setDate] = React.useState<Date | null>(new Date(2026, 5, 18));
<Calendar value={date} onChange={setDate} today={new Date(2026, 5, 21)} />
ts
<script setup lang="ts">
import { ref } from "vue";
import { Calendar } from "@grassroot/ui-vue";
const date = ref(new Date(2026, 5, 18));
</script>
<template>
<Calendar
v-model="date"
@change="date = $event"
:today="new Date(2026, 5, 21)"
/>
</template>

No translated snippet for this adapter yet.

ts
<script lang="ts">
import { Calendar } from "@grassroot/ui-svelte";
let date = $state(new Date(2026, 5, 18));
</script>
<Calendar
value={date}
onChange={(next) => (date = next)}
today={new Date(2026, 5, 21)}
/>
ts
import { createSignal } from "solid-js";
import { Calendar } from "@grassroot/ui-solid";
export function Example() {
const [date, setDate] = createSignal(new Date(2026, 5, 18));
return (
<>
<Calendar value={date()} onChange={setDate} today={new Date(2026, 5, 21)} />
</>
);
}

Installation

bash
pnpm dlx grassroot add ui/calendar
bash
npx grassroot@latest add ui/calendar
bash
yarn dlx grassroot add ui/calendar
bash
bunx grassroot add ui/calendar

API Reference

CalendarProps
PropTypeDefault
valueDate | null | undefined
defaultValueDate | null | undefined
onChange((date: Date) => void) | undefined
todayOverride "today" for the hairline ring (testing/stories).Date | undefined
classNamestring | undefined