Checkbox

Molecule

Label + checkbox + opsiyonel hint / hata mesajı. aria-describedby bağlantısı kurulmuş, error durumunda border-error uygulanır.

Props EditorInteractive
<Checkbox id="accept" label="I agree to the Terms of Service" onChange={handleChange} />

Default

Preview
Code
<Checkbox id="accept" label="I agree to the Terms of Service" />

With hint

Preview

We send weekly updates, no spam.

Code
<Checkbox id="newsletter" label="Subscribe to newsletter" hint="We send weekly updates, no spam." />

Error

Preview
Code
<Checkbox id="accept" label="I agree to the Terms of Service" error="You must accept the terms." />

Disabled

Preview
Code
<Checkbox id="accept" label="Checked and disabled" defaultChecked disabled />

Indeterminate (select all)

Preview
Code
// Set indeterminate prop to show mixed state:
<Checkbox id="all" label="Select all" checked={allChecked} indeterminate={someChecked} onChange={toggleAll} />
Sourcemodules/ui/Checkbox.tsx