<BlokkliField> is the Vue component that marks a region in your template as a block area. In edit mode it becomes a droppable target where content editors can add, reorder, and remove blocks. At runtime it iterates over the block list and renders each block using its corresponding component.
Every block-enabled region on a page must have exactly one <BlokkliField>. It must be a descendant of a <BlokkliProvider>.
Basic Usage
Pass your block data array and a unique field name:list, looks up the component registered for each block’s bundle, and renders it with the block’s fields as props.
Props
Array of block data objects from your backend. blökkli expects each object to include at minimum:
uuid— a unique identifier for the block instancebundle— the block type identifier, used to look up the correct component
The field name identifier for this block region. This value must match the
name you return for this field in getFieldConfig() inside your adapter. blökkli uses it to associate editor actions (adding, reordering blocks) with the correct field.The HTML element to use as the wrapper container for this field. Defaults to
'div'. Set this to match the semantic element your layout requires — for example 'ul' when each block renders as an <li>, or 'section' for landmark regions.A CSS class string applied to the wrapper element. Useful for layout utilities or spacing classes when you don’t have a parent wrapper to style.
Multiple Fields on One Page
You can define multiple independent block regions within a single<BlokkliProvider>. Give each field a unique name:
Each
name must be unique within a single provider. Using the same name for two fields in the same provider leads to unpredictable editor behaviour.Field Configuration in the Adapter
For every<BlokkliField> you use in your templates, return a corresponding configuration entry from getFieldConfig() in your blökkli adapter. This is where you declare which block bundles are allowed in each field:
allowedBundles array controls which block types content editors can drop into that field. A block bundle not listed here will not appear in the editor’s add-block palette for that field.
Rendering Nested Block Regions
Some block components may themselves contain editable sub-regions — for example, a two-column layout block with a left and right column. Use<BlokkliField> inside the block component and pass the nested block arrays from the block’s props:
When using nested
<BlokkliField> inside a block component, the field names ('left', 'right') must be declared in getFieldConfig() just like top-level fields — scoped to the entity type and bundle of the parent entity.Behaviour in Edit Mode vs. Runtime
Runtime (no editor)
<BlokkliField> renders a plain wrapper element and iterates the list to render block components. No extra DOM, no performance overhead.Edit mode
The wrapper becomes a droppable target. blökkli adds the editor overlay, drag handles, selection state, and the add-block palette scoped to
allowedBundles.
