UNPKG

@arolariu/components

Version:

🎨 70+ beautiful, accessible React components built on Base UI. TypeScript-first, CSS Modules styling, tree-shakeable, SSR-ready. Perfect for modern web apps, design systems & rapid prototyping. Zero config, maximum flexibility! ⚡

38 lines • 1.74 kB
import { Checkbox as BaseCheckbox } from "@base-ui/react/checkbox"; import * as React from "react"; type BaseCheckboxCheckedChange = NonNullable<React.ComponentPropsWithRef<typeof BaseCheckbox.Root>["onCheckedChange"]>; type CheckboxChangeEventDetails = Parameters<BaseCheckboxCheckedChange>[1]; /** * Props for the shared checkbox wrapper. */ interface CheckboxProps extends Omit<React.ComponentPropsWithRef<typeof BaseCheckbox.Root>, "checked" | "className" | "onCheckedChange"> { /** Additional CSS classes merged with the checkbox control styles. @default undefined */ className?: string; /** The current checked state, including support for the legacy `"indeterminate"` value. @default undefined */ checked?: boolean | "indeterminate"; /** Called whenever the checked state changes. @default undefined */ onCheckedChange?: (checked: boolean | "indeterminate", eventDetails: CheckboxChangeEventDetails) => void; } /** * Renders a selectable checkbox control with checked and indeterminate support. * * @remarks * - Renders a `<button>` element by default * - Built on {@link https://base-ui.com/react/components/checkbox | Base UI Checkbox} * - Supports the `render` prop for element composition * - Styling via CSS Modules with `--ac-*` custom properties * * @example Basic usage * ```tsx * <Checkbox checked /> * ``` * * @see {@link https://base-ui.com/react/components/checkbox | Base UI Documentation} */ declare const Checkbox: React.ForwardRefExoticComponent<Omit<CheckboxProps, "ref"> & React.RefAttributes<HTMLElement>>; declare namespace Checkbox { type Props = CheckboxProps; type State = BaseCheckbox.Root.State; } export { Checkbox }; //# sourceMappingURL=checkbox.d.ts.map