Files
MattrixwvReactComponents/lib/component/input/checkbox/DarkCheckbox.tsx

31 lines
616 B
TypeScript

import type { CheckboxProps } from "$/types/InputTypes";
import clsx from "clsx";
import { forwardRef } from "react";
import MattrixwvCheckbox from "./MattrixwvCheckbox";
const DarkCheckbox = forwardRef<HTMLInputElement, CheckboxProps>(({
className,
box = true,
...props
}, ref) => {
return (
<MattrixwvCheckbox
className={clsx(
className,
{
"group-data-checked:bg-dark group-data-checked:stroke-light": box,
"group-data-checked:stroke-dark": !box
}
)}
box={box}
{...props}
ref={ref}
/>
);
});
DarkCheckbox.displayName = "DarkCheckbox";
export default DarkCheckbox;