BridgeBeta
  • Brand
  • Digital Assets
    Foundations
    Icons
    Components
    Templates
  • Resources
    Design Tokens
    How-tos
    Best Practices
    Libraries
    Accessibility
    Products List
  • Support
    • Overview
    • Actions
      • Overview
      • Button
      • ContextMenu
      • Link
    • Controls
      • Overview
      • Checkbox
      • Tag
      • Toggle
    • Forms
      • Overview
      • DatePicker
      • FileUploader
      • Input
      • NumberInput
      • RadioButton
      • Search
      • Select
      • Slider
      • TextArea
      • TextInput
    • Hooks
      • useIsomorphicLayoutEffect
      • useMediaQuery
      • useSettings
    • Navigation
      • Overview
      • AnchorNavigation
      • BannerNavigation
      • Breadcrumb
      • Footer
      • InfoBar
      • MainNavigation
      • SecondaryNavigation
      • StepNavigation
      • SubNavigation
    • Overlay
      • Overview
      • Credits
      • Modal
      • ModalWrapper
      • Notification
      • Tooltip
    • Structure
      • Overview
      • Accordion
      • AuthLayout
      • Avatar
      • Callout
      • Card
      • ContentSwitcher
      • Empty
      • Hero
      • InlineLoading
      • Item
      • List
      • Loading
      • mdxComponents
      • Module
      • Pagination
      • ReadMore
      • Story
      • Table
      • Tabs
      • Text
      • Unit
      • User
      • WFPCoreProvider
      • Wrapper
Components
Controls

Toggle

  • Design
  • Code
  • Props

The TOGGLE component is a switch that allows users to choose between two opposing states, such as on/off or enable/disable.

Examples

Figma image

Anatomy

Figma image

How to use

When to use

  • To allow users to switch a feature or setting on and off.
  • When the two states are mutually exclusive.
  • For settings that take effect immediately without needing to save or confirm.
  • When providing immediate feedback is essential for user interaction.

When not to use

  • When there are more than two options to choose from.
  • For actions that require a confirmation step before taking effect.
  • When the state change is not immediately visible or does not have an immediate impact.
  • In place of a checkbox or radio button for simple selections.

Alternative components:

  • Checkbox: Use when you need to select or deselect multiple options.
  • Radio Button: Use when you need to select one option from a group of three or more.
  • Button: Use for actions that need to be submitted, saved, or confirmed.

Accessibility

  • Labeling: Ensure the toggle has an accessible label describing its purpose and current state.
  • Keyboard Navigation: Make sure the toggle can be focused and toggled using keyboard controls (typically the spacebar).
  • Visual Focus: Provide a visible focus indicator when the toggle is selected via keyboard.
  • State Indication: Clearly indicate the toggle’s state through visual means and text labels, if necessary, to aid users with visual impairments.
  • Screen Readers: Ensure that screen readers announce the state change when the toggle is activated. Use ARIA attributes (e.g., aria-checked) to communicate the state to assistive technologies.

On this page

  • Examples
  • Anatomy
  • How to use
  • Accessibility
Storybook
Figma library
Contact us
2025 © World Food Programme