@payfit/unity-components
Version:
33 lines (32 loc) • 1.25 kB
TypeScript
import { Slot } from '@radix-ui/react-slot';
export type FormControlProps = React.ComponentProps<typeof Slot>;
/**
* FormControl is a wrapper component that connects input components to form state within a FormField.
* It handles accessibility concerns like proper ARIA attributes and focus states.
*
* This component is required when building custom form fields - it must wrap the actual input element
* to connect it properly to the form state.
* @example
* ```tsx
* import { FormControl, FormField, Input } from '@payfit/unity-components'
*
* function MyFormField() {
* return (
* <FormField name="email">
* <FormControl>
* <Input />
* </FormControl>
* </FormField>
* )
* }
* ```
* @remarks
* [API & Docs](https://unity-components.payfit.io/?path=/docs/forms-formfield-formcontrol--docs)
* @deprecated React Hook Form components are deprecated. Use the TanStack Form version instead.
* @see Storybook docs: https://unity-components.payfit.io/?path=/docs/forms-introduction-to-unity-forms--docs
*/
declare function FormControl({ ...props }: FormControlProps): import("react/jsx-runtime").JSX.Element;
declare namespace FormControl {
var displayName: string;
}
export { FormControl };