Skip to main content

registry:style

Custom style that extends shadcn/ui

The following registry item is a custom style that extends shadcn/ui. On npx shadcn init, it will:
  • Install @tabler/icons-react as a dependency.
  • Add the login-01 block and calendar component to the project.
  • Add the editor from a remote registry.
  • Set the font-sans variable to Inter, sans-serif.
  • Install a brand color in light and dark mode.
example-style.json

Custom style from scratch

The following registry item is a custom style that doesn’t extend shadcn/ui. See the extends: none field. It can be used to create a new style from scratch i.e custom components, css vars, dependencies, etc. On npx shadcn add, the following will:
  • Install tailwind-merge and clsx as dependencies.
  • Add the utils registry item from the shadcn/ui registry.
  • Add the button, input, label, and select components from a remote registry.
  • Install new css vars: main, bg, border, text, ring.
example-style.json

registry:theme

Custom theme

example-theme.json

Custom colors

The following style will init using shadcn/ui defaults and then add a custom brand color.
example-style.json

registry:block

Custom block

This blocks installs the login-01 block from the shadcn/ui registry.
login-01.json

Install a block and override primitives

You can install a block fromt the shadcn/ui registry and override the primitives using your custom ones. On npx shadcn add, the following will:
  • Add the login-01 block from the shadcn/ui registry.
  • Override the button, input, and label primitives with the ones from the remote registry.
example-style.json

CSS Variables

Custom Theme Variables

Add custom theme variables to the theme object.
example-theme.json

Override Tailwind CSS variables

example-theme.json

Add custom CSS

Base styles

example-base.json

Components

example-card.json

Add custom utilities

Simple utility

example-component.json

Complex utility

example-utility.json

Functional utilities

example-functional.json

Add CSS imports

Use @import to add CSS imports to your registry item. The imports will be placed at the top of the CSS file.

Basic import

example-import.json

Import with url() syntax

example-url-import.json

Import with media queries

example-media-import.json

Add custom plugins

Use @plugin to add Tailwind plugins to your registry item. Plugins will be automatically placed after imports and before other content. Important: When using plugins from npm packages, you must also add them to the dependencies array.

Basic plugin usage

example-plugin.json

Plugin with npm dependency

When using plugins from npm packages like @tailwindcss/typography, include them in the dependencies.
example-typography.json

Scoped and file-based plugins

example-scoped-plugin.json

Multiple plugins with automatic ordering

When you add multiple plugins, they are automatically grouped together and deduplicated.
example-multiple-plugins.json

Combined imports and plugins

When using both @import and @plugin directives, imports are placed first, followed by plugins, then other CSS content.
example-combined.json

Add custom animations

Note: you need to define both @keyframes in css and theme in cssVars to use animations.
example-component.json

Add environment variables

You can add environment variables using the envVars field.
example-item.json
Environment variables are added to the .env.local or .env file. Existing variables are not overwritten.
IMPORTANT: Use envVars to add development or example variables. Do NOT use it to add production variables.

Universal Items

As of 2.9.0, you can create universal items that can be installed without framework detection or components.json. To make an item universal i.e framework agnostic, all the files in the item must have an explicit target. Here’s an example of a registry item that installs custom Cursor rules for python:
.cursor/rules/custom-python.mdc
Here’s another example for installation custom ESLint config:
.eslintrc.json
You can also have a universal item that installs multiple files:
my-custom-starter-template.json