mirror of
https://github.com/YspCoder/clawgo.git
synced 2026-04-13 16:47:34 +08:00
25 lines
554 B
TypeScript
25 lines
554 B
TypeScript
import React from 'react';
|
|
|
|
type CheckboxProps = Omit<React.InputHTMLAttributes<HTMLInputElement>, 'type'>;
|
|
|
|
function joinClasses(...values: Array<string | undefined | false>) {
|
|
return values.filter(Boolean).join(' ');
|
|
}
|
|
|
|
const Checkbox = React.forwardRef<HTMLInputElement, CheckboxProps>(function Checkbox(
|
|
{ className, ...props },
|
|
ref,
|
|
) {
|
|
return (
|
|
<input
|
|
{...props}
|
|
ref={ref}
|
|
type="checkbox"
|
|
className={joinClasses('ui-checkbox', className)}
|
|
/>
|
|
);
|
|
});
|
|
|
|
export default Checkbox;
|
|
export type { CheckboxProps };
|