Getting started

Introduction

What Mortar is, what it gives you, and what it leaves to you.

Mortar is a small website framework on Solid 2. You describe your site in code, and Mortar renders it and gives you an admin to edit it with a live preview.

You define two things:

  • Bricks: the sections your pages are built from, such as a hero, a feature grid or a block of Markdown. A brick is a Solid component plus a schema of the data it shows.
  • Collections: sets of documents that share a schema, such as pages, posts or products. A document has typed fields and, if its collection has a body, an ordered list of bricks.

Mortar then gives you:

  • <PageView>, which renders a body: each entry is looked up by brick name and rendered with its data.
  • Storage rules (createContent) over a small adapter you can swap: JSON files by default, in memory for tests, or anything else you write.
  • <Admin>, a schema-driven editor for every collection. Its preview is your real site, with your own bricks, layouts and styles, in an iframe.

What Mortar is not

Mortar is a framework, not a CMS. It ships no bricks, no collections, no routing and no hosting. Sign-in for the admin is an optional package, @mortar-kit/auth. Your app keeps its routes and layouts. Mortar renders the parts made of content, and the admin is a route you mount where you like.

Packages

Package What it holds
@mortar-kit/core Fields, bricks, collections, documents, storage rules, PageView and the content context
@mortar-kit/core/server The JSON-file store (Node only, so node:fs never reaches a browser bundle)
@mortar-kit/admin <Admin>, <Editor> and <SignIn>
@mortar-kit/admin/preview <PreviewPage>, for the preview route
@mortar-kit/admin/vite The mortarKit() Vite plugin, which picks the admin's theme
@mortar-kit/auth Sign-in for the admin: Google and email methods, sessions, route guards (server only)
@mortar-kit/theme-* Admin themes: midnight, warm, soft and mono

Admin code never reaches your public pages' bundle: the admin is only imported by its own route.