UNPKG

@styleless-ui/react

Version:

Completely unstyled, headless and accessible React UI components.

47 lines (46 loc) 1.36 kB
import * as React from "react"; import type { MergeElementProps } from "../../typings"; interface OwnProps { /** * The content of the component. */ children?: React.ReactNode | ((ctx: { active: boolean; disabled: boolean; selected: boolean; }) => React.ReactNode); /** * The className applied to the component. */ className?: string | ((ctx: { active: boolean; disabled: boolean; selected: boolean; }) => string); /** * If `true`, the item will be checked. * @default false */ checked?: boolean; /** * The default state of `checked`. Use when the component is not controlled. * @default false */ defaultChecked?: boolean; /** * If `true`, the item will be disabled. * @default false */ disabled?: boolean; /** * The Callback is fired when the state changes. */ onCheckChange?: (checked: boolean) => void; /** * The Callback is fired when the item is selected. */ onSelect?: (event: React.MouseEvent<HTMLDivElement> | React.KeyboardEvent<HTMLDivElement>) => void; } export type Props = Omit<MergeElementProps<"div", OwnProps>, "defaultValue">; declare const MenuCheckItem: (props: Props, ref: React.Ref<HTMLDivElement>) => JSX.Element; export default MenuCheckItem;