Search
MaterialComponentsDocs
Components overviewApp barBadgeButtonsButton groupButtonExtended FABFAB menuFABIcon buttonSplit buttonCardCarouselCheckboxChipsDate & time pickersDate pickerTime pickerDialogDividerListLoading & progressLoading indicatorProgressMenuNavigationNavigation barNavigation drawerNavigation railRadio buttonsSearchSelectSheetsBottom sheetSide sheetSliderSnackbarSwitchTabsText fieldToolbarTooltip

Switch

Turn a setting on or off. Try labels, supporting text, and interactive states.

Notifications
FactoryWeb ComponentsReactVueSvelteSolidJS

Accessibility

  • The input has role="switch" and is named by its label; supporting text describes it through aria-describedby, and the error state sets aria-invalid.
  • Tab focuses it; Space and Enter toggle it, as the M3 switch accessibility guidance has it.
  • Keyboard focus draws a 0.10 state layer on the handle and a 3dp focus ring around the track; a pointer shows no ring.
  • In right-to-left layouts the handle runs from right to left.
  • When the label is ambiguous, set ariaLabel: "Photo album access" rather than "Photo album".