UNPKG

@yamada-ui/checkbox

Version:

Yamada UI checkbox component

64 lines (61 loc) 2.06 kB
import { HTMLUIProps, ThemeProps, ComponentArgs } from '@yamada-ui/core'; import { Merge } from '@yamada-ui/utils'; import { ReactNode, ReactElement, InputHTMLAttributes, RefAttributes } from 'react'; import { CheckboxCardAddonProps } from './checkbox-card-addon.js'; import { CheckboxCardDescriptionProps } from './checkbox-card-description.js'; import { CheckboxCardLabelProps } from './checkbox-card-label.js'; import { UseCheckboxProps } from './use-checkbox.js'; import '@yamada-ui/form-control'; interface CheckboxCardOptions { /** * The addon of the checkbox card. */ addon?: ReactNode; /** * The body of the checkbox card. */ description?: ReactNode; /** * The label of the checkbox card. */ label?: ReactNode; /** * If `true`, the icon will be displayed. * * @default true */ withIcon?: boolean; /** * Props for the footer of the checkbox card. */ addonProps?: CheckboxCardAddonProps; /** * Props for the description of the checkbox card. */ descriptionProps?: CheckboxCardDescriptionProps; /** * Props for the icon of the checkbox card. */ iconProps?: { children: ReactElement; } & Omit<HTMLUIProps, "children">; /** * Props for input element. */ inputProps?: InputHTMLAttributes<HTMLInputElement>; /** * Props for the label of the checkbox card. */ labelProps?: CheckboxCardLabelProps; } interface CheckboxCardProps<Y extends number | string = string> extends Merge<HTMLUIProps<"label">, UseCheckboxProps<Y>>, ThemeProps<"CheckboxCard">, CheckboxCardOptions { } /** * `CheckboxCard` is a component used for allowing users to select multiple values from multiple options. * * @see Docs https://yamada-ui.com/components/forms/checkbox-card */ declare const CheckboxCard: { <Y extends number | string = string>(props: CheckboxCardProps<Y> & RefAttributes<HTMLInputElement>): ReactElement; } & ComponentArgs; export { CheckboxCard, type CheckboxCardProps };