Skip to content

Vue SDK

Complete API reference for @inlinecms/vue.

Vue 3 plugin that initializes the CMS and provides reactive state.

import { InlineCMSPlugin } from '@inlinecms/vue'
app.use(InlineCMSPlugin, {
apiKey: 'your-key',
apiUrl: 'https://cms.yourdomain.com',
})
<script setup>
import { useCMS } from '@inlinecms/vue'
const { getField, setField, saveDraft, publish, canEdit, hasPendingChanges } = useCMS({
componentId: 'hero-section',
fields: [
{ key: 'title', type: 'text', label: 'Hero Title' },
],
})
</script>
<script setup>
import { useAuth } from '@inlinecms/vue'
const { isAuthenticated, canEdit, user, login, logout } = useAuth()
</script>

The same enrichment surface as the React SDK — register host-owned objects and read them merged with their CMS overlay. See the Admin Content Management guide for the full model.

<script setup>
import { useCMSObject, useCMSObjects, useInlineContent, useRegisteredObjects } from '@inlinecms/vue'
// Register a single object so it surfaces in the editor / content manager:
useCMSObject('property', { id: 'prop_8c4f', name: 'Beachfront Stunner', bedrooms: 3 })
// Register a list (e.g. rendered review cards):
useCMSObjects('review', reviews)
// Register + read merged with the CMS overlay (returns a computed ref):
const host = useInlineContent('host', { id: 'host_maya', firstName: 'Maya' })
// template: {{ host.firstName }}, {{ host.$cms.canEdit }}
// Reactive snapshot of everything registered (for building editor UI):
const objects = useRegisteredObjects()
</script>
ComposableReturnsDescription
useCMSObject(type, object)voidRegister one object (accepts a value, ref, or getter).
useCMSObjects(type, objects)voidBulk-register a list.
useInlineContent(type?, object)ComputedRef<InlineContent<T>>The object merged with its overlay; .$cms carries { loading, canEdit, fields, collections }.
useRegisteredObjects()Ref<RegisteredObject[]>Reactive list of all registered objects.

Renderless component for template-driven editing:

<CMSField tag="h1" component-id="hero" field-key="title" field-type="text" label="Title">
Default heading
</CMSField>
PropTypeRequiredDescription
tagstringNoHTML tag to render (default: div)
component-idstringYesComponent identifier
field-keystringYesField key within the component
field-typeFieldTypeNoOverride inferred field type
labelstringNoLabel for the edit UI

A managed list of rich objects (amenities, features, specs) bound to a host object’s field. View + in-place manage in one component — the Vue twin of the React <InlineObjects>. See the Admin Content Management guide for the full model.

<script setup>
import { InlineObjects } from '@inlinecms/vue'
const resort = { id: 'r1', amenities: [{ icon: '🌊', label: 'Ocean view' }] }
</script>
<template>
<InlineObjects :data="resort" value="amenities" item-label="amenity" :fields="['title','icon']" :columns="2" />
</template>
PropTypeRequiredDescription
data{ id: string } & objectYesThe host object. Identity is always borrowed.
valuestringYesField path, e.g. "amenities".
typestringNoObject type; inferred from data.__cmsType / data.type when omitted.
mode'inline' | 'manage'Noinline (default) renders the list; manage opens the editor.
render'list' | 'grid' | 'button'NoDisclosure style (default list).
item-labelstringNoSingular noun for buttons, e.g. "amenity".
fieldsArray<'title'|'icon'|'badge'|'description'>NoSub-fields the editor exposes (default title, icon, badge).
columnsnumberNoColumn count for the view grid (default 2).

Each item is an ObjectItemValue ({ title, icon?, badge?, description? }). Falls back to the host object’s own array when the CMS overlay is empty, and offers cross-object “used elsewhere” suggestions.

A managed image/video collection bound to a host object’s field — gallery for visitors, upload/caption/reorder/remove for editors. The Vue twin of the React <InlineImages>.

<template>
<InlineImages :data="property" type="property" value="images" layout="1-4" />
</template>
PropTypeRequiredDescription
data{ id: string } & objectYesThe host object.
valuestringYesField path, e.g. "images".
typestringNoObject type; inferred from data when omitted.
mode'inline' | 'manage'Noinline (default) renders the gallery; manage opens the grid.
layoutGalleryLayoutStyleNoGallery layout hint (default 1-4).
render'gallery' | 'grid' | 'button'NoDisclosure style (default gallery).

A drop-in, object-scoped management surface — a Content tab (edit this object’s fields and collections) and, for admins, a Schema tab (add / retype fields). render="button"/"fab" opens a side drawer; render="panel"/"inline" renders open. It prompts for sign-in when there’s no editor session.

<template>
<InlineCMSContentManager :data="property" type="property" :roster="[property]" render="fab" />
</template>
PropTypeRequiredDescription
data{ id: string } & objectYesThe object in context. Identity is always borrowed.
typestringNoObject type; inferred from data when omitted.
render'button' | 'fab' | 'panel' | 'inline'NoDisclosure style (default button).
scope'object' | 'type' | 'both'NoWhich tiers to expose (default both, role-gated).
rosterArray<{ id: string } & object>NoFull object list, for switching between instances.

Emits open / close; pass a custom trigger via the #trigger slot.

Vue equivalent of the React withCMS HOC:

import { defineInlineComponent } from '@inlinecms/vue'
import HeroSection from './HeroSection.vue'
export const CMSHero = defineInlineComponent(HeroSection, {
componentId: 'hero-section',
fields: [
{ key: 'title', selector: 'h1', type: 'text' },
{ key: 'subtitle', selector: 'p', type: 'text' },
],
})

The wrapped component receives field values as props and an onInlineCmsEdit callback.

Was this page helpful? Your feedback goes straight to the docs team.