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