react-elegant-ui
Version:
Elegant UI components, made by BEM best practices for react
39 lines (38 loc) • 1.14 kB
TypeScript
import { FC, ReactNode, Ref } from 'react';
import { IComponentHTMLElement, IComponentWithAddonNodes } from '../../types/IComponent';
import './Checkbox.css';
export declare const cnCheckbox: import("@bem-react/classname").ClassNameFormatter;
export interface ICheckboxProps extends IComponentHTMLElement<HTMLDivElement>, IComponentWithAddonNodes {
/**
* Checkbox state
*/
checked?: boolean;
/**
* State setter
*/
setChecked?: (state: boolean) => void;
/**
* Set unavailable state
*/
disabled?: boolean;
/**
* Visually make checkbox state is indeterminate. Does not affect to real state from prop `checked`
*
* Useful to show state of checkbox tree, when sub items selected partially
*/
indeterminate?: boolean;
/**
* Focus on element after loading page
*/
autoFocus?: boolean;
/**
* Checkbox text
*/
label?: ReactNode;
labelRef?: Ref<HTMLLabelElement>;
/**
* Forward props to control
*/
controlProps?: IComponentHTMLElement<HTMLInputElement>;
}
export declare const Checkbox: FC<ICheckboxProps>;