@yamada-ui/checkbox
Version:
Yamada UI checkbox component
29 lines (26 loc) • 1.25 kB
TypeScript
import { ThemeProps, ComponentArgs } from '@yamada-ui/core';
import { FormControlOptions } from '@yamada-ui/form-control';
import { FlexProps } from '@yamada-ui/layouts';
import { ReactNode, RefAttributes, ReactElement } from 'react';
import { CheckboxProps } from './checkbox.js';
import { UseCheckboxGroupProps } from './use-checkbox-group.js';
import '@yamada-ui/motion';
import '@yamada-ui/utils';
import './use-checkbox.js';
interface CheckboxItem<Y extends number | string = string> extends CheckboxProps<Y> {
label?: ReactNode;
}
interface CheckboxGroupSharedProps<Y extends number | string = string> extends Omit<FlexProps, "defaultValue" | "onChange">, UseCheckboxGroupProps<Y>, FormControlOptions {
}
interface CheckboxGroupProps<Y extends number | string = string> extends CheckboxGroupSharedProps<Y>, ThemeProps<"Checkbox"> {
/**
* If provided, generate checkboxes based on items.
*
* @default '[]'
*/
items?: CheckboxItem<Y>[];
}
declare const CheckboxGroup: {
<Y extends number | string = string>(props: CheckboxGroupProps<Y> & RefAttributes<HTMLDivElement>): ReactElement;
} & ComponentArgs;
export { CheckboxGroup, type CheckboxGroupProps, type CheckboxGroupSharedProps, type CheckboxItem };