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.
DatePickerField renders a button that opens a shadcn/ui Popover containing a Calendar component, letting users pick a single date. The selected Date object is stored directly in the form state, the calendar is shown in dropdown caption layout for quick year/month navigation, and the formatted date is displayed on the trigger button using date-fns format 'PPP' (e.g. “April 29th, 2025”).
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 JavaScript Date object.Label text rendered above the date picker trigger. Omit to hide the label.
When
true, appends a red asterisk to the label as a visual indicator.Disables the trigger button (and thus the calendar popover) when
true.Optional helper text rendered below the calendar trigger via
<FormDescription>. Useful for date format hints or contextual guidance.Additional CSS classes applied to the outermost
FormItem wrapper.Notes
DatePickerFieldmust be rendered inside a<ShaddyForm>— it readscontrolfromuseFormContextinternally.- The bound value is a native JavaScript
Dateobject. Usez.date()in your Zod schema. - The calendar uses
captionLayout="dropdown"which renders year and month dropdowns for faster navigation. - The selected date is formatted with
date-fnsformat(date, 'PPP'). This respects the locale set by yourdate-fnsconfiguration. - Validation errors are rendered below the description (if present) via shadcn/ui’s
<FormMessage>.