Toggle buttons

Cross-platform differences

Three unselected toggle buttons in light gray, grouped by platform. Android has two: a capsule-shaped toggle button with a triangle icon and the label 'Label A,' and a circular icon toggle button with only the triangle icon. iOS has one: a rounded-rectangle toggle button with a triangle icon and the label 'Label A.’
While the iOS and Android toggle buttons perform the same function, their component structures intentionally differ. These differences align with native Android and iOS conventions, creating a more familiar platform experience for our users.

Android

Android has two toggle button types: the toggle button and the icon toggle button.

  • Use the toggle button for actions that include a text label and an optional icon.
  • Use the icon toggle button for actions that only require an icon.

The Android toggle button uses one state transition.

iOS

iOS handles both the toggle button and the icon toggle button with a single component.

The iOS toggle button lets you choose between two state transitions.

Anatomy

Anatomy of a toggle button, a light gray capsule with a triangle icon and the label 'Label.' Callouts point to three parts: the icon on the left, the text label on the right, and the container, which is the capsule itself.

Android component options

Property
Value
Notes
Content
Same Distinct
Enabled
Boolean
Selected
Boolean
Size
Small Medium Large
Unselected style
Quiet Secondary
Selected style
Quiet Secondary Primary Accent
Quiet and Secondary are only available for toggle buttons with distinct content.
Unselected shape
Circle Capsule
Only available for icon toggle buttons.
Selected shape
Circle Capsule
Only available for icon toggle buttons.
Text
String
Include text if there is no icon.
Show icon
Boolean
Include an icon if there is no text.

Content

Choose between same and distinct to set whether the icon and label change when the toggle button is selected. Same keeps the icon and label as they are. Only the style changes. Distinct lets you use a different icon, label, or both. Based on this decision, available stylistic options change.

Enabled

This boolean setting determines whether the toggle button is enabled or disabled.

Two Android toggle buttons side by side. The enabled one, labeled 'Enabled,' has a light gray capsule with a dashed square icon and the label 'Label' in dark text. The disabled one, labeled 'Disabled,' has the same icon and label in faded gray on a lighter background.

Selected

This boolean setting determines whether the toggle button is in the “on” (selected) or “off” (unselected) state.

Two Android toggle buttons side by side. The unselected one, labeled 'Unselected,' is a light gray capsule with a circle icon and the label 'Label A' in dark text. The selected one, labeled 'Selected,' is a dark charcoal capsule with a triangle icon and the label 'Label B' in white text.

Size

Choose between three sizes: small, medium, and large. Default to using the medium size. When selecting a size for a toggle button, consider its layout context. Small toggle buttons work best in denser UI layouts with multiple actions, while large toggle buttons are best suited for more spacious layouts with fewer actions. Regardless of a toggle button’s visual size, maintain a minimum accessible tap target of 48dp × 48dp.

Three Android toggle buttons in increasing size, labeled Small, Medium, and Large. Each is a light gray capsule with a dashed square icon and the label 'Label.' The icon, text, and capsule all grow from one size to the next.

Unselected style

Choose between quiet and secondary to set the style of the toggle button when it is unselected.

Selected style

Choose between quiet, secondary, primary, and accent to set the style of the toggle button when it is selected. For same content toggle buttons, the selected style can be primary or accent. For distinct content toggle buttons, the selected style can be quiet, secondary, primary, or accent.

Unselected shape

Choose between circle and capsule to set the shape of an icon toggle button. The circle option makes the button round, and the capsule option makes it slightly wider than it is tall (a 1:1.125 aspect ratio). This setting is only available for icon toggle buttons.

Selected shape

Choose between circle and capsule to set the shape of an icon toggle button. The circle option makes the button round, and the capsule option makes it slightly wider than it is tall (a 1:1.125 aspect ratio). This setting is only available for icon toggle buttons.

Text

Toggle buttons should always have a label, unless they are only using an icon that is universally understood and accessible.

Show icon

