Add metabox to document tab in gutenberg

Here is the solution. Hope it will help you

const { registerPlugin } = wp.plugins;
const { PluginDocumentSettingPanel } = wp.editPost;

const MyDocumentSettingTest = () => (
        &ltPluginDocumentSettingPanel className="my-document-setting-plugin" title="My Panel"&gt
            &ltp>My Document Setting Panel&lt/p>
        &lt/PluginDocumentSettingPanel>
    );

registerPlugin( 'document-setting-test', { render: MyDocumentSettingTest } );

https://github.com/WordPress/gutenberg/blob/master/packages/edit-post/src/components/sidebar/plugin-document-setting-panel/index.js#L86

Leave a Comment