← All Components
Component Details
Switch
A control that allows the user to immediately turn a specific setting on or off, functioning like a physical light switch.
Also known as: Toggle, Toggle switch
AI Prompt
Act as a senior frontend engineer and UI specialist. Build a highly accessible, responsive Switch component in HTML, CSS, and minimal vanilla JavaScript. Requirements: - Use semantic HTML. - Design: Clean, minimalist UI matching modern web aesthetics. Ensure spacing, typography, and contrast are refined. - Interaction: Smooth hover and active states (if applicable). - Accessibility: Must be fully keyboard navigable and screen reader friendly. Follow WAI-ARIA guidelines. - Context: A control that allows the user to immediately turn a specific setting on or off, functioning like a physical light switch. - Provide a single HTML file containing all necessary styles and scripts.
Global Inspiration & UI Libraries
Explore additional top-tier design systems, components, and UI/UX inspiration galleries: