DocsComponentsAdvanced
DateRangePicker
React example follows below.
ts
import { DateRangePicker } from "@grassroot/ui-react/advanced"; const defaultValue = { start: new Date(2026, 5, 8), end: new Date(2026, 5, 21) }; <DateRangePicker today={new Date(2026, 5, 21)} defaultValue={defaultValue} />ts
<script setup lang="ts">import { DateRangePicker } from "@grassroot/ui-vue"; const defaultValue = { start: new Date(2026, 5, 8), end: new Date(2026, 5, 21) };</script> <template> <DateRangePicker :today="new Date(2026, 5, 21)" :default-value="defaultValue" /></template>No translated snippet for this adapter yet.
ts
<script lang="ts"> import { DateRangePicker } from "@grassroot/ui-svelte"; const defaultValue = { start: new Date(2026, 5, 8), end: new Date(2026, 5, 21) };</script> <DateRangePicker today={new Date(2026, 5, 21)} defaultValue={defaultValue} />ts
import { DateRangePicker } from "@grassroot/ui-solid"; const defaultValue = { start: new Date(2026, 5, 8), end: new Date(2026, 5, 21) }; export function Example() { return ( <> <DateRangePicker today={new Date(2026, 5, 21)} defaultValue={defaultValue} /> </> );}Installation
bash
pnpm dlx grassroot add ui/date-range-pickerbash
npx grassroot@latest add ui/date-range-pickerbash
yarn dlx grassroot add ui/date-range-pickerbash
bunx grassroot add ui/date-range-pickerAPI Reference
| Prop | Type | Default |
|---|---|---|
value | Range | undefined | — |
defaultValue | Range | undefined | — |
onChange | ((range: Range) => void) | undefined | — |
todayOverride "today" (testing/stories). | Date | undefined | — |
defaultOpenRender the calendar open initially. | boolean | undefined | false |
className | string | undefined | — |