This is version 4 beta of Forma 36Go back to last stable version 3
Forma 36

ToggleButton

Table of contents

Code examples

Example of simple usage:

Example of active and disabled toggle buttons:

Props

NameRequiredDefaultTypeDescription
iconReactElement<any, string | JSXElementConstructor<any>>Expects any of the icon components
isActivefalse
false
true
Applies active styles
isDisabledfalse
false
true
Disabled interaction and applies disabled styles
onToggle() => voidFunction triggered when the toggle button is clicked.
childrenrequiredReactNode
classNamestringCSS class to be appended to the root element
styleCSSPropertiesAccepts a JavaScript object with camelCased properties rather than a CSS string
testIdstringA [data-test-id] attribute used for testing purposes