@payfit/unity-components
Version:
29 lines (28 loc) • 957 B
TypeScript
import { CheckboxProps as CoreCheckboxProps } from '../../../../core/components/checkbox/Checkbox.js';
export type CheckboxProps = Omit<CoreCheckboxProps, 'name' | 'selected' | 'defaultSelected' | 'isInvalid'>;
/**
* `Checkbox` is a controlled checkbox wired to the Form field context.
* It is based on the Unity `Checkbox` component.
*
* Value, invalid state, and events are driven by the field API.
*
* Example:
* ```tsx
* function ExampleField() {
* const form = useUnityForm<{ acceptTerms: boolean }>({ validators: {} })
* return (
* <form>
* <form.AppField name="acceptTerms">
* {() => (
* <Checkbox>
* I accept the terms and conditions
* </Checkbox>
* )}
* </form.AppField>
* </form>
* )
* }
* ```
*/
declare const Checkbox: import('react').ForwardRefExoticComponent<CheckboxProps & import('react').RefAttributes<HTMLLabelElement>>;
export { Checkbox };