Date Picker Field
DatePickerField is a specialized reusable input component for shaddy form.
⚠️ This content is not available in your language yet.
DatePickerField
is a specialized reusable input component for the shaddy form. It accepts various props to customize its behavior and appearance, making it a flexible choice for different use cases. Use it to collect a single date input with validation and a calendar UI.
Installation
pnpm dlx shadcn@latest add https://shaddy-docs.vercel.app/r/date-picker-field
Props
Name | Type | Default | Description |
---|---|---|---|
name | string (from react-hook-form Path) | required | The field name (must match your form schema). |
label | string | The label displayed above the date picker. | |
required | boolean | false | Marks the field as required. |
disabled | boolean | false | Disables the date picker when true. |
className | string | Additional CSS classes for the field container. | |
description | string | Optional description displayed below the field. |
Usage
<ShaddyForm>
<DatePickerField
name="birthDate"
label="Birth Date"
required
description="Please select your date of birth"
/>
</ShaddyForm>