Toggleable Button

The Button enables you to indicate whether it is active or inactive.

To make a Button toggleable, update the default false configuration of the togglable property and set it to true.

class ButtonContainer extends React.Component {
    button;

    render() {
        return (
            <div>
                <p>
                    <Button togglable={true} onClick={() => this.forceUpdate()} ref={el => this.button = el}>
                        Togglable Button
                    </Button>
                </p>
                <p>
                    The button is {this.button && this.button.selected ? 'selected' : 'not selected'}.
                </p>
            </div>
        );
    }
}
ReactDOM.render(
    <ButtonContainer/>,
    document.querySelector('my-app')
);

In this article

 /