werkbank
    Preparing search index...
    • A compound component for selecting a date using separate inputs for day, month, and year.

      Type Parameters

      • Schema extends BaseSchema<any, any, any>

      Parameters

      Returns Element

      The rendered date input wrapper.

      This component manages the state of three separate inputs and combines them into a single ISO date string (YYYY-MM-DD) in a hidden input for form submission. It uses a reducer to manage internal state and synchronizes with the value prop.

      import { DateInput, Day, MonthSelect, Year } from './date_input';

      function BirthdayField() {
      return (
      <DateInput name="birthday" required>
      <Day placeholder="DD" />
      <MonthSelect />
      <Year placeholder="YYYY" />
      </DateInput>
      );
      }