Skip to content

Commit

Permalink
feat: add Checkbox component for enhanced form functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
drikusroor committed Jan 7, 2025
1 parent 39d90c3 commit 2b34e47
Showing 1 changed file with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import React from 'react';

interface CheckboxProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'type'> {
label?: string;
}

export const Checkbox: React.FC<CheckboxProps> = ({ className = '', label, ...props }) => {
return (
<label className="inline-flex items-center">
<input
type="checkbox"
{...props}
className={`
w-4 h-4 text-blue-600 rounded
border-gray-300 shadow-sm
focus:border-blue-500 focus:ring-2 focus:ring-blue-200 focus:ring-opacity-50
disabled:bg-gray-100 disabled:cursor-not-allowed
${className}
`}
/>
{label && <span className="ml-2 text-gray-700">{label}</span>}
</label>
);
};

0 comments on commit 2b34e47

Please sign in to comment.