UNPKG

@dnanpm/styleguide

Version:

DNA Styleguide repository provides the set of components and theme object used in various DNA projects.

59 lines (58 loc) 1.23 kB
import React from 'react'; interface Props { /** * Unique ID for the input element */ id: string; /** * Name of the input element */ name?: string; /** * Text of the label shown next to checkbox */ label: string; /** * Default value of input element * * @default undefined */ value?: boolean; /** * On checkbox change callback */ onChange?: (value: boolean) => void; /** * Allows to disable the checkbox * * @default false */ disabled?: boolean; /** * Allows to set checkbox as mandatory * * @default false */ required?: boolean; /** * Allows to set checkbox to error state * * @default false */ error?: boolean; /** * Text of the error message when checkbox is in error state */ errorMessage?: string; /** * Allows to pass a custom className */ className?: string; /** * Allows to pass testid string for testing purposes */ 'data-testid'?: string; } declare const Checkbox: ({ "data-testid": dataTestId, ...props }: Props) => React.JSX.Element; /** @component */ export default Checkbox;