The WordPress components docs are pulled from the development branch of the repository, meaning they may describe features and functionality that have yet to be released.
With the current version of the library used in WordPress, you declare the variant with the isPrimary, isSecondary, or isTertiary property:
<Button isSecondary onClick={open}>
Select image...
</Button>
Related Posts:
- Trigger Javascript on Gutenberg (Block Editor) Save
- What are all the query parameters for getEntityRecords?
- Extend core block in Gutenberg
- Show control conditionally in Gutenberg
- Get loading state of wp data selector
- How to get the ToggleControl Gutenberg component working for a PHP Block
- Is there a core Sortable component in Gutenberg?
- Is there an equivalent of the PHP function sanitize_key in Gutenberg?
- Correctly handling WordPress core data retrieval in Gutenberg
- Is there a client side API for handling transients or options?
- What do the args for Gutenberg subpackage “hooks” function “doAction” mean?
- How do I fire a snackbar notice in admin?
- Gutenberg Modify core taxonomy panel element via wp.hooks.addFilter
- What is “open()” in MediaUpload?
- Why is this gutenberg custom format button only available from the toolbar as a dropdown?
- Adding a text element in between title and blocks container
- Setting HTML properties in a Gutenberg plugin using WordPress settings
- Gutenberg RichText
- Provide specific example for block variation
- Set current tab on a Gutenberg TabPanel component from outside that component
- Block editor: How to check if block editor has initialized and populated the data store?
- How to use wp.hooks.addAction() in React JS/Gutenberg?
- Gutenberg block “This block appears to have been modified externally” on save
- How to get value of selected page template in Gutenberg editor?
- Block Editor: How to get title and post content within the WordPress admin UI in Javascript?
- Custom block SelectControl works but equivalent ComboboxControl gives errors – where’s my mistake?
- Gutenberg passing block attributes to component in ES6/ESNext
- How can I add Block Style support to the core HTML block in Gutenberg?
- var is undefined in a Gutenberg block
- Gutenberg add extra attributes to custom format
- event/callback on block update?
- can a buttongroup have a label?
- How to disable inline css styles generated by Gutenberg editor?
- InnerBlocks restricting does not work on nested blocks
- Gutenberg: Block validation Failed Richtext undefined
- Add A Tag To A Post Through JavaScript In Gutenberg UI?
- Add custom HTML markup to Gutenberg RichText
- How to return div with custom attributes(Coding a Gutenberg Block)
- What is the correct way to import the blocks-editor?
- Open MediaUpload from external component in Gutenberg
- Get Block Attributes in JSON REST API
- Open Featured Image Modal in WordPress Gutenberg onClick of a button
- Gutenberg extend blocks add new class name
- How to add classes and events to image in javascript using Gutenberg?
- Checks when fetching data from multiple REST API endpoints in Gutenberg
- Add custom classes for blocks in editor based on custom attributes
- Looping over wordpress meta to create “ ‘s?
- How to display post content in the block editor
- useSelect second parameter
- How can I allow HTML in Gutenberg UI elements help text?
- what is the purpose of the namespace argument when customizing blocks?
- Trigger wp-embed via JavaScript to refresh iframe preview?
- How can I import one custom block into another?
- Gutenberg Blocks: how to determine an index of the current inner block?
- Trying to turn the Edit function into a class to be able to use React lifecycle methods
- Get terms of a taxonomy using useSelect
- Gutenberg richtext block vaildation failed
- UnitControl – Block has encountered an error
- Gutenberg select excerpt, use generated excerpt or use more block excerpt
- Custom Gutenberg-Block esnext pass variables
- Building a Featured Gallery component for Gutenberg
- Gutenberg dependencies in package.json
- find out reason of “Updating failed” in Post-editor
- How to read inline-CSS from Gutenberg block?
- Gutenberg RangeControl
- Gutenberg – useEffect manipulate DOM after block re-renders DOM
- Problem extending a core block
- Cannot read properties of undefined (reading ‘show_ui’) Error on WordPress Post Editor
- Add a Page Screen is Visually Blank
- Gutenberg sidebar show input field on toggle
- Get the ID of a page in Parent combobox in editor
- Issue migrating a checkbox-type meta field to the block editor
- Update block once an API request returns with a value
- Gutenberg – dynamically created element: how to set onChange?
- Custom block update rendering when reused
- WordPress Gutenberg Ajax request
- Gutenberg Edit Block Inspector Controls and save
- Spans in gutenberg
- Block pattern conflict with custom block
- WordPress Gutenberg: Attribute overwritten by block duplicate
- How to delete child block for associated parent block
- Passing object to FormTokenField suggestions
- How to detect if we are in the Site Editor part of the Block Editor (as opposed to editing a Page/Post) in JavaScript?
- How can I show a Slot/Fill in the block editor
- How to add more elements to an already existing section in Gutenberg
- How do i get an Inline style in Gutenberg Block show up in front end?
- WordPress adds and tags into HTML blocks after saving
- Gutenberg core/file add style support in js/ json
- Working with a non-React external library in a custom block
- How to add a css class to postTitleWrapper in Gutenberg?
- Masonry gallery block is working in the block editor but not the template editor
- How to import the imagesLoaded and Masonry libs that come with WP in a Gutenberg block?
- Additional CSS classes not being added in Gutenberg editor
- How do I filter/modify the updated content on save using javascript?
- How to execute some javascript code in the editor when a block pattern is added?
- How to add an additional dependency to a block index.asset.php file
- Why is the Gutenberg editor not recognizing my updates?
- How to transform a shortcode into a block
- useSelect() plus resolver result is serving cached data incorrectly
- Gutenberg DatePicker component with time set to zero