liber-salti
Version:
Saltí - Liber Design System
71 lines (70 loc) • 2.14 kB
TypeScript
/// <reference types="react" />
import { CheckboxClassKey } from '@mui/material/Checkbox';
import { ClassNameMap } from '@mui/styles';
export interface CheckboxProps {
/**
* If `true`, the component is checked.
*/
checked?: boolean;
/**
* The value of the component. The DOM API casts this to a string.
* The browser uses "on" as the default value.
*/
value?: unknown;
/**
* The size of the checkbox.
* `small` is equivalent to the dense checkbox styling.
*/
size?: 'small' | 'medium';
/**
* If `true`, the checkbox will be disabled.
*/
disabled?: boolean;
/**
* If `true`, the component appears indeterminate.
* This does not set the native input element to indeterminate due
* to inconsistent behavior across browsers.
* However, we set a `data-indeterminate` attribute on the input.
*/
indeterminate?: boolean;
/**
* [Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Attributes)
* applied to the `input` element.
*/
inputProps?: React.InputHTMLAttributes<HTMLInputElement>;
/**
* Pass a ref to the `input` element.
*/
inputRef?: React.Ref<HTMLInputElement>;
/**
* Callback fired when the state is changed.
*
* @param {object} event The event source of the callback.
* You can pull out the new checked state by accessing `event.target.checked` (boolean).
*/
onChange?: (event: React.ChangeEvent<HTMLInputElement>, checked: boolean) => void;
/**
* If `true`, the `input` element will be required.
*/
required?: boolean;
/**
* Whether the checkbox will start checked or not
*/
defaultChecked?: boolean;
/**
* The id of the `input` element.
*/
id?: string;
/**
* Name of the component.
*/
name?: string;
/**
* Overridabled classes
*/
classes?: Partial<ClassNameMap<CheckboxClassKey>>;
/**
* Disable ripple effect
*/
disableRipple?: boolean;
}