View Toggle

Install the component dependency:

Include a React component in your project:

ViewToggle PropTypes

NameValueDescriptionDefault
childrenViewToggle.Option[]options to appear in toggle

ViewToggle.Option PropTypes

activebooleanmarks as selectedfirst 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.