Basic information
About shadcn-ui-setup
Install and configure Shadcn/ui component library with Radix UI primitives, Aceternity UI effects, set up components, and manage the component registry. Use when adding Shadcn/ui to a Next.js project or installing specific UI components for Phase 2.
shadcn-ui-setup is an agent skill listed in the AddMCP.net directory, published by maneeshanif. Runtime: Python. Source code is hosted on github.com.
Overview
What is shadcn-ui-setup?
Aceternity UI provides stunning visual effects for landing pages and marketing sections. Like Shadcn/ui, you copy the component code into your project.
Available Effects:
BackgroundBeams- Animated beam lines for hero sectionsTextGenerateEffect- Typewriter text animationMovingBorder- Animated gradient bordersSparklesCore- Particle sparkle effectsBackgroundGradient- Animated gradient backgroundsCardHoverEffect- 3D card hover animations
⚠️ MANDATORY FIRST STEP
BEFORE RUNNING ANY SETUP COMMANDS: Use Context7 MCP to fetch latest documentation for:
shadcn-ui(initialization, components)aceternity-ui(effects, installation)radix-ui(primitives)
Quick reference for installing, configuring, and using Shadcn/ui components and Aceternity UI effects in Next.js projects.
Quick Start
1. Initialize Shadcn/ui
cd frontend
# Interactive setup (recommended)
npx shadcn-ui@latest init
# You'll be prompted for:
# - TypeScript: Yes
# - Style: Default
# - Base color: Slate (or your preference)
# - Global CSS: src/styles/globals.css
# - CSS variables: Yes
# - Tailwind config: tailwind.config.ts
# - Import alias: @/components
# - React Server Components: Yes
This creates:
components.json- Configuration filesrc/components/ui/- Component directorysrc/lib/utils.ts- Utility functions (cn helper)- Updates
tailwind.config.tsandglobals.css
2. Setup Aceternity UI Directory
# Create Aceternity UI directory
mkdir -p src/components/aceternity
# Install required dependencies
npm install framer-motion tailwind-merge clsx
3. Configuration File
After init, components.json looks like:
{
"$schema": "https://ui.shadcn.com/schema.json",
"style": "default",
"rsc": true,
"tsx": true,
"tailwind": {
"config": "tailwind.config.ts",
"css": "src/styles/globals.css",
"baseColor": "slate",
"cssVariables": true,
"prefix": ""
},
"aliases": {
"components": "@/components",
"utils": "@/lib/utils"
}
}Installing Components
Core Components for Phase 2
# Essential form components
npx shadcn-ui@latest add button
npx shadcn-ui@latest add input
npx shadcn-ui@latest add textarea
npx shadcn-ui@latest add label
npx shadcn-ui@latest add checkbox
npx shadcn-ui@latest add form
# Layout components
npx shadcn-ui@latest add card
npx shadcn-ui@latest add separator
# Feedback components
npx shadcn-ui@latest add dialog
npx shadcn-ui@latest add toast
npx shadcn-ui@latest add alert
npx shadcn-ui@latest add skeleton
# Navigation
npx shadcn-ui@latest add dropdown-menu
npx shadcn-ui@latest add avatar
# Optional utility components
npx shadcn-ui@latest add scroll-area
npx shadcn-ui@latest add tooltip
npx shadcn-ui@latest add badge
Install Multiple at Once
npx shadcn-ui@latest add button input textarea label checkbox form card dialog toastComponent Usage Examples
{task.description}
Edit Delete ) } ``` ### Form with Input and Validation ```typescript 'use client' import { useForm } from 'react-hook-form' import { zodResolver } from '@hookform/resolvers/zod' import * as z from 'zod' import { Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, } from '@/components/ui/form' import { Input } from '@/components/ui/input' import { Textarea } from '@/components/ui/textarea' import { Button } from '@/components/ui/button' const taskSchema = z.object({ title: z.string().min(1, 'Title is required').max(200), description: z.string().max(1000).optional(), }) type TaskFormValues = z.infer export function TaskForm({ onSubmit }: { onSubmit: (data: TaskFormValues) => void }) { const form = useForm({ resolver: zodResolver(taskSchema), defaultValues: { title: '', description: '', }, }) return ( ( Title )} /> ( Description Optional description for your task )} /> Create Task ) } ``` ### Dialog (Modal) Component ```typescript 'use client' import { useState } from 'react' import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, } from '@/components/ui/dialog' import { Button } from '@/components/ui/button' import { TaskForm } from './task-form' export function CreateTaskDialog() { const [open, setOpen] = useState(false) const handleSubmit = async (data: TaskFormValues) => { // Create task await createTask(data) setOpen(false) } return ( Create Task Create New Task Add a new task to your todo list ) } ``` ### Toast Notifications First, set up the Toaster in your root layout: ```typescript // app/layout.tsx import { Toaster } from '@/components/ui/toaster' export default function RootLayout({ children }: { children: React.ReactNode }) { return ( {children} ) } ``` Then use the toast hook: ```typescript 'use client' import { useToast } from '@/hooks/use-toast' import { Button } from '@/components/ui/button' export function TaskActions() { const { toast } = useToast() const handleDelete = async () => { try { await deleteTask(taskId) toast({ title: 'Task deleted', description: 'Your task has been successfully deleted', }) } catch (error) { toast({ variant: 'destructive', title: 'Error', description: 'Failed to delete task. Please try again.', }) } } return Delete } ``` ### Checkbox Component ```typescript 'use client' import { Checkbox } from '@/components/ui/checkbox' import { Label } from '@/components/ui/label' export function TaskItem({ task }: { task: Task }) { const [isCompleted, setIsCompleted] = useState(task.completed) const handleToggle = async (checked: boolean) => { setIsCompleted(checked) await toggleTask(task.id) } return (Customizing Components
Modifying Existing Components
All component source code is in src/components/ui/. You can edit directly:
// src/components/ui/button.tsx
import * as React from 'react'
import { cva, type VariantProps } from 'class-variance-authority'
const buttonVariants = cva(
'inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors',
{
variants: {
variant: {
default: 'bg-primary text-primary-foreground hover:bg-primary/90',
// Add custom variant
custom: 'bg-purple-500 text-white hover:bg-purple-600',
},
size: {
default: 'h-10 px-4 py-2',
sm: 'h-9 rounded-md px-3',
lg: 'h-11 rounded-md px-8',
// Add custom size
xl: 'h-14 rounded-md px-10 text-lg',
},
},
}
)
Creating Custom Theme Colors
Update tailwind.config.ts:
export default {
theme: {
extend: {
colors: {
// Custom color palette
brand: {
50: '#f0f9ff',
100: '#e0f2fe',
// ... more shades
900: '#0c4a6e',
},
},
},
},
}
Update globals.css:
@layer base {
:root {
--brand: 217 91% 60%;
--brand-foreground: 0 0% 100%;
}
}Advanced Patterns
My Tasks
Aceternity UI Components (Landing Page)
The simplest way to manage your tasks and boost productivity
Component Reference for Phase 2
| Component | Use Case | Priority | |-----------|----------|----------| | Button | All actions (submit, cancel, delete) | High | | Input | Text fields (title, email, password) | High | | Textarea | Multiline text (description) | High | | Checkbox | Task completion toggle | High | | Label | Form field labels | High | | Form | Integrated form handling | High | | Card | Task display container | High | | Dialog | Modals (create/edit task) | High | | Toast | Success/error notifications | High | | Avatar | User profile display | Medium | | Dropdown Menu | User menu, task actions | Medium | | Separator | Visual dividers | Low | | Skeleton | Loading states | Low |
Troubleshooting
Component not found after installation:
# Reinstall component
npx shadcn-ui@latest add button --overwrite
Style conflicts:
- Check
globals.cssimports order - Verify Tailwind CSS variables are defined
- Clear
.nextcache and restart
TypeScript errors:
- Ensure
@/componentsalias is configured intsconfig.json - Run
npm installto install new peer dependencies
Best Practices
- Don't modify core variants - Create new variants instead
- Use the cn() utility - For conditional classes
- Keep components accessible - Shadcn/ui is accessible by default, maintain it
- Test on multiple screen sizes - Components are responsive
- Follow naming conventions - Use component names as-is
References
- Shadcn/ui: https://ui.shadcn.com/
- Radix UI: https://www.radix-ui.com/
- Tailwind CSS: https://tailwindcss.com/docs
- CVA (Class Variance Authority): https://cva.style/docs
Videos
Tutorials, guides, and showcases related to shadcn-ui-setup. The player loads when you press play.
Videos belong to their creators. Relevance is approximate; check the channel and description before following setup steps.
Comments
No comments yet
Be the first to share feedback about this listing. Sign in to leave a comment.
Sign In