Toggle buttons
Cross-platform differences
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
Android component options
ContentSame DistinctEnabledSelectedSizeSmall Medium LargeUnselected styleQuiet SecondarySelected styleQuiet Secondary Primary AccentUnselected shapeCircle CapsuleSelected shapeCircle CapsuleTextShow iconContent
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.
Selected
This boolean setting determines whether the toggle button is in the “on” (selected) or “off” (unselected) state.
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.
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
OnEnabledLabel contentSingle On/offLabel styleIcon and text Icon only Text onlySizeSmall Medium LargeWidthHug contents Fill containerHover effectTint Highlight LiftSingle labelQuiet to accent Subtle to accentOn/off labelQuiet to accent Subtle to accentOn/off transitionCycle Blur and replaceTextIconOn
This boolean setting determines whether the toggle button is in the “on” (selected) or “off” (unselected) state.
Enabled
This boolean setting determines whether the toggle button is enabled or disabled.
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.
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.
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.
Tintapplies a tint to the buttonHighlightmorphs the pointer into a platter behind the button and shows a light source that tracks the pointer's position.Liftslides 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.
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
Accessibility
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.