Add an optional leading icon when additional clarity is required. The icon should be highly relevant to the action and never used just for decoration.

iOS component options

Property
Value
Notes
On
Boolean
Enabled
Boolean
Label content
Single On/off
Label style
Icon and text Icon only Text only
Size
Small Medium Large
Width
Hug contents Fill container
Hover effect
Tint Highlight Lift
Single label
Quiet to accent Subtle to accent
Only available if Label content is set to Single
On/off label
Quiet to accent Subtle to accent
Only available if Label content is set to On/off
On/off transition
Cycle Blur and replace
Text
String
Include text if there is no icon.
Icon
-
Include an icon if there is no text.

On

This boolean setting determines whether the toggle button is in the “on” (selected) or “off” (unselected) state.

Two iOS toggle buttons side by side. The unselected one, labeled 'Unselected,' is a light gray rounded rectangle with a dashed square icon and the label 'Label' in dark text. The selected one, labeled 'Selected,' has the same icon and label in white on a blue rounded rectangle.

Enabled

This boolean setting determines whether the toggle button is enabled or disabled.

Two iOS toggle buttons side by side. The enabled one, labeled 'Enabled,' is a light gray rounded rectangle with a dashed square icon and the label 'Label' in dark text. The disabled one, labeled 'Disabled,' has the same icon and label in faded gray on a lighter background.

Label content

Choose between single and on/off. A toggle button with “single” selected will have the same icon and label regardless of whether it is on or off. A toggle button with “on/off” selected will have different icons and labels when it is on versus when it is off.

Two iOS toggle buttons that switch between unselected and selected, labeled Single and On/off. Single: a light gray button with an outlined bookmark icon and the label 'Bookmark' changes to a blue button with the same outlined icon and the same label. On/off: a light gray button with an outlined bookmark icon and the label 'Bookmark' changes to a blue button with a filled bookmark icon and the label 'Bookmarked.’

Label style

Choose between icon and text, icon only, and text only to set what content the toggle button shows.

Size

Choose between three sizes: small, medium, and large. Default to using the medium size. When selecting a size for a toggle button, consider its layout context. Small toggle buttons work best in denser UI layouts with multiple actions, while large toggle buttons are best suited for more spacious layouts with fewer actions.

Three iOS toggle buttons in increasing size, labeled Small, Medium, and Large. Each is a light gray rounded rectangle with a dashed square icon and the label 'Label A.' The icon, text, and container all grow from one size to the next.

Width

Choose between hug contents and fill container to set how wide the toggle button will be.

Hover effect

Choose tint, highlight, or lift to set how the toggle button reacts when a user hovers over it with a trackpad or mouse.

  • Tint applies a tint to the button
  • Highlight morphs the pointer into a platter behind the button and shows a light source that tracks the pointer's position.
  • Lift slides the pointer under the button, where it disappears as the button scales up and gains a shadow.

Single label

Choose between quiet to accent and subtle to accent to set how the toggle button looks when a user turns it on or off. This setting only applies if label content is set to single.

On/off label

Choose between quiet to accent and subtle to accent to set how the toggle button looks when a user turns it on or off. This setting only applies if label content is set to single.

Two iOS toggle buttons that switch between off and on, labeled Quiet to accent and Subtle to accent. Quiet to accent: an outlined bookmark icon and the label 'Bookmark' with no background changes to a blue button with a filled bookmark icon and the label 'Bookmarked.' Subtle to accent: the same icon and label on a light gray background changes to the same blue button with a filled icon and 'Bookmarked.’

On/off transition

Choose cycle or blur and replace to set how the toggle button animates between the on and off states. With cycle, the on state animates in from the bottom and the off state animates in from the top. With blur and replace, the current content blurs out and the new content blurs in.

Text

Toggle buttons must always have a descriptive text label. In text-only and icon-and-text style, the text is visible onscreen. In icon-only style, it serves as an accessibility label so VoiceOver can communicate the button’s purpose.

Icon

