Attributes

Custom JavaScript components designed to store and manage Gutenberg block attributes. You can use components in the:

1. InspectorControls

index.js
import { __ } from '@wordpress/i18n';

import {
	InspectorControls,
} from '@wordpress/block-editor';

import {
	PanelBody,
} from '@wordpress/components';
index.js | edit()
<InspectorControls>
	<PanelBody
		title={ __('Panel Title', 'your-theme-name') }
		initialOpen={ true }
	>
		...
	</PanelBody>
</InspectorControls>

Controls:

2. BlockControls

index.js
import { __ } from '@wordpress/i18n';

import {
	BlockControls,
} from '@wordpress/block-editor';
index.js | edit()
<BlockControls>
...
</BlockControls>

Controls:

Last updated

Was this helpful?