Check da box
This commit is contained in:
parent
ca09889f3b
commit
5c33725869
|
|
@ -82,24 +82,23 @@ export function CheckBox({
|
|||
label,
|
||||
title,
|
||||
className,
|
||||
name,
|
||||
id,
|
||||
children,
|
||||
...props
|
||||
}) {
|
||||
|
||||
const [field, meta, helpers] = useField(props);
|
||||
|
||||
return (
|
||||
<div tw="my-1 flex text-secondary" className={className}>
|
||||
<input
|
||||
{...props}
|
||||
{...field}
|
||||
type="checkbox"
|
||||
name={name ?? title}
|
||||
id={id ?? name ?? title}
|
||||
tw="checked:bg-accent w-6 h-6 rounded-full bg-secondary border-secondary border-4 appearance-none cursor-pointer "
|
||||
/>
|
||||
{title != null ? (
|
||||
<label
|
||||
{...label}
|
||||
htmlFor={id ?? name ?? title}
|
||||
css={[tw`block font-bold px-2`, label?.css]}
|
||||
>
|
||||
{title}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user