Add an optional leading icon when additional clarity is required. The icon should be highly relevant to the action and never used just for decoration.

Behaviors

Text overflow

Labels that exceed the toggle button’s available width wrap to as many additional lines as needed. With an icon, text aligns left. Without one, it centers. While toggle buttons can wrap longer labels, keep labels concise whenever possible to maintain a clean, balanced layout.

Usage guidelines

Do maintain clear hierarchy when grouping toggle buttons

Whether grouped vertically or horizontally, make it obvious which option matters most. Start with the primary choice, then order the rest by importance.

Don’t use multiple styles together

In a group of toggle buttons, use only one style (e.g., subtle to accent) to avoid confusion about which are selected and which are not.

Haptics & motion

Haptics

Toggle buttons support haptics by default. You can turn them off with the haptics property. Use haptics sparingly and thoughtfully, as they can lose meaning when they fire too frequently.

Motion

Android

Buttons have a ripple effect while scaling down on press and back up on release.

iOS

Choose between two on/off transitions: cycle and blur and replace. Both only apply to toggle buttons with the label content set to on/off.

With cycle, the on state animates in from the bottom of the button and the off state animates in from the top of the button. With blur and replace, the current text and icon blur out and the new content blurs in.

The cycle transition responds to the device’s reduce motion setting. The reduce motion setting does not affect the blur and replace transition.

Internationalization

For RTL (right-to-left) languages, mirror the layout of the toggle button: place the icon on the right and the label on the left.
Two toggle buttons showing how the layout mirrors for right-to-left languages. Left-to-right: a light gray capsule with a bookmark icon on the left and the label 'Bookmark' on the right. Right-to-left: a light gray capsule with the bookmark icon on the right and a Hebrew label on the left.

Accessibility

Most accessibility behaviors are built into the component to meet user preferences, including font scaling settings, bold text, reduced motion, TalkBack / VoiceOver compatibility, color contrast, and support for non-touch navigation modes. Additionally, teams will need to:

Accessibility labels

For icon-only toggle buttons, provide an accessibility label that describes the action the button performs. Toggle buttons with text do not need accessibility labels.

Tap target size

Maintain a minimum tap target area of 48dp × 48dp on Android when laying out toggle buttons, even if their visual size is smaller.

Consistent identification

Use the same label for toggle buttons that do the same thing across the application.

Perceivable

Requirement
Criterion
Level
Compliance
Non-text content
1.1.1
A
Non-text elements, such as icons used in toggle buttons, must provide a text alternative that communicates the control’s purpose. All controls, especially icon-only controls, need an accessible name so screen readers can announce their function.
Info and relationships, Identify purpose
1.3.1, 1.3.6
A, AAA
Toggle buttons are understandable by assistive technologies like screen readers.
Text contrast
1.4.3
AA
Large text has a contrast ratio of at least 3:1, and small text has a contrast ratio of at least 4.5:1.
Non-text contrast
1.4.11
AA
The visual presentation of icons across styles and states has a contrast ratio of at least 3:1.

Operable

Requirement
Criterion
Level
Compliance
Keyboard
2.1.1, 2.1.3
A, AAA
Users can operate the toggle button with an external keyboard without specific timing for keystrokes.
Keyboard traps
2.1.2
A
Users can move focus away from the component using only an external keyboard.
Seizures and physical reactions
2.3.1, 2.3.2, 2.3.3
A, AAA, AAA
There is no flashing content and users can turn off motion with their device's reduce motion setting.
Focus visible
2.4.7
AA
Focus shows an indicator that is visible with at least 3:1 contrast.

Understandable

Requirement
Criterion
Level
Compliance
Consistent identification
3.2.4
AA
Toggle buttons that do the same thing use the same label across the application.

Robust

Requirement
Criterion
Level
Compliance
Name, role, value
4.1.2
A
The component exposes its role and on/off state to screen readers. Teams provide the name through the label or, for icon-only buttons, an accessibility label.

Resources