UNPKG

jobiqo-cl

Version:

[![CircleCI](https://circleci.com/gh/jobiqo/jobiqo-cl.svg?style=svg&circle-token=5a24efa5b8bbc4879276123e77d0d3f35ca7144c)](https://circleci.com/gh/jobiqo/jobiqo-cl)

48 lines (47 loc) 1.33 kB
/** * @file index.tsx * * @fileoverview Checkbox component. Renders a checkbox together with a label. */ import React from 'react'; export interface CheckboxProps extends React.InputHTMLAttributes<HTMLInputElement> { /** * The label for the checkbox, will show up next to the input. * * @default "" */ label: string; /** * Marks if a field is in an error state. * * @default false */ error?: boolean; /** * The checkbox style. * The color of the checkmark will change depending on the style. * * @default "primary" */ checkboxStyle?: 'primary' | 'secondary'; /** * The theme props is passed automatically to the component via styled components. * * @default "null" */ theme?: any; } /** * A checkbox is an input of type checkbox. * Will have a label next to it and styling will come from the theme property. * The component inherits props from the "InputHTMLAttributes" so any property for a checkbox can be used with this component. */ export declare const Checkbox: { ({ id, checkboxStyle, label, onChange, error, required, disabled, ...props }: CheckboxProps): JSX.Element; defaultProps: { label: string; checkboxStyle: string; theme: any; }; }; export default Checkbox;