import React from 'react'; import cn from 'classnames'; import Flex from './Flex'; import { useField } from 'react-final-form'; export default function CheckboxInput({ // visuals name, label, className, style, inline = false, white = false, disabled, }) { const { input, meta: { submitting, submitSucceeded }, } = useField(name, { type: 'checkbox' }); disabled = disabled || submitting || submitSucceeded; return ( {/* we totally hide the checkbox itself */} {/* and then display a prettier one in its stead */} {input.checked && '✓'} {label} ); }