shadcn/ui
Task-sized answers for shadcn/ui: what to do when styles, dark mode or animations break on Tailwind CSS v4, adding colours, updating components and installing from registries. For the big picture, start with our long read, shadcn/ui explained.
- shadcn/ui not working with Tailwind v4: six causes and fixesUnstyled or transparent shadcn components on Tailwind v4 come from v3 leftovers: the old PostCSS plugin, @tailwind directives, hsl() wrappers, missing imports.
- shadcn/ui dark mode not working? Check these seven thingsIs the dark class on <html>? If not: no provider, a flash on load, or Astro view transitions. If it is: colours without a dark value or @theme without inline.
- Add a custom colour to a shadcn/ui themeThree places in your CSS: the value in :root, the dark value in .dark, and one line in @theme inline. Plus a brand button variant and a contrast check.
- How to update shadcn/ui components without losing your changesThere is no update command: use add --dry-run and --diff to see changes, --overwrite to take them, and Git to put your own edits back.
- shadcn blocks vs components: what is the difference?A component is one interface part, a block is a finished section built from several. How primitives, components, blocks and page templates fit together.
- Install components from a shadcn registry (npx shadcn add @namespace)Install by URL with no setup, or name a registry in components.json and install by namespace. Private registries read their key from .env.local.
- shadcn/ui animations not working on Tailwind v4Dialogs and accordions without animation mean a missing tw-animate-css or shadcn/tailwind.css import. Why the second one fails silently, and how to check.