add <block>
Install prebuilt registry blocks into a generated app.
create-saas-starter add installs a block — a folder of composed
components and hooks wired to specific starter features — into an app you already
generated. Blocks are the reusable pieces that sit on top of features: an
upgrade card for billing, an invite dialog for orgs, a usage quota banner.
Run it from the root of a generated app:
npx create-saas-starter add upgrade-cardListing the catalog
Run add with no block name to list what's available, annotated with each
block's status for your app:
npx create-saas-starter addAvailable blocks:
audit-log-card — Recent activity card [needs: audit-log] (requires audit-log)
A compact dashboard widget listing the org's most recent audit-log entries…
org-invite-dialog — Org invite dialog [available] (requires orgs)
A compact dialog for inviting a member to the active org…
quota-banner — Usage quota banner [needs: usage, flags] (requires usage, flags)
A dismissible banner that warns when a metered quota nears its plan limit…
upgrade-card — Billing upgrade card [available] (requires billing)
A dashboard card showing the current plan with an upgrade or manage-billing CTA…
Install with: create-saas-starter add <block>Each block is labeled available, installed, or needs: <features> — computed
against the features your app was generated with. There's no separate list
command; listing is add with no arguments.
What happens on install
add is add-only and validates everything before touching disk — a bad
install fails cleanly with nothing written:
- Read the stamp.
.saas-starter.jsontellsaddwhich features your app has and which CLI version built it. - Version must match exactly. A block is only ever CI-proven against its own
template snapshot, so
addrefuses to install if the running CLI's version differs from the app's stamp, pointing you at the pinned CLI. See stamp & versioning. - Required features must be present. A block declares
requires; if your app lacks any of them,addaborts — features can't be added after generation, so the remedy is to regenerate with them. - No folder collision. A block installs to
src/components/blocks/<name>; if that folder exists,addrefuses rather than overwrite. - Copy + strip markers. The block's files are copied in, with
@featuremarker regions for features your app doesn't have stripped out (the same enginegenerateuses). - Merge dependencies. Any npm deps the block needs that your app lacks are
added to
package.jsonand installed; a dep already present is left at your app's version (a differing range is a printed note, not a change). - Typecheck.
addrunstsc --noEmitto prove the app still compiles with the block in place. A failure is a loud abort with the files left for inspection. Skip it with--no-verify. - Print wiring instructions. The block's
usagestring — how to import and render it — is printed last.
Flags
| Flag | Purpose |
|---|---|
--package-manager <pm> | pnpm | npm | bun | yarn. Default: detected from the app's lockfile. |
--verify / --no-verify | Run the post-install tsc --noEmit. Default: on. |
Multiple blocks can be installed at once: add upgrade-card quota-banner. All are
validated before any is written.
Blocks compose features, they don't add them
add can only install a block whose required features your app already has. If
upgrade-card needs billing and your app was generated without it, no block
install will conjure billing — regenerate the app with the feature instead.
The blocks
See the Blocks section for a live preview and install command for each block in the catalog.