Seed: saas template (34 files)
This commit is contained in:
@@ -0,0 +1,21 @@
|
|||||||
|
import * as React from "react";
|
||||||
|
import { cn } from "@/lib/utils";
|
||||||
|
|
||||||
|
export interface CheckboxProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "onChange"> {
|
||||||
|
onCheckedChange?: (checked: boolean) => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const Checkbox = React.forwardRef<HTMLInputElement, CheckboxProps>(
|
||||||
|
({ className, onCheckedChange, ...props }, ref) => (
|
||||||
|
<input
|
||||||
|
ref={ref}
|
||||||
|
type="checkbox"
|
||||||
|
onChange={(e) => onCheckedChange?.(e.target.checked)}
|
||||||
|
className={cn("h-4 w-4 rounded border-slate-300 accent-indigo-600", className)}
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
);
|
||||||
|
Checkbox.displayName = "Checkbox";
|
||||||
|
|
||||||
|
export default Checkbox;
|
||||||
Reference in New Issue
Block a user