5c7447f434
* mass-rename js/components => js/editor-components & update webpack * mass-change import '@woocommerce/editor-components' + + jsprettier quotes fix * more mass-rename @woocommerce/editor-components * fix up references to js/editor-components in various places: - docs/readmes - jest config - typescritp config * fix story path to match new folder/alias 'editor-components' * fix jest tests: use new alias for editor-components * include renamed `editor-components` in editor stylesheet cache group |
||
---|---|---|
.. | ||
README.md | ||
index.js | ||
style.scss |
README.md
TextToolbarButton
TextToolbarButton is used in Toolbar for text buttons which show isToggled
state.
Notes:
- Gutenberg core has
ToolbarGroup
andToolbarButton
in progress. When these are available this component may not be needed. - Gutenberg core
html
block uses regularButton
in toolbar, and setsis-active
class to trigger "active" styling when button is toggled on.
Usage
Example: two text buttons to select edit modes for cart block.
<BlockControls>
<Toolbar>
<TextToolbarButton
onClick={ toggleFullCartMode }
isToggled={ isFullCartMode }>
{ __(
'Full Cart',
'woo-gutenberg-products-block'
) }
</TextToolbarButton>
<TextToolbarButton
onClick={ toggleFullCartMode }
isToggled={ ! isFullCartMode }>
{ __(
'Empty Cart',
'woo-gutenberg-products-block'
) }
</TextToolbarButton>
</Toolbar>
</BlockControls>