مربّع الاختيار Checkbox
مربع صغير تضع فيه علامة. كل خيار مستقل، فيمكنك اختيار أكثر من واحد.
<input type="checkbox">متى تستخدمه
لاختيار عدة عناصر من قائمة، أو للموافقة على الشروط.
خطأ شائع
إذا كان مسموحاً بخيار واحد فقط، فاستخدم Radio.
إمكانية الوصول
Make the whole label clickable, not just the box.
اسمه في الكود
| HTML/CSS | <input type="checkbox"> |
|---|---|
| React | <Checkbox> |
| Jetpack Compose | Checkbox / TriStateCheckbox |
| SwiftUI | Toggle().toggleStyle(.checkbox) |
برومبت جاهز لوكيل البرمجة
Add a Checkbox to this screen.
What it is: A small box you tick; each option is independent, so you can select several.
Implement with: <input type="checkbox"> (HTML/CSS).
Accessibility: Make the whole label clickable, not just the box.
When to use it: For picking several items from a list, or agreeing to terms.
Avoid: If only one choice is allowed, use radio buttons.
Reuse the project's existing design tokens, spacing and component conventions.
أو ركّب صفحة كاملة من هذا العنصر وغيره →
البرومبت بالإنجليزية لأنها الأدق مع Claude Code وأمثاله.