Checkbox
Checkbox for forms
// importing Checkbox components
import { Checkbox, Checkbox1 } from "@wigxel/react-components/lib/form";// First variation of the Checkbox component
<Checkbox name="rice" value="rice" />
<span> Rice</span>
// Second variation of the Checkbox component
<Checkbox1 name="rice" value="rice" />
<span> Beans</span><Radio.Pill>
<Checkbox name="rice" value="rice" />
<span> Rice</span>
</Radio.Pill>import { useForm } from "react-hook-form";
export const Form = () => {
const form = useForm({...});
return(
<form onSubmit={form.handleClick(...)}>
<Radio.Pill>
<Checkbox ref={form.register} name="rice" value="rice" />
<span> Rice</span>
</Radio.Pill>
<Radio.Pill>
<Checkbox1 ref={form.register} name="beans" value="beans" />
<span> Beans</span>
</Radio.Pill>
</form>
)
}; Last updated