Block Editor: Add predefined arrangements options support to InnerBlocks #15662
Labels
[Feature] Nested / Inner Blocks
Anything related to the experience of nested/inner blocks inside a larger container, like Group or P
Needs Design
Needs design efforts.
[Type] Enhancement
A suggestion for improvement.
Using
InnerBlocks
, it is currently possible to provide atemplate
which describes the initial set of blocks which should be inserted in a new instance of that block:https://github.com/WordPress/gutenberg/blob/master/packages/block-editor/src/components/inner-blocks/README.md#template
This should be enhanced to allow a user to select from a number of predefined, named template options.
Prior art:
When inserting a new Row block from the Coblocks plugin, the user is presented to choose both the number and from a number of layout options:
Usage examples:
Implementation proposal:
This could be considered a layer atop
template
, inheriting the same behaviors, but expressing a set of options from which the user can choose. Therefore, I would propose this would be named similarly, as a separatetemplateOptions
prop.It's necessary to consider what information is necessary for each option to be able to present it in the interface:
The Coblocks Row example is one more of a "wizard" of multiple steps to generate a block. It would be worth considering this, though also whether a more incremental or simple approach would be preferable.
Proposed usage ("Columns" as example):
Notes:
title
(vs.label
,name
, etc) is for consistency to block registration APIThe text was updated successfully, but these errors were encountered: