Status: Not accepted
Selected: 1/3
npm install react-ascii-ui
import { AsciiCheckbox } from 'react-ascii-ui';
export default function Example() {
const [checked, setChecked] = useState(false);
return (
<AsciiCheckbox
checked={checked}
onChange={(e) => setChecked(e.target.checked)}
label="Accept terms and conditions"
/>
);
}<AsciiCheckbox label="I agree to the terms" />
<AsciiCheckbox
checked={checked}
onChange={(e) => setChecked(e.target.checked)}
label="Controlled checkbox"
/><AsciiCheckbox disabled label="Disabled unchecked" /> <AsciiCheckbox disabled checked label="Disabled checked" />
| Prop | Type | Default | Description |
|---|---|---|---|
| label | string | - | Optional label text displayed next to checkbox |
| checked | boolean | false | Whether the checkbox is checked |
| onChange | (event) => void | - | Callback fired when the state is changed |
| disabled | boolean | false | Whether the checkbox is disabled |
| className | string | "" | Additional CSS classes |
AsciiCheckbox extends all HTML input attributes (except type) and React.InputHTMLAttributes.