Skip to content
agent-cms

Components / cms-shell

Admin layout

Sidebar with collections, API keys and audit log, plus extraNav for your app's own screens. A sheet menu under 768px. Shows "Media" when the app has a media library.

With the shadcn CLI

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

With the agent-cms CLI

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

posts

TitleCategoryStateLast editedViews (7 days)Actions
Loading…

Usage#

tsx
<CmsShell title="Admin" LinkComponent={Link} activeCollection="posts" extraNav={[{ label: "App", items: [{ label: "Reports", href: "/admin/reports" }] }]}>
  {children}
</CmsShell>

Pass LinkComponent={Link} so links use your router, and extraNav for your own screens. Under 768px the sidebar becomes a sheet menu.

Install#

npx @mainsoft/agent-cms add cms-shell

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

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