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/calendarbash
npx grassroot@latest add ui/calendarbash
yarn dlx grassroot add ui/calendarbash
bunx grassroot add ui/calendarAPI Reference
| Prop | Type | Default |
|---|---|---|
value | Date | null | undefined | — |
defaultValue | Date | null | undefined | — |
onChange | ((date: Date) => void) | undefined | — |
todayOverride "today" for the hairline ring (testing/stories). | Date | undefined | — |
className | string | undefined | — |