A button that toggles between active and inactive states.
In a React app, the component can be imported via:
The component accepts an isActive prop, which tells it what state to render in.
The button itself doesn't control the active state internally - it is up to the consumer
to manage that state and change it when the button is clicked.
A ToggleButton can be medium (default) or small:
Just like the Button component, a ToggleButton accepts an icon name to render inside:
A ToggleButton can be rendered with just an icon by setting the isIconOnly argument to
true. This will stop the button from rendering the text content, and adjust the paddings so it
looks more balanced:
A ToggleButton can be disabled by setting the isDisabled prop to true:
PlumaToggleButton extends BoxThe URL for the toggle, if it should render as a link instead of a button
The name of an icon (from Pluma Icons) to render in the button.
Default:leading
Which side of the text the icon should be rendered on. leading renders the icon before the text, trailing renders it after
Whether the button is in the active (toggled) state.
Disables the button. Use this instead of the native disabled prop, to make sure non-button elements (when used with as) get the correct styles.
When this is set to true, the button won't render any text, and will reduce its side paddings.
Called when the button is clicked
Default:md
The size of the button. medium and small are deprecated, use md and sm instead.
Change the color of the icon. By default, the icon inherits the button's text color. Use with care, as it can cause inconsistencies in the UI.
Only use if necessary: allows overriding the icon's size.
Whether the component should render with "legacy" styles.