Skip to content
Material Design 2
Main Navigation
v3
v2
v1

English

简体中文
繁體中文
Español
Français
Русский
Português – Brasil
Deutsch
日本語
한국어
Italiano
Polski
Türkçe
čeština
magyar

English

简体中文
繁體中文
Español
Français
Русский
Português – Brasil
Deutsch
日本語
한국어
Italiano
Polski
Türkçe
čeština
magyar

Appearance

Sidebar Navigation

Material System

Introduction

Material studies

About our Material studies

Basil

Crane

Fortnightly

Owl

Rally

Reply

Shrine

Material Foundation

Environment

Surfaces

Elevation

Light and shadows

Layout

Understanding layout

Pixel density

Responsive layout grid

Spacing methods

Component behavior

Applying density

Navigation

Understanding navigation

Navigation transitions

Search

Color

The color system

Applying color to UI

Color usage

Text legibility

Dark theme

Typography

The type system

Understanding typography

Language support

Sound

About sound

Applying sound to UI

Sound attributes

Sound choreography

Iconography

Product icons

System icons

Animated icons

Shape

About shape

Shape and hierarchy

Shape as expression

Shape and motion

Applying shape to UI

Motion

Understanding motion

The motion system

Speed

Choreography

Customization

Interaction

Gestures

Selection

States

Communication

Confirmation & acknowledgement

Data formats

Data visualization

Empty states

Help & feedback

Imagery

Launch screen

Onboarding

Offline states

Writing

Machine learning

Machine learning patterns

Object detection: live camera

Object detection: static image

Barcode Scanning

Material Guidelines

Material Theming

Overview

Implementing your theme

Usability

Accessibility

Bidirectionality

Platform guidance

Android bars

Android fingerprint

Android haptics

Android icons

Android navigating between apps

Android notifications

Android permissions

Android slices

Android split-screen

Android swipe-to-refresh

Android text selection toolbar

Android widget

Cross-platform adaptation

Components

App bars: bottom

App bars: top

Backdrop

Banners

Bottom navigation

Buttons

Buttons: floating action button

Cards

Checkboxes

Chips

Data tables

Date pickers

Dialogs

Dividers

Image lists

Lists

Menus

Navigation drawer

Navigation rail

Progress indicators

Radio buttons

Sheets: bottom

Sheets: side

Sliders

Snackbars

Switches

Tabs

Text fields

Time pickers

Tooltips

On this page

Switches ​

Switches toggle the state of a single item on or off.

Switches hero image

Usage ​

Switches are the preferred way to adjust settings on mobile.

Use switches to:

  • Toggle a single item on or off, on mobile and tablet
  • Immediately activate or deactivate something

Principles ​


Switch principle: familiar

Familiar

Switches have been in user interfaces for a long time and should be used as expected.

Switch principle: scannable

Scannable

It should be visible at a glance if a switch has been selected, and selected items should be more visually prominent than unselected items.

Switch principle: efficient

Efficient

Switches make it easy to compare available options.

When to use switches ​

Switches should be used instead of radio buttons if each item in a set can be independently controlled.

Don't use radio buttons to toggle items on or off

Don't

Don't use radio buttons to toggle items on or off. Radio buttons convey that a set of items are options, and that only one can be selected at a time. Instead, use switches.

Use switches to turn an item on or off, especially on mobile instead of a checkbox
Use switches to turn an item on or off, especially on mobile instead of a checkbox.

Other selection controls ​

Selection controls allow users to complete tasks which involve making choices such as selecting options, switching settings on or off, or adding or removing items.

Other selection controls: checkboxes

Checkboxes

Other selection controls: radio buttons

Radio buttons

Other selection controls: switches

Switches


Checkboxes and radio buttons are alternative selection controls that can be used to enter decisions or declare preferences such as settings or dialogs.

Platform differences ​

Adapt selection controls, including switches, to fit platform standards.

Android, Use Material switches
Android
Use Material switches.
Use platform-specific switches on iOS instead of Material switches, as they have matching functionality and presentation
iOS
Use platform-specific switches on iOS instead of Material switches, as they have matching functionality and presentation.

Behavior ​


A switch is successfully toggled when the switch thumb slides to the other side of the track upon user interaction.

Text label

The option that the switch controls, as well as the state it's in, should be made clear from the corresponding inline label.

Avoid creating a switch that includes the text "on" and "off" within the graphic itself. The switch alone should be sufficient.

Diagram of thumb, track
1. Thumb
2. Track

Using a switch to turn an option on and off

When a user toggles a switch, its corresponding action takes effect immediately.

Display processing status ​

Because a switch shows the actual status of something, sometimes there is a delay in its change of state. In such cases, a processing status animation can be used.

An indicator can be used on the full screen to demonstrate status, as described in the progress indicator guidance. Processing status should not be indicated through an animation on the thumb of the switch because it will be harder to read and understand.

Don't demonstrate status by animating the thumb of a switch.

States ​

Switches can be on or off. Switches have enabled, disabled, hover, focused, and pressed states.

Display the outer ripple only on form factors that use touch, where interaction may otherwise obstruct the switch completely.

For desktop, the ripple reaction isn't needed.

Interaction states for on and off switches
Interaction states for on and off switches

Theming ​

Crane Material Theme ​

This travel app's switches have been customized using Material Theming to use custom color.

Crane's customized switches
Crane's customized switches

Crane

A travel app that uses Material Design components and Material Theming to create a personalized on-brand experience.

Related link

Color ​

Crane's switches use a custom color.

Crane Material theme: color
ElementCategoryAttributeValue
SwitchesPrimaryColor
Opacity
#5D1049
100%

The color system

Create a color theme that reflects your brand or style

Related article

Applying color to UI

In a UI, color has a variety of roles: from containing meaning, to expressing a look and feel.

Related article

Specs ​


2036
Pager
Previous pageSnackbars
Next pageTabs

Released under the Apache-2.0

Copyright © 2018-Present Google

https://m2.material.io/components/switches

Released under the Apache-2.0

Copyright © 2018-Present Google