Skip to content
SevenUI
Sign inGet Pro
On this page

Installation

Install SevenUI primitives with the shadcn CLI, on Base UI or UI SDK. The @sevenui registry is in the shadcn registry index, so any primitive installs by name.

SevenUI requires a project already set up with the shadcn CLI and Tailwind CSS v4. If you have not initialized one yet, pick the Base UI base. The default flavour of every SevenUI primitive is built on it, and it is also the starting point for the UI SDK flavour (see Choose a flavour):

init writes starter primitives of its own, such as components/ui/button.tsx. The first time you add SevenUI primitives over those files, pass --overwrite (the command follows the flavour you pick below):

Without it the CLI asks before replacing each existing file. In a non-interactive shell (CI, an AI agent) there is no one to answer, and the command exits with “Done” having written none of the requested files. Leave --overwrite off later on, once you have edited primitives you want to keep.

Choose a flavour

Every primitive comes in two flavours with the same API: the same exports, props, data-slot values and render prop, so code that uses only the SevenUI exports compiles against either. Some behaviour differs; each primitive’s page lists how.

  • Base UI (the default) is built on Base UI and installs as @sevenui/<name>.
  • UI SDK is built on UI SDK (@ui-sdk/react 0.1.0-beta.1, a beta from Vercel Labs) and installs as @sevenui/ui-sdk/<name>. It needs React 19.

The flavour switch in the sidebar (also shown above every example) sets which one this site shows: install commands, example source and live previews follow it, and a link with ?flavour=ui-sdk opens the site on UI SDK. Each primitive’s page lists what behaves differently on UI SDK. Pro blocks are built on Base UI only.

Set up a UI SDK project

Start with shadcn init --base base as above; it installs @base-ui/react and writes a Base UI components/ui/button.tsx, which the next steps replace.

Declare the cascade layer. UI SDK keeps its runtime styles in a cascade layer named ui-sdk. Put this on the first line of your global stylesheet, above @import "tailwindcss":

UI SDK normally inserts its styles first, so a default setup also works without the line. The line keeps your utilities winning when UI SDK’s styles end up after yours, for example under a Content Security Policy without a nonce, where they arrive as constructed stylesheets; there, popups such as dialogs would lose their padding and background. The shadcn CLI can only append CSS, so it prints this step once per install instead of adding the line itself.

Pin UI SDK exactly. SevenUI’s UI SDK flavour is built and tested against @ui-sdk/react and @ui-sdk/core 0.1.0-beta.1, and the registry asks for that exact version. pnpm, yarn and bun save it as given. npm saves ^0.1.0-beta.1, which also accepts later betas and 0.1.x releases, whose API may change under the flavour. With npm, add save-exact=true to .npmrc before the first install, or pin it afterwards:

Install over the starter files. Add the UI SDK primitives with --overwrite the first time, so they replace the starter Base UI files:

Remove Base UI. Once no file under your ui alias imports @base-ui/react (the starter files were the only ones that did), remove it with npm uninstall @base-ui/react (or your package manager’s equivalent).

One flavour per project

Primitives of both flavours install to the same files under your ui alias, so the flavours do not mix:

  • A UI SDK primitive depends on the UI SDK flavour of the primitives it uses, and a UI SDK component depends on UI SDK primitives. Adding one to a Base UI project with --overwrite silently replaces the shared files (a UI SDK dialog replaces your button.tsx; a gallery component can replace label and select). The reverse is the same.
  • Without --overwrite, in a non-interactive shell, the CLI still installs the other flavour’s npm packages, writes none of the files, and exits successfully.

A mixed project still builds, but it ships both libraries and its primitives behave differently from one another. To switch a project deliberately, reinstall every primitive under your ui alias in the other flavour with --overwrite, then remove the library you left (@base-ui/react or @ui-sdk/react and @ui-sdk/core) once nothing imports it. Edits you made to those files are overwritten.

Add primitives

@sevenui is listed in the shadcn registry index, so the CLI resolves the namespace with no extra configuration:

Primitives install as source files under your ui alias.

Animations

Overlay primitives (dialog, menus, popover, select, …) animate through SevenUI’s own enter/exit utilities (animate-in, fade-in-0, zoom-in-95, slide-in-from-*, …) — no animation package is involved. The @utility and @keyframes definitions live in a single animations registry item that every animated primitive depends on, so the shadcn CLI merges them into your stylesheet automatically. Speed and easing compose with Tailwind core’s duration-* / ease-* utilities.

If you copy primitive source manually instead of using the CLI, copy the css block from https://sevenui.dev/r/animations.json into your global stylesheet too — the accordion additionally ships its own accordion-down / accordion-up keyframes in its item the same way.

Every primitive also depends on the sevenui-tokens item, which the CLI merges the same way. When copying manually, take both parts of https://sevenui.dev/r/sevenui-tokens.json: its cssVars (the light values under :root, the dark values under .dark, and the theme entries inside @theme inline) and its css block — the @utility focus-ring definition plus the :root and [data-density=compact] density rules. The tokens add new variables only; none of your shadcn variables are overwritten.

Registry layout

The registry is namespaced by kind, one namespace per tier: primitives at /r/<name>.json, components — the composed examples on sevenui.dev/components — at /r/component/<name>.json, docs demos at /r/demo/<name>.json, and pro blocks at /r/pro/<name>.json. The UI SDK flavour mirrors the first three under /r/ui-sdk/; pro blocks are built on Base UI only.

A component installs the same way as a primitive:

The @sevenui namespace form works the same way:

The file lands in your components/ directory as a single self-contained component, and the primitives it depends on (accordion itself, in this case) land in components/ui/.

Browse components at sevenui.dev/components and pro blocks at sevenui.dev/blocks.

Pro blocks

Blocks install through the same @sevenui registry as everything else, with your Pro license key sent along. Copy the key from your account, then:

Put the key in your environment. In a Next.js project .env.local is the natural place; .env works too, and the shadcn CLI reads both. Keep the file out of version control.

Give the @sevenui registry an Authorization header in components.json, once:

Then add any block by name:

The header applies to the whole @sevenui namespace, not only to blocks. Once it is in components.json, the CLI requires SEVENUI_PRO_KEY for every @sevenui install, free primitives and components included. Where the variable is unset, every install stops with:

Set it everywhere shadcn add runs: each teammate’s machine and CI. A 401 means no key reached the registry; a 403 means the key was rejected. The support FAQ covers both.

Known issues

These apply to both flavours:

  • Next.js cacheComponents. With cacheComponents: true (the create-next-app default in Next.js 16.4), next build fails on the calendar examples that compute a date at render time (new Date() in a Client Component). Wrap such an example in <Suspense>, or compute the date in an effect.
  • Example images. Examples that show an image or the logo load /placeholder.svg or /logomark.svg from your site, which a new project does not have. Replace them with your own images.

Troubleshooting

Text renders in a serif font

shadcn init can write --font-sans: var(--font-sans); into the @theme inline block of globals.css. The variable refers to itself, so it resolves to nothing and the page falls back to the browser’s default serif. A create-next-app layout defines its font as --font-geist-sans; point the theme at that instead:

toast.add() shows nothing

Toasts render through <Toaster />, which has to be mounted once. See Toast setup.

Was this page helpful?