Toggle switches turn a setting on or off and apply it straight away. Each switch here is a button with role="switch" and aria-checked, named by its visible label and described by a hint, with Space and Enter to flip it and a disabled switch that says why. Eight styles, light and dark, with HTML, CSS and two lines of JavaScript. Every example is an original design that comes with its HTML code and a DESIGN.md of colour, type and spacing tokens, in light and dark. Free to use and adapt.
16 examples
Both are on/off controls. A switch suggests an instant change, like a light switch; a checkbox suggests a choice that is submitted later. Screen readers announce role="switch" as on or off and a checkbox as checked or not checked.
Not required if the thumb position and colour change are clear, and the label states the setting. If your switches sit far from their labels, adding small On/Off text helps.
App screens
UI components
Website sections
Website templates
search_ui_screens (e.g. “billing settings, editorial style”), get_ui_flow for a whole journey, and get_ui_screen_code to pull the HTML and DESIGN.md straight into your project.