reablocks
Version:
Component library for React
73 lines (71 loc) • 1.76 kB
TypeScript
import { CheckboxTheme } from './CheckboxTheme';
import { default as React, FC, LegacyRef, ReactNode } from 'react';
export interface CheckboxProps {
/**
* Whether the checkbox is checked or not.
*/
checked?: boolean;
/**
* Whether the checkbox is in an intermediate state or not.
*/
intermediate?: boolean;
/**
* Label for the checkbox.
*/
label?: string | ReactNode;
/**
* Label position of checkbox.
*/
labelPosition?: 'start' | 'end';
/**
* Whether the checkbox is disabled or not.
*/
disabled?: boolean;
/**
* Size of the checkbox.
*/
size?: 'small' | 'medium' | 'large' | string;
/**
* Additional class names to apply to the checkbox.
*/
className?: string;
/**
* Additional class names to apply to the container.
*/
containerClassName?: string;
/**
* Additional class names to apply to the label.
*/
labelClassName?: string;
/**
* Custom svg path for border.
*/
borderPath?: string;
/**
* Custom svg path for checked state.
*/
checkedPath?: string;
/**
* Custom svg path for intermediate state.
*/
intermediatePath?: string;
/**
* Event handler for when the checkbox is changed.
*/
onChange?: (value: boolean) => void;
/**
* Event handler for when the checkbox is blurred.
*/
onBlur?: (event: React.FocusEvent<HTMLDivElement>) => void;
/**
* Theme for the Checkbox.
*/
theme?: CheckboxTheme;
}
export interface CheckboxRef {
/**
* The ref to the checkbox element.
*/
ref?: LegacyRef<HTMLDivElement>;
}
export declare const Checkbox: FC<CheckboxProps & CheckboxRef>;