Import
import { Checkbox } from '@meteorack/sdk-react';How To Use It
- Use it for opt-in settings and independent boolean choices that can be toggled without affecting other fields.
- Prefer checkboxes over switches when the user is reviewing several saved settings in a form and will commit them together.
Props
checked?: booleanCurrent checked state.
onChange?: (checked: boolean) => voidCalled when the checked state changes.
label?: stringOptional clickable label rendered next to the checkbox.
disabled?: booleanDisables interaction and reduces emphasis.
className?: stringOptional class name for the checkbox wrapper.
Example
Checkbox.tsx
import { useState } from 'react';
import { Checkbox } from '@meteorack/sdk-react';
export function MarketingOptInField() {
const [checked, setChecked] = useState(false);
return (
<Checkbox
checked={checked}
onChange={setChecked}
label="Email me about product updates"
/>
);
}