UNPKG

@payfit/unity-components

Version:

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