MiHCM
primitives/@mihcm/ui·v0.21.0·stable

Form

Full-featured form system integrated with TanStack React Form v1. Field wrappers include input, search, textarea, checkbox, switch, select, combobox, radio, radio cards, date, date range, checkbox grid, dropzone, field arrays, subscriptions, effects, and actions.

Props

The full prop API for Form. Same surface in web and React Native — bundlers pick the right variant via the react-native export condition.

PropTypeDefaultDescriptionSince
formFormApi—Return value of useForm(). Required for all integrated fields.0.6.0
namestring—Field name matching defaultValues keys. Required.0.6.0
labelstring—Visible label text. Required.0.6.0
descriptionstring—Helper text rendered below the control.0.6.0
requiredbooleanfalseRenders asterisk and sets aria-required.0.6.0
disabledbooleanfalseDisables the control.0.6.0
validatorsFormFieldValidators—onChange, onBlur, and onChangeAsync validators.0.6.0
placeholderstring—Placeholder text for FormInput, FormSearchField, FormTextarea, FormSelect, FormCombobox, FormDatePicker, and FormDateRangePicker.0.6.0
optionsFormSelectOption[] | ComboboxOption[] | RadioCardOption[]—Option arrays for FormSelect, FormCombobox, and FormRadioCardGroup.0.13.0
itemsreadonly string[]—CheckboxGrid item list. FormCheckboxGrid only.0.13.0
triggerWidth'auto' | 'full'—Date range trigger width. FormDateRangePicker only.0.13.0
monthsShown / calendarPropsnumber | CalendarProps—Multi-month and DayPicker pass-through controls for FormDateRangePicker, including defaultMonth, captionLayout, and numberOfMonths.0.13.0
accept / maxFiles / maxSize / validatorDropzone props—File acceptance and validation controls. FormDropzone only.0.13.0
renderField(props: { index, total, remove }) => ReactNode—Render function for each array item. FormFieldArray only.0.6.0
selector(state: FormState) => TSelected—State selector function. FormSubscribe only.0.6.0
listeners{ onChange?, onBlur? }—Side-effect listeners for dependent fields. FormListenEffect only.0.6.0
submitLabelstring'Submit'Submit button label. FormActions only.0.6.0
showResetbooleantrueShow reset button. FormActions only.0.6.0
classNamestring—Additional Tailwind classes on the FormItem wrapper.0.6.0

Import

import { useForm, FormInput, FormSelect, FormActions } from '@mihcm/ui/Form';