Switch
Interruttore
Un interruttore attiva o disattiva una impostazione, e di solito il cambio avviene subito.
Un esempio vero
Quando attivi la modalità scura, lo schermo cambia immediatamente in colori scuri.
Parti principali
- 01Etichetta visibile
- 02Interaction target
- 03Current state
- 04Keyboard behavior
Usalo quando
Usalo per un'impostazione salvata attiva o disattiva con un'etichetta chiara.
Non usarlo quando
Non metterlo mai in un modulo dove le persone devono ancora premere un pulsante Salva separato.
Nome usato nel codice
role="switch" Prima di spedire
Give assistive tools the control’s name (accessible name), purpose (role), value, and state. Check keyboard use, visible focus, target size, disabled and busy states, feedback, and recovery.
Outcome: Complete the task with Interruttore (Switch). User context: Quando attivi la modalità scura, lo schermo cambia immediatamente in colori scuri. Recommended pattern: Interruttore (Switch). Why it fits: Usalo per un'impostazione salvata attiva o disattiva con un'etichetta chiara. Do not use it when: Non metterlo mai in un modulo dove le persone devono ancora premere un pulsante Salva separato. Product requirements: Define the default, loading, empty, error, success, and recovery states. Keep user input. Give clear feedback after every action. Accessibility and resilience: Use semantic HTML, full keyboard access, and visible focus. Make the layout work when zoomed and support reduced motion. Follow the project’s current rules. Do not add a new UI library unless the project already uses it. Acceptance criteria: The main task works with keyboard only and at 320px width. Focus and status changes are announced. Check loading, failure, retry, cancel, and reduced-motion paths. Evidence and limits (evidence boundary): Lo standard copre solo l'ambito elencato. Non sceglie lo stile visivo, la decisione sul prodotto o l'esempio di vocabolario. Unknowns to confirm: Product wording, data source, analytics events, supported devices and languages, and platform limits.
Controlla questa richiesta
Review how Interruttore (Switch) is used now. Definition: Un interruttore attiva o disattiva una impostazione, e di solito il cambio avviene subito. Release checks: Give assistive tools the control’s name (accessible name), purpose (role), value, and state. Check keyboard use, visible focus, target size, disabled and busy states, feedback, and recovery. Before changing code, list the evidence, gaps, severity, and the smallest safe fix.