Configure the Nuxt module
Register
@blokkli/editor in your nuxt.config.ts and set the required itemEntityType option.nuxt.config.ts
itemEntityType is the entity type string blökkli uses to identify individual block items in your backend. Set it to whatever string your data layer uses — 'block', 'paragraph', 'content_block', etc.Create the edit adapter
Create the file
app/blokkli.editAdapter.ts. This is where you connect blökkli to your backend by implementing the adapter interface.app/blokkli.editAdapter.ts
This is the minimum required adapter. blökkli’s adapter interface includes many more optional callbacks —
updateOptions, publish, deleteBlocks, duplicateBlocks, and others. See the adapter reference for the full list.Add BlokkliProvider to your page
Wrap your page template with
<BlokkliProvider> to declare the editing context, then place <BlokkliField> wherever you want a list of editable blocks.pages/[slug].vue
:entityidentifies the content item being edited. blökkli passes this context to your adapter callbacks.:can-edit="true"tells the provider to honor the?blokkliEditingURL parameter. In a real app, drive this from a session check — e.g.,:can-edit="user.canEdit".:listis the array of block objects from your data source. Each item needs at minimum abundleand auuid.nameis the field identifier — it matches the field name your adapter receives inaddNewBlockandmoveBlockcallbacks.
Create a block component
Create
components/Blokkli/Text.vue. blökkli automatically maps any block with bundle: 'text' to this component.components/Blokkli/Text.vue
defineBlokkli() registers this SFC as the renderer for the 'text' bundle and declares one option — text — that editors can change in the options panel. The returned options object is reactive and always reflects the current value, in both edit mode and production.Activate the editor
Start your dev server and navigate to the page you wired up. Append The blökkli editor overlay activates, and you can start adding, dragging, and configuring blocks.
?blokkliEditing={entity-uuid} to the URL — substituting the actual UUID of your entity — to enter edit mode:The editor only activates when both conditions are true: the
?blokkliEditing parameter is present in the URL and :can-edit is true on the <BlokkliProvider>. If can-edit is false, the parameter is ignored and the page renders in read-only mode.Next Steps
Now that you have a working editor, explore the full adapter interface to unlock features like option updates, publishing, duplication, and clipboard support.Module Configuration
Explore all
blokkli config options available in nuxt.config.ts.Defining Blocks
Learn the full
defineBlokkli() API — options schemas, editor metadata, slots, and more.
