- Spec files
npm-react-aria
Describes: pkg:npm/react-aria@3.43.x
- Description
- Comprehensive library of unstyled React hooks providing accessible UI primitives with full WAI-ARIA compliance and internationalization support.
- Author
- tessl
- Last updated
form-controls.md docs/
1# Form Controls23Interactive form elements with full accessibility support including labels, validation, error messaging, and keyboard navigation. All form controls provide ARIA attributes, label association, and proper focus management.45## Capabilities67### Button89Provides button behavior including press handling, keyboard navigation, and accessibility attributes.1011```typescript { .api }12/**13* Provides button behavior and accessibility14* @param props - Button configuration options15* @param ref - Ref to the button element16* @returns Button props and state17*/18function useButton(props: AriaButtonProps, ref: RefObject<Element>): ButtonAria;1920interface AriaButtonProps {21/** Whether the button is disabled */22isDisabled?: boolean;23/** Handler called when the button is pressed */24onPress?: (e: PressEvent) => void;25/** Handler called when a press interaction starts */26onPressStart?: (e: PressEvent) => void;27/** Handler called when a press interaction ends */28onPressEnd?: (e: PressEvent) => void;29/** Handler called when the press is released over the target */30onPressUp?: (e: PressEvent) => void;31/** Handler called when a press interaction changes */32onPressChange?: (isPressed: boolean) => void;33/** Whether press events should be disabled */34preventFocusOnPress?: boolean;35/** Whether the button should receive focus on press (mobile) */36shouldCancelOnPointerExit?: boolean;37/** Text description of the button for accessibility */38'aria-label'?: string;39/** ID of element that labels the button */40'aria-labelledby'?: string;41/** ID of element that describes the button */42'aria-describedby'?: string;43}4445interface ButtonAria {46/** Props to spread on the button element */47buttonProps: DOMAttributes<Element>;48/** Whether the button is currently pressed */49isPressed: boolean;50}51```5253**Usage Example:**5455```typescript56import { useButton } from "react-aria";5758function Button(props) {59let ref = useRef();60let { buttonProps, isPressed } = useButton(props, ref);6162return (63<button64{...buttonProps}65ref={ref}66className={`button ${isPressed ? 'pressed' : ''}`}67>68{props.children}69</button>70);71}72```7374### Toggle Button7576Provides toggle button behavior with pressed state management.7778```typescript { .api }79/**80* Provides toggle button behavior and accessibility81* @param props - Toggle button configuration82* @param ref - Ref to the button element83* @returns Toggle button props and state84*/85function useToggleButton(props: AriaToggleButtonProps, ref: RefObject<Element>): ButtonAria;8687interface AriaToggleButtonProps extends AriaButtonProps {88/** Whether the button is selected (pressed) */89isSelected?: boolean;90/** Handler called when the button's selection state changes */91onChange?: (isSelected: boolean) => void;92}93```9495### Toggle Button Group9697Manages a group of toggle buttons with optional single or multiple selection.9899```typescript { .api }100/**101* Provides toggle button group behavior102* @param props - Toggle button group configuration103* @param ref - Ref to the group element104* @returns Toggle button group props105*/106function useToggleButtonGroup(props: AriaToggleButtonGroupProps, ref: RefObject<Element>): ToggleButtonGroupAria;107108/**109* Provides individual toggle button behavior within a group110* @param props - Toggle button item configuration111* @param state - Toggle button group state112* @param ref - Ref to the button element113* @returns Toggle button item props114*/115function useToggleButtonGroupItem(props: AriaToggleButtonGroupItemProps, state: ToggleButtonGroupState, ref: RefObject<Element>): ButtonAria;116117interface AriaToggleButtonGroupProps {118/** Whether multiple buttons can be selected */119selectionMode?: 'single' | 'multiple';120/** Currently selected keys */121selectedKeys?: Iterable<Key>;122/** Default selected keys (uncontrolled) */123defaultSelectedKeys?: Iterable<Key>;124/** Handler called when selection changes */125onSelectionChange?: (keys: Set<Key>) => void;126/** Whether the group is disabled */127isDisabled?: boolean;128/** Orientation of the button group */129orientation?: Orientation;130}131```132133### Text Field134135Provides text input behavior with label association, validation, and accessibility.136137```typescript { .api }138/**139* Provides text field behavior and accessibility140* @param props - Text field configuration141* @param ref - Ref to the input element142* @returns Text field props and state143*/144function useTextField(props: AriaTextFieldProps, ref: RefObject<Element>): TextFieldAria;145146interface AriaTextFieldProps extends AriaTextFieldOptions {147/** Current value of the text field */148value?: string;149/** Default value (uncontrolled) */150defaultValue?: string;151/** Handler called when the value changes */152onChange?: (value: string) => void;153/** Placeholder text */154placeholder?: string;155/** Whether the field is disabled */156isDisabled?: boolean;157/** Whether the field is read-only */158isReadOnly?: boolean;159/** Whether the field is required */160isRequired?: boolean;161/** Type of validation state */162validationState?: 'valid' | 'invalid';163/** Auto-complete hint */164autoComplete?: string;165/** Maximum number of characters */166maxLength?: number;167/** Minimum number of characters */168minLength?: number;169/** Pattern for validation */170pattern?: string;171/** Input type */172type?: 'text' | 'search' | 'url' | 'tel' | 'email' | 'password';173/** Input mode */174inputMode?: 'none' | 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search';175}176177interface TextFieldAria {178/** Props for the text field label element */179labelProps: DOMAttributes<Element>;180/** Props for the input element */181inputProps: InputHTMLAttributes<HTMLInputElement>;182/** Props for the description element */183descriptionProps: DOMAttributes<Element>;184/** Props for the error message element */185errorMessageProps: DOMAttributes<Element>;186}187```188189### Checkbox190191Provides checkbox behavior with tri-state support and group management.192193```typescript { .api }194/**195* Provides checkbox behavior and accessibility196* @param props - Checkbox configuration197* @param ref - Ref to the input element198* @returns Checkbox props and state199*/200function useCheckbox(props: AriaCheckboxProps, ref: RefObject<Element>): CheckboxAria;201202interface AriaCheckboxProps {203/** Whether the checkbox is selected */204isSelected?: boolean;205/** Default selection state (uncontrolled) */206defaultSelected?: boolean;207/** Whether the checkbox is in an indeterminate state */208isIndeterminate?: boolean;209/** Whether the checkbox is disabled */210isDisabled?: boolean;211/** Whether the checkbox is read-only */212isReadOnly?: boolean;213/** Handler called when selection changes */214onChange?: (isSelected: boolean) => void;215/** Value of the checkbox */216value?: string;217/** Name of the checkbox (for forms) */218name?: string;219/** The checkbox's validation state */220validationState?: 'valid' | 'invalid';221/** Whether the checkbox is required */222isRequired?: boolean;223}224225interface CheckboxAria {226/** Props for the input element */227inputProps: InputHTMLAttributes<HTMLInputElement>;228/** Props for the label wrapper */229labelProps: LabelHTMLAttributes<HTMLLabelElement>;230/** Whether the checkbox is selected */231isSelected: boolean;232/** Whether the checkbox is in an invalid state */233isInvalid: boolean;234/** Whether the checkbox is disabled */235isDisabled: boolean;236/** Whether the checkbox is read-only */237isReadOnly: boolean;238/** Whether the checkbox is required */239isRequired: boolean;240/** Whether the checkbox is pressed */241isPressed: boolean;242}243```244245### Checkbox Group246247Manages a group of checkboxes with shared validation and labeling.248249```typescript { .api }250/**251* Provides checkbox group behavior252* @param props - Checkbox group configuration253* @param ref - Ref to the group element254* @returns Checkbox group props and state255*/256function useCheckboxGroup(props: AriaCheckboxGroupProps, ref: RefObject<Element>): CheckboxGroupAria;257258/**259* Provides individual checkbox behavior within a group260* @param props - Checkbox configuration within group261* @param state - Checkbox group state262* @param ref - Ref to the input element263* @returns Checkbox props for group item264*/265function useCheckboxGroupItem(props: AriaCheckboxGroupItemProps, state: CheckboxGroupState, ref: RefObject<Element>): CheckboxAria;266267interface AriaCheckboxGroupProps {268/** Currently selected values */269value?: string[];270/** Default selected values (uncontrolled) */271defaultValue?: string[];272/** Handler called when selection changes */273onChange?: (value: string[]) => void;274/** Whether the group is disabled */275isDisabled?: boolean;276/** Whether the group is read-only */277isReadOnly?: boolean;278/** Whether the group is required */279isRequired?: boolean;280/** Validation state of the group */281validationState?: 'valid' | 'invalid';282/** Name for the checkbox group */283name?: string;284/** Label for the group */285label?: ReactNode;286/** Description for the group */287description?: ReactNode;288/** Error message for the group */289errorMessage?: ReactNode;290}291```292293### Radio Button294295Provides radio button behavior with group management and keyboard navigation.296297```typescript { .api }298/**299* Provides radio button behavior and accessibility300* @param props - Radio button configuration301* @param ref - Ref to the input element302* @returns Radio button props and state303*/304function useRadio(props: AriaRadioProps, ref: RefObject<Element>): RadioAria;305306/**307* Provides radio group behavior308* @param props - Radio group configuration309* @param ref - Ref to the group element310* @returns Radio group props and state311*/312function useRadioGroup(props: AriaRadioGroupProps, ref: RefObject<Element>): RadioGroupAria;313314interface AriaRadioProps {315/** Value of the radio button */316value: string;317/** Whether the radio is disabled */318isDisabled?: boolean;319/** Whether the radio is required */320isRequired?: boolean;321/** Validation state */322validationState?: 'valid' | 'invalid';323}324325interface AriaRadioGroupProps {326/** Currently selected value */327value?: string;328/** Default selected value (uncontrolled) */329defaultValue?: string;330/** Handler called when selection changes */331onChange?: (value: string) => void;332/** Whether the group is disabled */333isDisabled?: boolean;334/** Whether the group is read-only */335isReadOnly?: boolean;336/** Whether the group is required */337isRequired?: boolean;338/** Validation state of the group */339validationState?: 'valid' | 'invalid';340/** Name for the radio group */341name?: string;342/** Label for the group */343label?: ReactNode;344/** Description for the group */345description?: ReactNode;346/** Error message for the group */347errorMessage?: ReactNode;348/** Orientation of the radio buttons */349orientation?: Orientation;350}351```352353### Switch354355Provides switch/toggle behavior similar to checkbox but with different semantics.356357```typescript { .api }358/**359* Provides switch behavior and accessibility360* @param props - Switch configuration361* @param ref - Ref to the input element362* @returns Switch props and state363*/364function useSwitch(props: AriaSwitchProps, ref: RefObject<Element>): SwitchAria;365366interface AriaSwitchProps {367/** Whether the switch is selected */368isSelected?: boolean;369/** Default selection state (uncontrolled) */370defaultSelected?: boolean;371/** Whether the switch is disabled */372isDisabled?: boolean;373/** Whether the switch is read-only */374isReadOnly?: boolean;375/** Handler called when selection changes */376onChange?: (isSelected: boolean) => void;377/** Value of the switch */378value?: string;379/** Name of the switch (for forms) */380name?: string;381/** The switch's validation state */382validationState?: 'valid' | 'invalid';383}384385interface SwitchAria {386/** Props for the input element */387inputProps: InputHTMLAttributes<HTMLInputElement>;388/** Props for the label wrapper */389labelProps: LabelHTMLAttributes<HTMLLabelElement>;390/** Whether the switch is selected */391isSelected: boolean;392/** Whether the switch is disabled */393isDisabled: boolean;394/** Whether the switch is read-only */395isReadOnly: boolean;396/** Whether the switch is pressed */397isPressed: boolean;398}399```400401### Number Field402403Provides numeric input with increment/decrement controls and validation.404405```typescript { .api }406/**407* Provides number field behavior and accessibility408* @param props - Number field configuration409* @param ref - Ref to the input element410* @returns Number field props and state411*/412function useNumberField(props: AriaNumberFieldProps, ref: RefObject<Element>): NumberFieldAria;413414interface AriaNumberFieldProps {415/** Current numeric value */416value?: number;417/** Default value (uncontrolled) */418defaultValue?: number;419/** Handler called when value changes */420onChange?: (value: number) => void;421/** Minimum allowed value */422minValue?: number;423/** Maximum allowed value */424maxValue?: number;425/** Amount to increment/decrement */426step?: number;427/** Whether the field is disabled */428isDisabled?: boolean;429/** Whether the field is read-only */430isReadOnly?: boolean;431/** Whether the field is required */432isRequired?: boolean;433/** Number formatting options */434formatOptions?: Intl.NumberFormatOptions;435/** Validation state */436validationState?: 'valid' | 'invalid';437}438439interface NumberFieldAria {440/** Props for the label element */441labelProps: DOMAttributes<Element>;442/** Props for the number input element */443inputProps: InputHTMLAttributes<HTMLInputElement>;444/** Props for the increment button */445incrementButtonProps: ButtonHTMLAttributes<HTMLButtonElement>;446/** Props for the decrement button */447decrementButtonProps: ButtonHTMLAttributes<HTMLButtonElement>;448/** Props for the description element */449descriptionProps: DOMAttributes<Element>;450/** Props for the error message element */451errorMessageProps: DOMAttributes<Element>;452}453```454455### Search Field456457Provides search input behavior with clear button and search semantics.458459```typescript { .api }460/**461* Provides search field behavior and accessibility462* @param props - Search field configuration463* @param ref - Ref to the input element464* @returns Search field props and state465*/466function useSearchField(props: AriaSearchFieldProps, ref: RefObject<Element>): SearchFieldAria;467468interface AriaSearchFieldProps extends AriaTextFieldProps {469/** Handler called when the search is submitted */470onSubmit?: (value: string) => void;471/** Handler called when the clear button is pressed */472onClear?: () => void;473}474475interface SearchFieldAria extends TextFieldAria {476/** Props for the clear button */477clearButtonProps: ButtonHTMLAttributes<HTMLButtonElement>;478}479```480481### Color Components482483Specialized form controls for color selection and editing with full accessibility support.484485```typescript { .api }486/**487* Provides color area behavior for 2D color selection488* @param props - Color area configuration489* @param ref - Ref to the color area element490* @returns Color area props and state491*/492function useColorArea(props: AriaColorAreaProps, ref: RefObject<Element>): ColorAreaAria;493494/**495* Provides color channel field behavior for individual color channels496* @param props - Color channel field configuration497* @param ref - Ref to the input element498* @returns Color channel field props and state499*/500function useColorChannelField(props: AriaColorChannelFieldProps, ref: RefObject<Element>): ColorChannelFieldAria;501502/**503* Provides color field behavior for color input504* @param props - Color field configuration505* @param ref - Ref to the input element506* @returns Color field props and state507*/508function useColorField(props: AriaColorFieldProps, ref: RefObject<Element>): ColorFieldAria;509510/**511* Provides color slider behavior for color channel sliders512* @param props - Color slider configuration513* @param ref - Ref to the slider element514* @returns Color slider props and state515*/516function useColorSlider(props: AriaColorSliderProps, ref: RefObject<Element>): ColorSliderAria;517518/**519* Provides color swatch behavior for color preview520* @param props - Color swatch configuration521* @param ref - Ref to the swatch element522* @returns Color swatch props and state523*/524function useColorSwatch(props: AriaColorSwatchProps, ref: RefObject<Element>): ColorSwatchAria;525526/**527* Provides color wheel behavior for hue selection528* @param props - Color wheel configuration529* @param ref - Ref to the color wheel element530* @returns Color wheel props and state531*/532function useColorWheel(props: AriaColorWheelOptions, ref: RefObject<Element>): ColorWheelAria;533534interface AriaColorAreaProps {535/** Current color value */536value?: Color;537/** Default color value (uncontrolled) */538defaultValue?: Color;539/** Handler called when color changes */540onChange?: (value: Color) => void;541/** Color space and channel for X axis */542xChannel: ColorChannel;543/** Color space and channel for Y axis */544yChannel: ColorChannel;545/** Whether the color area is disabled */546isDisabled?: boolean;547/** Step increment for keyboard navigation */548step?: number;549/** Page step increment for page up/down keys */550pageStep?: number;551}552553interface ColorAreaAria {554/** Props for the color area element */555colorAreaProps: DOMAttributes<Element>;556/** Props for the thumb element */557thumbProps: DOMAttributes<Element>;558/** Whether the thumb is being dragged */559isDragging: boolean;560}561562interface AriaColorChannelFieldProps {563/** Current color value */564value?: Color;565/** Default color value (uncontrolled) */566defaultValue?: Color;567/** Handler called when color changes */568onChange?: (value: Color) => void;569/** Color channel to edit */570channel: ColorChannel;571/** Color space */572colorSpace: ColorSpace;573/** Whether the field is disabled */574isDisabled?: boolean;575/** Whether the field is read-only */576isReadOnly?: boolean;577}578579interface ColorChannelFieldAria {580/** Props for the label element */581labelProps: DOMAttributes<Element>;582/** Props for the input element */583inputProps: InputHTMLAttributes<HTMLInputElement>;584/** Props for the increment button */585incrementButtonProps: ButtonHTMLAttributes<HTMLButtonElement>;586/** Props for the decrement button */587decrementButtonProps: ButtonHTMLAttributes<HTMLButtonElement>;588}589590interface AriaColorFieldProps {591/** Current color value */592value?: Color;593/** Default color value (uncontrolled) */594defaultValue?: Color;595/** Handler called when color changes */596onChange?: (value: Color) => void;597/** Whether the field is disabled */598isDisabled?: boolean;599/** Whether the field is read-only */600isReadOnly?: boolean;601/** Validation state */602validationState?: 'valid' | 'invalid';603}604605interface ColorFieldAria {606/** Props for the label element */607labelProps: DOMAttributes<Element>;608/** Props for the input element */609inputProps: InputHTMLAttributes<HTMLInputElement>;610}611612interface AriaColorSliderProps {613/** Current color value */614value?: Color;615/** Default color value (uncontrolled) */616defaultValue?: Color;617/** Handler called when color changes */618onChange?: (value: Color) => void;619/** Color channel to control */620channel: ColorChannel;621/** Color space */622colorSpace: ColorSpace;623/** Orientation of the slider */624orientation?: Orientation;625/** Whether the slider is disabled */626isDisabled?: boolean;627/** Step increment */628step?: number;629/** Page step increment */630pageStep?: number;631}632633interface ColorSliderAria {634/** Props for the slider container */635containerProps: DOMAttributes<Element>;636/** Props for the track element */637trackProps: DOMAttributes<Element>;638/** Props for the thumb element */639thumbProps: DOMAttributes<Element>;640/** Props for the output element */641outputProps: DOMAttributes<Element>;642/** Whether the thumb is being dragged */643isDragging: boolean;644}645646interface AriaColorSwatchProps {647/** Color to display */648color: Color;649/** Whether the swatch is disabled */650isDisabled?: boolean;651}652653interface ColorSwatchAria {654/** Props for the color swatch element */655colorSwatchProps: DOMAttributes<Element>;656}657658interface AriaColorWheelOptions {659/** Current color value */660value?: Color;661/** Default color value (uncontrolled) */662defaultValue?: Color;663/** Handler called when color changes */664onChange?: (value: Color) => void;665/** Whether the color wheel is disabled */666isDisabled?: boolean;667/** Step increment for keyboard navigation */668step?: number;669/** Page step increment for page up/down keys */670pageStep?: number;671}672673interface ColorWheelAria {674/** Props for the color wheel element */675colorWheelProps: DOMAttributes<Element>;676/** Props for the thumb element */677thumbProps: DOMAttributes<Element>;678/** Whether the thumb is being dragged */679isDragging: boolean;680}681682// Color-related types683type ColorChannel = 'hue' | 'saturation' | 'brightness' | 'lightness' | 'red' | 'green' | 'blue' | 'alpha';684type ColorSpace = 'rgb' | 'hsl' | 'hsb';685686interface Color {687/** Convert to hex string */688toString(format?: 'hex' | 'rgb' | 'hsl' | 'hsb'): string;689/** Get channel value */690getChannelValue(channel: ColorChannel): number;691/** Set channel value */692withChannelValue(channel: ColorChannel, value: number): Color;693/** Get color space */694getColorSpace(): ColorSpace;695/** Convert to color space */696toFormat(format: ColorSpace): Color;697}698```699700### Progress and Measurement701702Components for displaying progress, metrics, and value ranges.703704```typescript { .api }705/**706* Provides progress bar behavior and accessibility707* @param props - Progress bar configuration708* @param ref - Ref to the progress element709* @returns Progress bar props and state710*/711function useProgressBar(props: AriaProgressBarProps, ref: RefObject<Element>): ProgressBarAria;712713/**714* Provides meter behavior for displaying scalar values715* @param props - Meter configuration716* @param ref - Ref to the meter element717* @returns Meter props and state718*/719function useMeter(props: AriaMeterProps, ref: RefObject<Element>): MeterAria;720721/**722* Provides slider behavior for selecting values from a range723* @param props - Slider configuration724* @param ref - Ref to the slider element725* @returns Slider props and state726*/727function useSlider(props: AriaSliderProps, ref: RefObject<Element>): SliderAria;728729/**730* Provides slider thumb behavior for individual slider handles731* @param props - Slider thumb configuration732* @param state - Slider state733* @param ref - Ref to the thumb element734* @returns Slider thumb props and state735*/736function useSliderThumb(props: AriaSliderThumbProps, state: SliderState, ref: RefObject<Element>): SliderThumbAria;737738interface AriaProgressBarProps {739/** Current progress value */740value?: number;741/** Minimum value */742minValue?: number;743/** Maximum value */744maxValue?: number;745/** Whether progress is indeterminate */746isIndeterminate?: boolean;747/** Format function for value display */748formatOptions?: Intl.NumberFormatOptions;749/** Accessible label */750'aria-label'?: string;751/** ID of element that labels the progress bar */752'aria-labelledby'?: string;753}754755interface ProgressBarAria {756/** Props for the progress bar element */757progressBarProps: ProgressHTMLAttributes<HTMLProgressElement>;758/** Props for the label element */759labelProps: DOMAttributes<Element>;760}761762interface AriaMeterProps {763/** Current value */764value: number;765/** Minimum value */766minValue?: number;767/** Maximum value */768maxValue?: number;769/** Low threshold value */770low?: number;771/** High threshold value */772high?: number;773/** Optimum value */774optimum?: number;775/** Format function for value display */776formatOptions?: Intl.NumberFormatOptions;777}778779interface MeterAria {780/** Props for the meter element */781meterProps: MeterHTMLAttributes<HTMLMeterElement>;782/** Props for the label element */783labelProps: DOMAttributes<Element>;784}785786interface AriaSliderProps {787/** Current values */788value?: number | number[];789/** Default values (uncontrolled) */790defaultValue?: number | number[];791/** Handler called when values change */792onChange?: (value: number | number[]) => void;793/** Minimum value */794minValue?: number;795/** Maximum value */796maxValue?: number;797/** Step increment */798step?: number;799/** Page step increment */800pageStep?: number;801/** Orientation of the slider */802orientation?: Orientation;803/** Whether the slider is disabled */804isDisabled?: boolean;805/** Format function for value display */806formatOptions?: Intl.NumberFormatOptions;807/** Whether to show thumb labels */808showValueLabel?: boolean;809/** Function to get thumb label */810getThumbLabel?: (index: number) => string;811}812813interface SliderAria {814/** Props for the slider container */815containerProps: DOMAttributes<Element>;816/** Props for the track element */817trackProps: DOMAttributes<Element>;818/** Props for the label element */819labelProps: DOMAttributes<Element>;820/** Props for the output element */821outputProps: DOMAttributes<Element>;822}823824interface AriaSliderThumbProps {825/** Index of the thumb */826index: number;827/** Whether the thumb is disabled */828isDisabled?: boolean;829/** Name for form integration */830name?: string;831}832833interface SliderThumbAria {834/** Props for the thumb element */835thumbProps: DOMAttributes<Element>;836/** Props for the input element */837inputProps: InputHTMLAttributes<HTMLInputElement>;838/** Whether the thumb is being dragged */839isDragging: boolean;840/** Whether the thumb is focused */841isFocused: boolean;842/** Value of this thumb */843value: number;844}845846interface SliderState {847/** Array of thumb values */848values: number[];849/** Get value for thumb index */850getThumbValue(index: number): number;851/** Set value for thumb index */852setThumbValue(index: number, value: number): void;853/** Set dragging state for thumb */854setThumbDragging(index: number, dragging: boolean): void;855/** Whether thumb is being dragged */856isThumbDragging(index: number): boolean;857/** Get percent for value */858getValuePercent(value: number): number;859/** Get value for percent */860getPercentValue(percent: number): number;861/** Get display value */862getDisplayValue(value: number): string;863}864```865866### Labeling and Fields867868Utilities for form field labeling and accessibility.869870```typescript { .api }871/**872* Provides form field behavior and accessibility873* @param props - Field configuration874* @param ref - Ref to the field element875* @returns Field props and state876*/877function useField(props: AriaFieldProps, ref: RefObject<Element>): FieldAria;878879/**880* Provides label behavior and accessibility881* @param props - Label configuration882* @param ref - Ref to the label element883* @returns Label props884*/885function useLabel(props: LabelAriaProps, ref: RefObject<Element>): LabelAria;886887interface AriaFieldProps {888/** Label for the field */889label?: ReactNode;890/** Description for the field */891description?: ReactNode;892/** Error message for the field */893errorMessage?: ReactNode;894/** Whether the field is required */895isRequired?: boolean;896/** Whether the field is disabled */897isDisabled?: boolean;898/** Whether the field is read-only */899isReadOnly?: boolean;900/** Validation state */901validationState?: 'valid' | 'invalid';902/** Whether to include required asterisk in label */903necessityIndicator?: 'icon' | 'label';904}905906interface FieldAria {907/** Props for the field wrapper */908fieldProps: DOMAttributes<Element>;909/** Props for the label element */910labelProps: DOMAttributes<Element>;911/** Props for the description element */912descriptionProps: DOMAttributes<Element>;913/** Props for the error message element */914errorMessageProps: DOMAttributes<Element>;915}916917interface LabelAriaProps {918/** Label content */919children: ReactNode;920/** Target element for the label */921for?: string;922/** Element type to render */923elementType?: React.ElementType;924}925926interface LabelAria {927/** Props for the label element */928labelProps: LabelHTMLAttributes<HTMLLabelElement>;929}930```