editor - How to display full width block without toolbar?

admin2025-06-05  2

I'm trying to create a full width blocks for the new Gutenberg editor, however I don't want to give to option to toggle the block alignment (eg: like the Cover block does) just make it full width all the time.

I managed to add support for this with the supports flag in my block:

supports: {
    align: ['full']
}

attributes: {
    align: {
        type: 'string',
        default: 'full'
    }
}

This shows the block in the admin area as full width by default but it also displays the Block Alignment Toolbar at the top so it can be toggled on/off:

Is there a way to set the block alignment without displaying the toolbar?

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1749110074a316444.html

最新回复(0)