View Toggle

Install the component dependency:

Include a React component in your project:

ViewToggle PropTypes

Name
Value
Description
Default
children
ViewToggle.Option[]
options to appear in toggle
onSelect
function
triggered when an option is clicked

ViewToggle.Option PropTypes

active
boolean
marks as selected
first option is active

View toggles are used when there are just a couple options to switch between. Use a Tab component when more options exist.

Make a toggle with up to 3 options.

Keep labels short. Long labels will truncate with ellipsis.