soapbox/src/components/ui/checkbox.tsx

18 wiersze
563 B
TypeScript
Czysty Zwykły widok Historia

import { forwardRef } from 'react';
2022-05-09 13:52:41 +00:00
interface ICheckbox extends Pick<React.InputHTMLAttributes<HTMLInputElement>, 'disabled' | 'id' | 'name' | 'onChange' | 'checked' | 'required'> { }
2022-05-09 17:20:50 +00:00
/** A pretty checkbox input. */
const Checkbox = forwardRef<HTMLInputElement, ICheckbox>((props, ref) => {
2022-05-09 13:52:41 +00:00
return (
<input
{...props}
ref={ref}
type='checkbox'
2024-10-19 03:00:13 +00:00
className='size-4 rounded border-2 border-gray-300 text-primary-600 focus:ring-primary-500 black:bg-black dark:border-gray-800 dark:bg-gray-900'
2022-05-09 13:52:41 +00:00
/>
);
});
export default Checkbox;