registry:style
Custom style that extends shadcn/ui
The following registry item is a custom style that extends shadcn/ui. Onnpx shadcn init, it will:
- Install
@tabler/icons-reactas a dependency. - Add the
login-01block andcalendarcomponent to the project. - Add the
editorfrom a remote registry. - Set the
font-sansvariable toInter, sans-serif. - Install a
brandcolor 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 theextends: 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-mergeandclsxas dependencies. - Add the
utilsregistry item from the shadcn/ui registry. - Add the
button,input,label, andselectcomponents 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 custombrand color.
example-style.json
registry:block
Custom block
This blocks installs thelogin-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. Onnpx shadcn add, the following will:
- Add the
login-01block from the shadcn/ui registry. - Override the
button,input, andlabelprimitives with the ones from the remote registry.
example-style.json
CSS Variables
Custom Theme Variables
Add custom theme variables to thetheme 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 theenvVars field.
example-item.json
.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 of2.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
.eslintrc.json
my-custom-starter-template.json