// @flow import * as React from "react"; import cn from "classnames"; import Form from "./"; import type { FormEvents, FocusEvents } from "../../"; export type Props = {| ...FormEvents, ...FocusEvents, +className?: string, /** * Wrap the checkbox with a label */ +label?: string, +value?: string | number | boolean, +name?: string, +checked?: boolean, +disabled?: boolean, +readOnly?: boolean, +isInline?: boolean, |}; function FormCheckbox({ className, label, value, name, checked, disabled, readOnly, onChange, onFocus, onBlur, isInline, }: Props): React.Node { const classes = cn( "custom-control custom-checkbox", { "custom-control-inline": isInline }, className ); const inputComponent = ( ); return label ? ( ) : ( inputComponent ); } FormCheckbox.displayName = "Form.Checkbox"; /** @component */ export default FormCheckbox;