UNPKG

@kvaser/canking-api

Version:

CanKing API to communicate with the CanKing service using Node.js.

50 lines (49 loc) 1.67 kB
/** * This module includes a checkbox UI control. * * To be able to use these controls the CanKingDataProvider component must be present in the * component tree above your component. Normally the CanKingDataProvider is added * at the root of the component tree. * * @packageDocumentation */ import { JSX } from 'react'; import { SxProps, Theme, TypographyProps } from '@mui/material'; /** * Properties of the CheckboxControl React component. */ export interface CheckboxControlProps { /** The component id. */ id?: string; /** A text label to be displayed. */ label: string; /** The current check state. */ checked: boolean; /** * Callback that is called when the checked state has changed. * @param checked - The new checked state. */ onChange: (checked: boolean) => void; /** Set to true to disable this control. */ disabled?: boolean; /** The optional size, defaults to 'small'. */ size?: 'small' | 'medium'; /** Optional sx props. */ sx?: SxProps<Theme>; /** * Props applied to the Typography wrapper of the passed label. * This is unused if disableTypography is true. */ typography?: TypographyProps; /** * If `true`, the label is rendered as it is passed without an additional typography node. */ disableTypography?: boolean; } /** * Creates a checkbox UI control. * @param props - Component properties. * @returns The CheckboxControl React component. */ declare function CheckboxControl({ id, label, checked, onChange, disabled, size, sx, typography, disableTypography, }: CheckboxControlProps): JSX.Element; export default CheckboxControl;