shadcn-init

Initialize shadcn/ui in React projects with Tailwind CSS v4 configuration.

1|Updated Oct 1, 2023
One-click install
npx skills add https://github.com/jubalm/dotfiles --skill shadcn-init
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: shadcn-init
Source: https://github.com/jubalm/dotfiles/tree/main/home/.claude/skills/shadcn-init
Command: npx skills add https://github.com/jubalm/dotfiles --skill shadcn-init

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill guides you through initializing shadcn/ui in React projects (Next.js, Vite, Astro), including setting up Tailwind CSS v4, path aliases, framework detection, and installation validation. It helps avoid misconfigurations and reduces setup time.

Core Features & Use Cases

  • Framework auto-detection and framework-specific setup steps (Next.js, Vite, Astro)
  • Tailwind CSS v4 installation and tailwind config guidance
  • Path alias configuration to simplify component imports
  • Validation script to verify installation and ensure essential files exist
  • Use Case: Start a new shadcn/ui project fast and consistently across frameworks

Quick Start

Run initialization with defaults: npx shadcn@latest init -d in your React project, follow prompts, and confirm the following files are created: components/ui/button.tsx (or similar), lib/utils.ts, and components.json.

Frequently Asked Questions about shadcn-init

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up shadcn/ui in my React project?

Initialize shadcn/ui by running `npx shadcn@latest init` in your React project root. The tool auto-detects your framework (Next.js, Vite, or Astro), configures Tailwind CSS v4, sets up path aliases, and generates components.json and src/lib/utils.ts. Confirm setup by verifying these files exist.

Does shadcn/ui work with Vite and Astro, or just Next.js?

Shadcn/ui initialization supports Next.js, Vite, and Astro. The Skill detects your framework automatically and applies framework-specific setup steps, including Tailwind CSS v4 configuration and path alias setup tailored to each build system.

What does the shadcn/ui initialization script do?

The initialization script performs framework detection, validates existing Tailwind and CSS imports, generates essential configuration files (components.json and utils), and runs the shadcn init command with defaults or interactive prompts to complete first-time setup.

How do I configure path aliases for shadcn/ui components?

Path alias configuration is handled automatically during shadcn/ui initialization across Next.js, Vite, and Astro. The setup process configures your framework's path mapping so components can be imported cleanly without deep relative paths.

What happens if Tailwind CSS isn't installed before initializing shadcn/ui?

The initialization script validates for Tailwind CSS v4 and CSS imports before proceeding. If Tailwind isn't detected, setup guidance is provided. The Skill covers Tailwind configuration as part of the shadcn/ui initialization process.

Can I run shadcn/ui initialization with default settings automatically?

Yes. Use `npx shadcn@latest init -d` to initialize with defaults, skipping interactive prompts. The Skill supports both automated initialization and interactive options depending on your setup preference.