Replies: 9 comments 4 replies
-
I second that! Checkbox components are just as essential |
Beta Was this translation helpful? Give feedback.
-
I wholeheartedly agree! |
Beta Was this translation helpful? Give feedback.
-
That's missing. Good idea. Do you know any workaround at this moment? |
Beta Was this translation helpful? Give feedback.
-
it is a must have component in lib |
Beta Was this translation helpful? Give feedback.
-
up for this. haven't seen this component yet. any workaround? |
Beta Was this translation helpful? Give feedback.
-
Hi, @Svish I just make workaround with the radiogroup and turns it into checkbox Note: this is not a good solustion, please use with caution and read what @Svish said below.
|
Beta Was this translation helpful? Give feedback.
-
Could we get any sort of update on this? Very strange that this isn't a thing. |
Beta Was this translation helpful? Give feedback.
-
Until we have a proper component, as For example, using heroicons' import { useState } from 'react';
import { Switch } from '@headlessui/react';
import { CheckIcon } from '@heroicons/react/24/outline';
export function Checkbox({ label }: { label: string }) {
const [enabled, setEnabled] = useState(false);
return (
<Switch.Group>
<div className="flex items-center gap-1">
<Switch
checked={enabled}
onChange={setEnabled}
className="inline-flex h-5 w-5 rounded border border-theme-8 bg-theme-7 text-theme-2"
>
<CheckIcon className={enabled ? 'opacity-100' : 'opacity-0'} />
</Switch>
<Switch.Label>{label}</Switch.Label>
</div>
</Switch.Group>
);
} |
Beta Was this translation helpful? Give feedback.
-
Looks like it's done! https://tailwindcss.com/blog/headless-ui-v2#new-checkbox-component |
Beta Was this translation helpful? Give feedback.
-
Was happy to see the library includes the Radio Group, but for this library to be properly useful, it should really also include the other basics of form components, like the checkbox and checkbox group. 👍
Beta Was this translation helpful? Give feedback.
All reactions