-
-
Notifications
You must be signed in to change notification settings - Fork 67
/
checkbox.tsx
34 lines (31 loc) · 1.12 KB
/
checkbox.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
import { CheckIcon } from "@radix-ui/react-icons";
import * as LabelPrimitive from "@radix-ui/react-label";
import { clsx } from "clsx";
import React from "react";
const Checkbox = () => {
return (
<form className="flex items-center">
<CheckboxPrimitive.Root
id="c1"
defaultChecked
className={clsx(
"flex h-5 w-5 items-center justify-center rounded",
"radix-state-checked:bg-purple-600 radix-state-unchecked:bg-gray-100 dark:radix-state-unchecked:bg-gray-900",
"focus:outline-none focus-visible:ring focus-visible:ring-purple-500 focus-visible:ring-opacity-75"
)}
>
<CheckboxPrimitive.Indicator>
<CheckIcon className="h-4 w-4 self-center text-white" />
</CheckboxPrimitive.Indicator>
</CheckboxPrimitive.Root>
<LabelPrimitive.Label
htmlFor="c1"
className="ml-3 select-none text-sm font-medium text-gray-900 dark:text-gray-100"
>
Accept terms and conditions
</LabelPrimitive.Label>
</form>
);
};
export { Checkbox };