vcc-ui
Version:
A React library for building user interfaces at Volvo Cars
35 lines (34 loc) • 1.68 kB
TypeScript
import React, { ChangeEventHandler, ReactNode } from 'react';
export type CheckboxProps = {
/** Renders a label inside the input. */
name?: string;
/** Accessible description of the outcome of interaction with the checkbox */
label: ReactNode;
/** Renders a description text underneath the input. */
description?: string;
/** Renders a red error message for validation underneath the input. */
errorMessage?: string;
onChange: ChangeEventHandler<HTMLInputElement>;
isValid?: boolean;
checked?: boolean;
/** Superfluous property returned from useField. Can be removed at a later date. */
loading?: boolean;
} & React.ComponentPropsWithoutRef<'input'>;
/**
* @deprecated Use `import { Checkbox } from '@volvo-cars/react-forms'` instead. See [Checkbox](https://developer.volvocars.com/design-system/web/?path=/docs/components-forms-checkbox--docs)
*/
export declare const Checkbox: React.ForwardRefExoticComponent<{
/** Renders a label inside the input. */
name?: string;
/** Accessible description of the outcome of interaction with the checkbox */
label: ReactNode;
/** Renders a description text underneath the input. */
description?: string;
/** Renders a red error message for validation underneath the input. */
errorMessage?: string;
onChange: ChangeEventHandler<HTMLInputElement>;
isValid?: boolean;
checked?: boolean;
/** Superfluous property returned from useField. Can be removed at a later date. */
loading?: boolean;
} & Omit<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>>;