هل تعلم؟dyk.si

مفتاح التشغيل Switch (Toggle)

زر ينزلق يميناً ويساراً لتشغيل إعداد أو إيقافه، ويسري التغيير فوراً.

يُعرف أيضاً باسم: Toggle

<input type="checkbox" role="switch">

متى تستخدمه

لإعدادات تُطبَّق فوراً: الوضع الليلي، الإشعارات.

خطأ شائع

داخل نموذج فيه زر «حفظ»، استخدم Checkbox.

إمكانية الوصول

It applies instantly. If the change needs a Save button, use a checkbox instead.

اسمه في الكود

HTML/CSS<input type="checkbox" role="switch">
React<Switch>
Jetpack ComposeSwitch
SwiftUIToggle

برومبت جاهز لوكيل البرمجة

Add a Switch (Toggle) to this screen. What it is: A sliding control that turns a setting on or off immediately. Implement with: <input type="checkbox" role="switch"> (HTML/CSS). Accessibility: It applies instantly. If the change needs a Save button, use a checkbox instead. When to use it: For settings that apply instantly: dark mode, notifications. Avoid: Inside a form with a Save button, use a checkbox. Reuse the project's existing design tokens, spacing and component conventions.

أو ركّب صفحة كاملة من هذا العنصر وغيره →

البرومبت بالإنجليزية لأنها الأدق مع Claude Code وأمثاله.

يُخلَط بينه وبين عناصر أخرى؟

⇄ Switch أم Checkbox أم Radio؟