Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | 356x 1x 3010x | import { ReactElement, InputHTMLAttributes } from "react";
import styled from "styled-components";
type Props = InputHTMLAttributes<HTMLInputElement> & {
label: string;
id: string;
};
export const Checkbox = (props: Props): ReactElement => {
return (
<div>
<StyledCheckbox {...props} type={"checkbox"} />
<label htmlFor={props.id}>{props.label}</label>
</div>
);
};
const StyledCheckbox = styled.input`
margin-right: 8px;
width: 16px;
accent-color: ${(props) => props.theme.formAccent};
transform: scale(1.4);
`;
|