Documentation Index
Fetch the complete documentation index at: https://mintlify.com/rijvi-mahmud/shaddy/llms.txt
Use this file to discover all available pages before exploring further.
DateRangePickerField wraps the DateRangePicker UI component inside ShaddyForm’s form context, allowing users to select a start and end date as a single form field. The bound value is a date range object (with from and to date properties) that is stored directly in the form state, with validation errors surfaced automatically via <FormMessage>.
Installation
Install all ShaddyForm fields at once with theshaddy-form registry item:
Usage
Props
The field name. Must match a key in your Zod schema passed to
ShaddyForm. The bound value is a date range object with from and to properties.Label text rendered above the date range picker. Omit to hide the label.
When
true, appends a red asterisk to the label as a visual indicator.Declared in the field’s type interface. Note: this prop is not currently wired through to the underlying
DateRangePicker component and has no effect at runtime.Additional CSS classes applied to the outermost
FormItem wrapper.Notes
DateRangePickerFieldmust be rendered inside a<ShaddyForm>— it readscontrolfromuseFormContextinternally.- The bound value is a date range object. Structure your Zod schema with
z.object({ from: z.date(), to: z.date().optional() })—tois optional because a user may have selected only a start date. Provide matching initial values. - For picking a single date, use
DatePickerFieldinstead. - Validation errors are rendered below the date range picker via shadcn/ui’s
<FormMessage>.