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.

45 lines 1.56 kB
import * as React from 'react'; import type { FieldRoot } from "../field/root/FieldRoot.js"; import type { BaseUIComponentProps } from "../utils/types.js"; /** * Provides a shared state to a series of checkboxes. * * Documentation: [Base UI Checkbox Group](https://base-ui.com/react/components/checkbox-group) */ export declare const CheckboxGroup: React.ForwardRefExoticComponent<CheckboxGroup.Props & React.RefAttributes<HTMLDivElement>>; export declare namespace CheckboxGroup { interface State extends FieldRoot.State { /** * Whether the component should ignore user interaction. */ disabled: boolean; } interface Props extends BaseUIComponentProps<'div', State> { /** * Names of the checkboxes in the group that should be ticked. * * To render an uncontrolled checkbox group, use the `defaultValue` prop instead. */ value?: string[]; /** * Names of the checkboxes in the group that should be initially ticked. * * To render a controlled checkbox group, use the `value` prop instead. */ defaultValue?: string[]; /** * Event handler called when a checkbox in the group is ticked or unticked. * Provides the new value as an argument. */ onValueChange?: (value: string[], event: Event) => void; /** * Names of all checkboxes in the group. Use this when creating a parent checkbox. */ allValues?: string[]; /** * Whether the component should ignore user interaction. * @default false */ disabled?: boolean; } }