Skip to content

Form Fields

Form components integrate with React Hook Form for validation and state management.

HtmlForm

Wrapper that provides form context:

import { HtmlForm, Input, Select } from '@wpappointments/components';
<HtmlForm onSubmit={handleSubmit}>
<Input name="title" label="Title" required />
<Select
name="status"
label="Status"
options={[
{ value: 'active', label: 'Active' },
{ value: 'inactive', label: 'Inactive' },
]}
/>
</HtmlForm>

Available Fields

ComponentPurpose
InputText input
NumberFieldNumeric input
SelectDropdown select
ToggleOn/off switch
CheckboxCheckbox input
RadioRadio button group
DatePickerDate selection
WPDatePickerWordPress-styled date picker

FormField Wrapper

All field components are wrapped in FormField which handles:

  • Label rendering
  • Error message display
  • Help text
  • Required indicator