Skip to content
agent-cms

Components / cms-versions

Version history

Versions with author, note and changed fields; compare any two side by side or unified with word highlights; restore or publish a version.

With the shadcn CLI

npx shadcn add https://agent-cms-docs.vercel.app/r/cms-versions.json

With the agent-cms CLI

npx @mainsoft/agent-cms add cms-versions
Live demo
Runs on a demo database that resets every 30 minutes.

Version history

Loading…

Usage#

tsx
<CmsVersions collection="posts" slug={slug} onBack={() => router.back()} />

Pick any two versions to compare. Restoring creates a new version; publishing an old one makes it public again.

Install#

npx @mainsoft/agent-cms add cms-versions

It also needs CmsProvider from cms-lib around your admin:

tsx
<CmsProvider baseUrl="/api/cms">{children}</CmsProvider>