@radix-ui/themes
Version:
[](https://radix-ui.com/themes)
43 lines (42 loc) • 2.63 kB
TypeScript
import * as React from 'react';
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
import { Primitive } from '@radix-ui/react-primitive';
import * as RovingFocusGroup from '@radix-ui/react-roving-focus';
import type * as Radix from '@radix-ui/react-primitive';
declare const createCheckboxGroupScope: import("@radix-ui/react-context").CreateScope;
type CheckboxGroupContextValue = {
name?: string;
required: boolean;
disabled: boolean;
value?: string[];
onItemCheck(value: string): void;
onItemUncheck(value: string): void;
};
type RovingFocusGroupProps = Radix.ComponentPropsWithoutRef<typeof RovingFocusGroup.Root>;
type PrimitiveDivProps = Radix.ComponentPropsWithoutRef<typeof Primitive.div>;
interface CheckboxGroupProps extends PrimitiveDivProps {
name?: CheckboxGroupContextValue['name'];
required?: Radix.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>['required'];
disabled?: Radix.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>['disabled'];
dir?: RovingFocusGroupProps['dir'];
orientation?: RovingFocusGroupProps['orientation'];
loop?: RovingFocusGroupProps['loop'];
defaultValue?: string[];
value?: CheckboxGroupContextValue['value'];
onValueChange?: (value: string[]) => void;
}
declare const CheckboxGroup: React.ForwardRefExoticComponent<CheckboxGroupProps & React.RefAttributes<HTMLDivElement>>;
type CheckboxProps = Radix.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>;
interface CheckboxGroupItemProps extends Omit<CheckboxProps, 'checked' | 'defaultChecked' | 'onCheckedChange' | 'name'> {
value: string;
}
declare const CheckboxGroupItem: React.ForwardRefExoticComponent<CheckboxGroupItemProps & React.RefAttributes<HTMLButtonElement>>;
type CheckboxIndicatorProps = Radix.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Indicator>;
interface CheckboxGroupIndicatorProps extends CheckboxIndicatorProps {
}
declare const CheckboxGroupIndicator: React.ForwardRefExoticComponent<CheckboxGroupIndicatorProps & React.RefAttributes<HTMLSpanElement>>;
declare const Root: React.ForwardRefExoticComponent<CheckboxGroupProps & React.RefAttributes<HTMLDivElement>>;
declare const Item: React.ForwardRefExoticComponent<CheckboxGroupItemProps & React.RefAttributes<HTMLButtonElement>>;
declare const Indicator: React.ForwardRefExoticComponent<CheckboxGroupIndicatorProps & React.RefAttributes<HTMLSpanElement>>;
export { createCheckboxGroupScope, CheckboxGroup, CheckboxGroupItem, CheckboxGroupIndicator, Root, Item, Indicator, };
export type { CheckboxGroupProps, CheckboxGroupItemProps, CheckboxGroupIndicatorProps };