UNPKG

@base-ui-components/react

Version:

Base UI is a library of headless ('unstyled') React components and low-level hooks. You gain complete control over your app's CSS and accessibility features.

39 lines (38 loc) 1.39 kB
import * as React from 'react'; import type { FieldRoot } from '../../field/root/FieldRoot.js'; import type { BaseUIComponentProps } from '../../utils/types.js'; import { type UseCheckboxRoot } from './useCheckboxRoot.js'; /** * Represents the checkbox itself. * Renders a `<button>` element and a hidden `<input>` beside. * * Documentation: [Base UI Checkbox](https://base-ui.com/react/components/checkbox) */ declare const CheckboxRoot: React.ForwardRefExoticComponent<CheckboxRoot.Props & React.RefAttributes<HTMLButtonElement>>; declare namespace CheckboxRoot { interface State extends FieldRoot.State { /** * Whether the checkbox is currently ticked. */ checked: boolean; /** * Whether the component should ignore user interaction. */ disabled: boolean; /** * Whether the user should be unable to tick or untick the checkbox. */ readOnly: boolean; /** * Whether the user must tick the checkbox before submitting a form. */ required: boolean; /** * Whether the checkbox is in a mixed state: neither ticked, nor unticked. */ indeterminate: boolean; } interface Props extends UseCheckboxRoot.Parameters, Omit<BaseUIComponentProps<'button', State>, 'onChange' | 'value'> { } } export { CheckboxRoot };