@cimpress/react-components
Version:
React components to support the MCP styleguide
26 lines • 1.44 kB
TypeScript
import React, { ReactNode } from 'react';
import { PublicComponentProps } from '../types';
type InputBaseProps = Omit<React.InputHTMLAttributes<HTMLInputElement>, 'onChange'>;
export interface CheckboxProps<Payload = any> extends InputBaseProps, PublicComponentProps {
/** Determines whether or not the checkbox is checked. */
checked?: boolean;
/** Marks the checkbox as disabled. */
disabled?: boolean;
/** ID prop for the input field. */
id?: string;
/** Determines whether or not the checkbox is in an indeterminate state. If checked is true, it will override indeterminate. */
indeterminate?: boolean;
/** Label for the checkbox. */
label: ReactNode;
/** Callback function that is fired when the checked value changes. */
onChange?: (e: React.ChangeEvent<HTMLInputElement>, payload: Payload) => void;
/** Anything you want passed in to the onChange handler as the second argument. */
payload?: Payload;
/** If set to true, the checkbox icon is rendered with white background, otherwise - transparent. */
whiteBackground?: boolean;
/** If set to true, checkbox will display in a row instead of being stacked */
inline?: boolean;
}
export declare const Checkbox: ({ id, indeterminate, onChange, className, style, label, payload, whiteBackground, onBlur, onFocus, inline, ...rest }: CheckboxProps) => React.JSX.Element;
export {};
//# sourceMappingURL=Checkbox.d.ts.map