Toggle button
When the action a button invoke is so clear that needs no words, just an icon
Quick nav
Features
- Keyboard accessible
- Focusable even when disabled
- Multiple styles and sizes
- Two icons state
- Themes ready
Anatomy
import { ToggleButton } from "@wonderflow/react-components";
export default () => {
return <ToggleButton restingIcon="play" pressedIcon="pause" />;
};API Reference
Property
Type
Default
kindenumprimarydimensionenumregularrestingIconenumpressedIconenumdisabledbooleanpressedbooleanfalseonClickfunctionasenumbuttonAccessibility
Adheres to the button role requirements. This component always requires the aria-label or aria-labelledby attributes to describe the action.
Keyboard interactions
tab
Move focus on the element or outside
enter
Trigger the component action