Skip to Main Content
Mosaic Logo
Mosaic Logo
  • Home
  • Browse components
  • Use in projects
    • Colors
    • Icons
    • Grid
    • Links
    • Typography
    • Spacing Utilities
    • SVG
    • Accordions
    • Alerts
    • Badges
    • Buttons
    • Copy to clipboard
    • Cards
    • Featured Container
    • Filter Bar
    • Lists
    • Loading Spinners
    • Modals
    • Pagination
    • Progress Bars
    • Progress Indicator
    • Site Banner
    • Tables
    • Tabs
    • Toast
    • Toggle Switches
    • Well
    • Wizard
    • Events
    • File Browser
    • File Upload
    • Footer
    • Header
    • Hero
    • Post Item
    • Profile
    • Sidebar Navigation
    • Splash
    • Stack
    • Form Instructions
    • Form Layout
    • Form Validation
    • Form Output
    • Checkboxes
    • Labels
    • Radio Buttons
    • Search Input
    • Select
    • Text Inputs

Toggle Switches | Design System

Examples


Description

By definition, a toggle switch in UI/UX design implies that the user must choose between two mutually exclusive options (example: a clear on-and-off state). When the user presses the switch, a brief interaction appears with the chosen option, then takes immediate effect.

Always make sure that you use clear labels for your toggle switch. Depending on the use case, you can create either two exclusive states with each its own label or one label for the entire toggle switch. In most cases, this is either show-hide, yes-no, or enable-disable. For example, 'enable summaries' or 'show preview.' Include a verb to make it actionable.

Accessibility considerations

Accessibility note: The value of the aria-checked attribute on the input should be set to "true" when the toggle is checked and "false" when it is not checked. This does not happen automatically and must be done with javascript.

Example Code


    <div class="form-check form-switch">
        <input class="form-check-input" type="checkbox" role="switch" aria-checked="false" id="flexSwitchCheckDefault">
        <label class="form-check-label" for="flexSwitchCheckDefault">Show summaries</label>
    </div>
    <div class="form-check form-switch">
        <input class="form-check-input" type="checkbox" role="switch" aria-checked="true" id="flexSwitchCheckChecked" checked>
        <label class="form-check-label" for="flexSwitchCheckChecked">Hide summaries</label>
    </div>

    <div class="form-check form-switch form-check-reverse">
      <label class="form-check-label" for="flexSwitchCheckDefault1">Enable dates</label>
      <input class="form-check-input" type="checkbox" role="switch" aria-checked="false" id="flexSwitchCheckDefault1"/>
    </div>
    <div class="form-check form-switch form-check-reverse">
      <label class="form-check-label" for="flexSwitchCheckChecked1">Disable dates</label>
      <input class="form-check-input" type="checkbox" role="switch" aria-checked="true" id="flexSwitchCheckChecked1" checked/>
    </div>
  
  • facebook

  • Instagram

  • Twitter

  • LinkedIn

  • YouTube

  • Accessibility
  • Privacy Policy
  • Contact Us
Sign up for our newsletter
ICPSR

© 2025 The Regents of the University of Michigan. ICPSR is part of the Institute for Social Research at the University of Michigan.