woocommerce/plugins/woocommerce-blocks/assets/js/editor-components/text-toolbar-button
Leif Singer 8ee74ede0e
Update Woo.com references to WooCommerce.com (#46259)
* replace capitalized Woo.com with WooCommerce.com

* replace http URLs

* replace https URLs

* replace developer.woo.com

* add missing version in `@since` tag

* unslash the HTTP_REFERER

* WordPress.Security.ValidatedSanitizedInput.InputNotSanitized

* add changelog file

* add more changelog files

* address linter errors

* address more linter errors

* fix test

* more linter errors
2024-04-09 09:50:15 +01:00
..
README.md Update Woo.com references to WooCommerce.com (#46259) 2024-04-09 09:50:15 +01:00
index.js Rename js/components to js/editor-components (https://github.com/woocommerce/woocommerce-blocks/pull/3069) 2020-09-02 10:21:46 +02:00
style.scss Use @wordpress/base-styles and @automattic/color-studio as a base for our styles (https://github.com/woocommerce/woocommerce-blocks/pull/3300) 2020-10-22 12:40:32 +02:00

README.md

TextToolbarButton

TextToolbarButton is used in Toolbar for text buttons which show isToggled state.

Notes:

  • Gutenberg core has ToolbarGroup and ToolbarButton in progress. When these are available this component may not be needed.
  • Gutenberg core html block uses regular Button in toolbar, and sets is-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', 'woocommerce' ) }
		</TextToolbarButton>
		<TextToolbarButton
			onClick={ toggleFullCartMode }
			isToggled={ ! isFullCartMode }
		>
			{ __( 'Empty Cart', 'woocommerce' ) }
		</TextToolbarButton>
	</Toolbar>
</BlockControls>

We're hiring! Come work with us!

🐞 Found a mistake, or have a suggestion? Leave feedback about this document here.