feat(ui): add className prop to Checkbox component to allow custom styling

This commit is contained in:
Andrew Davis 2025-04-02 23:28:55 +10:00
parent 7cac28926a
commit c65d222ee0
No known key found for this signature in database
GPG Key ID: 30AB5B89A109D044
1 changed files with 2 additions and 2 deletions

View File

@ -37,11 +37,11 @@ type CheckBoxProps = {
} & Omit<JSX.IntrinsicElements["input"], "size" | "type">; } & Omit<JSX.IntrinsicElements["input"], "size" | "type">;
const Checkbox = forwardRef<HTMLInputElement, CheckBoxProps>(function Checkbox( const Checkbox = forwardRef<HTMLInputElement, CheckBoxProps>(function Checkbox(
{ size = "MD", ...props }, { size = "MD", className, ...props },
ref, ref,
) { ) {
const classes = checkboxVariants({ size }); const classes = checkboxVariants({ size });
return <input ref={ref} {...props} type="checkbox" className={classes} />; return <input ref={ref} {...props} type="checkbox" className={clsx(classes, className)} />;
}); });
Checkbox.displayName = "Checkbox"; Checkbox.displayName = "Checkbox";