FormComponentsDate Picker Field

Date Picker Field

DatePickerField is a specialized reusable input component for shaddy form.

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

NameTypeDefaultDescription
namestring (from react-hook-form Path)requiredThe field name (must match your form schema).
labelstringThe label displayed above the date picker.
requiredbooleanfalseMarks the field as required.
disabledbooleanfalseDisables the date picker when true.
classNamestringAdditional CSS classes for the field container.
descriptionstringOptional description displayed below the field.

Usage

<ShaddyForm>
  <DatePickerField
    name="birthDate"
    label="Birth Date"
    required
    description="Please select your date of birth"
  />
</ShaddyForm>