Files
gridpilot.gg/apps/website/ui/SimpleCheckbox.tsx
2026-01-18 17:55:04 +01:00

36 lines
815 B
TypeScript

import React from 'react';
import { Box } from './primitives/Box';
interface CheckboxProps {
checked: boolean;
onChange: (checked: boolean) => void;
disabled?: boolean;
'aria-label'?: string;
}
/**
* SimpleCheckbox
*
* A checkbox without a label for use in tables.
*/
export function SimpleCheckbox({ checked, onChange, disabled, 'aria-label': ariaLabel }: CheckboxProps) {
return (
<Box
as="input"
type="checkbox"
checked={checked}
onChange={(e: React.ChangeEvent<HTMLInputElement>) => onChange(e.target.checked)}
disabled={disabled}
w="4"
h="4"
bg="bg-deep-graphite"
border
borderColor="border-charcoal-outline"
rounded="sm"
aria-label={ariaLabel}
ring="primary-blue"
color="text-primary-blue"
/>
);
}