Skip to main content
Install a block and see the feature running on every surface it touches. Blocks are complete features installed as source code into your project. A block bundles the backend module, workflows, API routes, and panel UI. This tutorial installs the reviews block and follows it across each surface it appears on.
Blocks are copied, not installed as dependencies. add writes the block’s source files into your project through the aliases in blocks.json. You own and can edit every file afterwards. Updates are opt-in through diff and add --overwrite. When you outgrow the catalog, build your own block.

Goal

Install reviews as a block and confirm it runs everywhere it appears.

Install the block

1

Discover the block

Search the registry and inspect what the block ships before you install it.
Terminal
view lists the block’s files by target (API, admin, vendor) and its dependencies.
2

Install it

Run add to copy the block into your project.
Terminal
The CLI copies the source into the directories mapped by your blocks.json aliases and prints the block’s post-install instructions: module registration, middlewares, and migrations.
3

Run migrations and codegen

The block introduced a reviews module. Generate and run its migrations, then refresh the typed route map.
Terminal
4

See it live

Start the project. Reviews now appear in the admin panel (moderation), the vendor portal (per-seller reviews), and the Store API (customer-facing review routes).

Verify

Check that the install landed cleanly:
  • Files: the block’s files exist in your repo under the alias-mapped paths.
  • API: migrations ran cleanly and the API boots.
  • Panels and store: the admin and vendor panels show their reviews pages, and the store review endpoints respond.
  • No drift: bunx @mercurjs/cli@latest diff reviews reports no drift from the registry.

FAQ

The CLI asks before overwriting existing files, or you can force it with --overwrite. If you have customized a page the block also ships, merge by hand. You are merging source, not resolving package versions.
bunx @mercurjs/cli@latest diff reviews shows what changed in the registry since you installed. Take updates with add reviews --overwrite, then re-apply any local edits afterwards.

Next steps

Add a custom panel page

Build your own block