Publish from the terminal
Component.demo.tsx or demos/default.tsx). For a new slug it validates
dependencies, builds the component, and opens the dedicated Studio CLI
Review — an overview of the component, its demos and their media, and its
tags, with the matching form one click behind each. Its sidebar shows
Demos (N) and the selected demo stays live in the preview.
Studio generates each required cover at the highest priority, then attempts an
optional video in the background. Every cover is captured in both themes, and
the dark version is kept only when the component genuinely renders differently
in dark. Video is best-effort: publishing never waits for it and includes it
only if it is ready; the cover is required. Replace either generated asset
manually before publishing.
Along with the Studio URL the CLI prints a review link that opens the same
screen in a browser signed into nothing — an agent’s browser, a phone, a
colleague’s laptop. It opens once, expires in 24 hours, and dies the moment the
draft is published or deleted.
1
Check the build
Confirm the build succeeded and that every imported package is declared in
the nearest
package.json.2
Check every demo
Test meaningful states in light and dark themes and verify semantic theme
tokens, including the primary color. Use
bg-primary and
var(--color-primary); never oklch(var(--primary)) or
hsl(var(--primary)).3
Choose access
Public or Private, and whether to submit to the catalog, live on the same
screen —
--visibility only sets the default. Add --to <library-slug> to
publish into a team library.4
Publish
The CLI waits and prints the component URL after the final Studio step.
Press Ctrl+C to stop waiting without deleting the
draft.
Without a browser
Agents and scripts complete the same review headlessly:--prepare never publishes; --auto publishes once every required cover is
ready. With --json, stdout carries exactly one JSON document and the exit code
is stable for scripting (3 auth, 4 rate limited, 5 build, 6 media, 7
conflict). See CLI → Publish & manage for every flag.
Continue existing work
21st components returns every accessible personal or Team component and every
owned draft, draining all pages by default. 21st open draft:<uuid> resumes
that draft. 21st open component:<id> creates or resumes a server-owned CLI
Review revision from its retained published code and demos; the live component
does not change until the revision is published. --no-open prints the
workspace URL without opening Studio.
Only the original author can check out a component’s code. A Team manager can
still edit or unpublish a teammate’s metadata. Checkout fails closed if retained
source, dependencies, style, support files, or the default demo cannot be
reproduced safely. If you already changed the local source, or checkout is not
supported, create the revision explicitly:
21st login session or an API key can create a component draft and edit or
unpublish component metadata. Theme and template management still requires a
21st_sk_… key from
Settings → API keys.
The current CLI command sends one self-contained component file and one demo.
Additional local files,
21st.json, and registry dependencies are not
supported for a new slug or a local revision yet — publish those from Studio.21st publish-theme ./theme.css) and
templates (21st publish-template "My starter").
Publish from Studio
Open Studio, go to Components, and choose New component. Opening a draft or choosing Edit code returns to the sandbox workspace; Edit details opens the details editor. The former publish page now redirects into Studio.1
Files
Select a component or demo file in the publishing sidebar, edit it beside
the live preview, and confirm that the result works.
- Add dependency installs a compatible component from the 21st registry.
- New demo creates another demo file.
- Keep one
src/demos/default.tsxdemo. It cannot be deleted.
2
Component
Add a name, a 10–280 character description, and the type: UI, Hook,
Block, or Icon. New drafts get a slug from the name; you can edit it
while the component is still a draft, and Studio checks that it is
available. The slug cannot change after the first publish.New Studio components use the MIT license by default.
3
Demos
Complete every demo before continuing:
- Name with at least 2 characters and 1–5 tags
- Required PNG or JPEG cover image; use 4 MB or smaller
- Optional MP4 or MOV video, up to 50 MB
default slug. Add or remove draft demos from the
Files step.4
Publish
Check the marketplace card preview, then choose the destination and access:
- Pick Personal or a team, then choose No library, Team default, an existing library, or Create library.
- Published is available by direct link and on the author profile.
- Private is available only to you or members of the destination team.
Background Publishing
Studio takes a snapshot of the current publishable source files, metadata, and media, sends the build to the background queue, and immediately returns you to the destination’s Components page. The progress dock shows whether the job is queued, building, published, or failed. You can cancel a pending job or retry a failed one from the dock.Give the demo a controls panel
If a demo declares a module-levelconst settings = { … } and takes it as
props, its preview gets a live panel of sliders, toggles, and color pickers, and
“Copy code” hands the visitor the values they tuned. This works the same from
the CLI and from Studio. See Demo Controls.