First you need to import the component –
const {
PanelColorSettings,
} = wp.editor;
then inside the InspectorControls you call the component
<PanelColorSettings
title={ __( 'Color Settings' ) }
colorSettings={ [
{
value: color,
onChange: ( colorValue ) => setAttributes( { color: colorValue } ),
label: __( 'Background Color' ),
},
{
value: textColor,
onChange: ( colorValue ) => setAttributes( { textColor: colorValue } ),
label: __( 'Text Color' ),
},
] }
>
</PanelColorSettings>
Related Posts:
- Using Primary Color in Plugin Block
- ServerSideRender and Media Object: attributes passing image data object to php renderer even though it’s not set
- Where to save Gutenberg plugin data?
- Custom plugin not appearing
- In Which Contexts are Plugins Responsible for Data Validation/Sanitization?
- Best way to abort plugin in case of insufficient PHP version?
- What do you think about custom designed plugin/theme options UIs?
- Adding pre-publish checks with Gutenberg
- Allowing for multiple template views on the Gallery Settings page when using the Visual Editor
- How to make repeated component/block in Gutenberg
- How to get data from WordPress $wpdb into React Gutenberg Blocks Frontend?
- When is it appropriate to put functions on page template vs. functions.php?
- Plugin Sidebar is not Saving Meta Attribute to Post/Page after “Update”
- What’s the Right Way to get and save remote data for a Gutenberg block?
- WordPress: After Gutenberg plugin migration to block.json the localization/ translations with PolyGlot in JavaScript does not work anymore
- Looking for callback function after Gutenberg is rendered?
- Error : “Updating failed: The response is not a valid JSON response” with custom shortcode
- Delete a specific item menu when I deactivate my plugin
- Is there a better way to implement responsive images than what WordPress uses by default?
- Are we allowed to use the Allman (BSD) indent style when coding WordPress plugins and themes?
- Gutenberg: useDispatch is not a function – @wordpress/data included
- Gutenberg Block add element in the Editor inside InnerBlocks after div – editor-block-list
- Make a list with header and subtext in Gutenberg blocks
- How do you render_callback for register_block_type to a method in another class?
- Get the password key when using the wp_new_user_notification_email filter
- Order properties should not be accessed directly
- How to deal with equal & similar arguments for a function?
- How insert negative values in Gutenberg box-control
- Executing a function upon webhook calling wordpress
- Customizer: widget-synced triggers twice
- how to use hook deleted_user into custom function to delete user from custom table
- Where to store the name of a custom table?
- WordPress is automatically linking plain text email addresses
- Is Using WordPress Supplied WYSIWYG Advisable?
- Are block templates incompatible with serialize_blocks?
- How do I dynamically render an InnerBlock inside a dynamic block?
- WordPress Block Development – trouble importing from @wordpress/icons
- Clearing caches on plugin uninstall
- How to use a hook to override an update_post_meta call in a plugin?
- How to access noticeOperations from withNotices
- How to insert text at the current cursor position in Gutenberg?
- Do I have to worry about useState causing a re-render?
- How to get boolean value from register_meta properly?
- JSX in WordPress Plugin Development
- ResizableBox with RangeControl not working
- jQuery selectors for editor elements safe to use?
- There is a problem in the gutenberg block I developed. Problem is with withInstanceId
- How to modify files inside wp-includes directory in wordpress
- How to set a cookie for logged in users to md5($user->ID . “my_secret”)?
- Create Widget or Enable Shortcodes in Sidebar
- Catching Gutenberg sidebar switch event
- Proper way to use useSelect
- Use npm and wp-env to make production bundle
- How to save post meta as an array in Gutenberg?
- WordPress Gutenberg InnerBlocks renderAppender not showing with template
- Gutenberg – is it ok to load dependencies multiple times?
- Preventing double loading JS scripts (like React) when developing for Gutenberg
- how to save wp_editor html content in options table
- How to use a WP_Customize_Control outside of the Customizer?
- How to determine which capability to use?
- Console errors in 6.0-RC1 Widget screen
- Custom Block Not Shown in Block Inserter
- How to use attributes in competent of Gutenberg
- var(–text-color) in style.scss works once but not twitch
- Custom Endpoint – Does it possible to use PUT method with WP API Rest?
- Why won’t this submenu page show? – My First WordPress Plugin
- wordpress full site editing problem when extending core blocks
- Pass custom props to
- Rerender core Templates with with ToggleControl but it doesnt recognize block type
- What happens/fires when you select a block in the editor?
- How to use setAttributes outside of the edit function return
- Where do I hook to have the server do something in PHP on block attribute change?
- Reading plugin settings in esnext wordpress block
- Rate limiting ajax requests in WordPress
- Does hooking into a plugin action / filter override the plugin’s function for that hook?
- How to get access the ID of all posts of custom post type in Gutenberg editor
- Determine if the current page, is being edited
- WordPress delete mysql rows with string
- Making adding info to an overlay bio easy for average user?
- Associating special meaning with user id 0
- Theming Custom Plugin Page
- Best practice: What belongs in theme and what in plugin for large eCommerce website
- Link to a admin submenu item using a custom link
- Adding class to the parent of current-post-ancestor / current-menu-parent / current-post-parent
- Dynamic banner for use on external sites
- How do I store a custom dataset in WordPress to best take advantage of API?
- Developing Themes on WordPress, Looking for Excellent Tutorials [closed]
- How to Implement SAM Broadcaster with WordPress? [closed]
- Gutenberg’s Popover component position relative to the focused element
- Gutenberg: – Call a function after Server Side Component is rendered
- Accept only PDF file for upload
- Help interpreting @wordpress/create-block-tutorial-template usage error
- How can I add a custom button to the post editor?
- How to get custom user meta by id in custom Gutenberg block
- Block Development: hamburger module throwing error in save function
- Adding a navigation with wp_nav_menu() to a custom block in the site editor
- Why isn’t custom sidebar panel not showing up in the Gutenberg Editor?
- REST API error in block editor for custom templates
- How can I include React useState in a custom gutenberg block plugin?
- Set srcset on a block image