shadcn/ui
The shadcn/ui approach: 29 components on Radix and Tailwind are placed in the project and belong to it, a theme on CSS variables in a light and a dark scheme, cn(), components.json. Norms: components in one folder, colors only from the theme, a complete theme, a valid config.
Sobre el paquete
Este texto aún no está traducido. Debajo está el original en inglés.
The shadcn/ui approach for a project on React and Tailwind 4: component sources live in the project and belong to it, and the look is held by a theme of CSS variables. What this approach is in our own words, what is placed and how to add a component is on the page shadcn/ui.
What it installs
- The page shadcn/ui: a guide, the list of the project's components (
components:), where@/points (aliasRoot:). - A theme showcase: buttons, fields, a card, tabs, badges, alerts in the light and dark schemes, and the contrast of color pairs.
- The
placeaction (runs by itself after install and update): components go to theuifolder fromcomponents.json,cn()toutils, the theme totailwind.css, andcomponents.jsonif there is none; hashes go to.shadcn.json. It does not overwrite edited files. - The registry: 29 shadcn/ui components (style
new-york-v4),cn(), the "neutral" theme for Tailwind 4, and the defaultcomponents.json, in.shtukbase/packages/shadcn/registry/with the MIT license and a note of the source. - Norms:
- SHD-R01:
components.jsonis valid; theconfigcheck. - SHD-R02: components in one folder, Radix primitives only there; the
foldercheck. - SHD-R03: colors only from the theme: no Tailwind palette and no custom colors in components; the
colorscheck. - SHD-R04: the theme has a light and a dark scheme and all required variables; the
themecheck.
- SHD-R01:
Where the boundary is
- The package does not install npm dependencies and does not build code: the needed packages (
react,radix-ui,cva,cn,lucide-react,tailwindcss4,tw-animate-css) are printed byplaceas a list. - The registry has 29 components; blocks, charts, a calendar and a sidebar are not included. The rest is added with the ordinary shadcn CLI; they share
components.json. - Theme contrast is a norm of the
design-a11ypackage, spacing and font scales belong todesign-scales. tools/vendor.tsis for whoever maintains the package: it re-reads the components from the open shadcn registry. Installation does not run it.
Source: shadcn/ui, https://ui.shadcn.com, MIT © 2023 shadcn; read on 28.11.2026.
Normas 4
| ID | Norma | Nivel | Modo | Enforcer |
|---|---|---|---|---|
| SHD-R01 | components.json en la raíz del proyecto es un objeto JSON con los campos que lee shadcn, de los tipos correctos; el archivo del tema de tailwind.css existe; los alias ui y utils llevan a una carpeta y a un archivo. |
MUST | bloquea | comprobación |
| SHD-R02 | Los componentes de interfaz viven en una sola carpeta, el alias ui de components.json: están presentes todos los componentes colocados; fuera de ella, los archivos no declaran componentes (data-slot) ni importan primitivos de Radix. |
MUST | bloquea | comprobación |
| SHD-R03 | En los componentes y las pantallas del producto, un color se toma solo de variables del tema: nada de colores de la paleta de Tailwind (bg-red-500), nada de colores propios (bg-[#fff], style={{ color: "#333" }}, fill="#000") y ningún color sin procesar en las reglas CSS. |
MUST | bloquea | comprobación |
| SHD-R04 | El tema del CSS del proyecto fija --radius y todos los colores de shadcn necesarios en :root, y el esquema oscuro (.dark) vuelve a fijar todos los colores necesarios; cada color es un color. |
MUST | bloquea | comprobación |
«Bloquea»: el enforcer detiene la infracción. «Observa»: solo la anota. El nivel MUST es obligatorio; SHOULD significa «sí, salvo que haya motivo».
Acciones 5
| Nombre | Qué hace | Archivo | Cuándo |
|---|---|---|---|
| place | Place components in the project (the list is on /design/shadcn.md; names in the arguments add more; --force replaces edited ones) | actions/place.ts | tras instalar tras actualizar |
| config | components.json is valid norma SHD-R01 | checks/config.ts | comprobación |
| folder | Components in one folder, Radix only there norma SHD-R02 | checks/folder.ts | comprobación |
| colors | Colors only from the theme norma SHD-R03 | checks/colors.ts | comprobación |
| theme | The theme has both schemes and all required variables norma SHD-R04 | checks/theme.ts | comprobación |
shtuk check ejecuta las comprobaciones; shtuk run shadcn <nombre> ejecuta cualquier acción. Las acciones «tras instalar» solo se ejecutan solas si el paquete viene de una fuente de confianza.
Páginas 6
Se copian al proyecto en estas rutas.
- /design/
- shadcn/ui página
- /design/shadcn/
- showcase.html archivo
- /norms/rules/shadcn/
- components.json es válido SHD-R01
- Componentes en una sola carpeta SHD-R02
- Colores solo del tema SHD-R03
- El tema tiene los dos esquemas y todas las variables necesarias SHD-R04
Archivos del paquete 43
Van a .shtukbase/packages/shadcn/; las acciones se ejecutan desde ahí.