@massds/mayflower-react
Version:
React versions of Mayflower design system UI components
56 lines (55 loc) • 1.83 kB
TypeScript
export interface CheckBoxProps {
icon?: {
name?: string;
title?: string;
width?: string | number;
height?: string | number;
className?: string;
fill?: string;
};
label?: string;
disabled?: boolean;
required?: boolean;
id?: string;
value?: string;
onChange?(...args: unknown[]): unknown;
onKeyDown?(...args: unknown[]): unknown;
defaultValue?: string;
tabIndex?: number;
role?: string;
}
export interface InputCheckBoxProps {
/** Id of the input that the label is tied to and the value is associated with in the formContext. */
id?: string;
/** Value of the input that is associated with in the formContext. (required) */
value: string;
/** Default input value. */
defaultValue?: string;
/** Tab index for the checkbox input. */
tabIndex?: number;
/** Label for the checkbox input. */
label?: string;
/** Icon that renders after the label. */
icon?: {
title?: string;
width?: string | number;
height?: string | number;
className?: string;
fill?: string;
};
/** Custom callback function called when input checked value is changed. */
onChange?(...args: unknown[]): unknown;
/** Custom callback function called when a keyboard action is triggered. */
onKeyDown?(...args: unknown[]): unknown;
/** Whether the input is disabled. */
disabled?: boolean;
/** Whether checked is required. */
required?: boolean;
/** The label text for the input field, can be a string or a component */
labelText: string | object;
/** Pass array of classNames to input wrapper div */
classes?: string[];
role?: string;
}
declare const InputCheckBox: (props: InputCheckBoxProps) => any;
export default InputCheckBox;