Skip to content

Form Components

Form wrapper and field components.


Form

React Hook Form wrapper with Zod validation.

Props

PropTypeRequiredDescription
schemaZodTypeNoZod validation schema
defaultValuesRecord<string, unknown>NoInitial form values
onSubmit(values) => void | Promise<void>YesSubmit handler
childrenReactNode | (methods) => ReactNodeYesForm content

Example

tsx
<Form
  schema={userSchema}
  defaultValues={{ email: '' }}
  onSubmit={handleSubmit}
>
  {(methods) => (
    <>
      <FieldEmail name="email" />
      <Button type="submit">Submit</Button>
    </>
  )}
</Form>

FieldText

Basic text input.

Props

PropTypeRequiredDescription
namestringYesField name
labelstringNoField label
placeholderstringNoPlaceholder text
disabledbooleanNoDisable input

FieldEmail

Email input with validation styling.

Props

Same as FieldText.


FieldPassword

Password input with show/hide toggle.

Props

Same as FieldText.


FieldCheckbox

Checkbox with label.

Props

PropTypeRequiredDescription
namestringYesField name
labelstringYesCheckbox label
disabledbooleanNoDisable checkbox

CalendarInput

Date/time picker with calendar popover.

Props

PropTypeDefaultDescription
valuestring-ISO date string
onChange(value: string) => void-Change handler
placeholderstring'Select date'Placeholder text
includeTimebooleantrueShow time picker
disabledbooleanfalseDisable input
requiredbooleanfalseRequired field
idstring-Input ID
classNamestring-Trigger class

FormHeader

Form section title.

Props

PropTypeDescription
titlestringSection title
descriptionstringSection description

FormDivider

Visual separator between sections.

See also