projectrules.ai

Shadcn UI Components

UI ComponentsNext.jsShadcnFrontend DevelopmentTypescript

Description

Use shadcn/ui components as needed for any UI code

Globs

*.tsx
---
description: Use shadcn/ui components as needed for any UI code
globs: *.tsx
---

# Shadcn UI Components

This project uses @shadcn/ui for UI components. These are beautifully designed, accessible components that you can copy and paste into your apps.

## Next.js specific Components

- Always use the Link component from next/link where possible
- Always use the Image component from next/image where possible

## Finding and Using Components

Components are available in the `src/components/ui` directory, following the aliases configured in `components.json`

## Using Components

Import components from the ui directory using the configured aliases:

```tsx
import { Button } from "@/components/ui/button"
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"
import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "@/components/ui/card"
```

Example usage:

```tsx
Click me


  
    Card Title
    Card Description
  
  
    Card Content
  
  
    Card Footer
  

```

## Installing Additional Components

Many more components are available but not currently installed. You can view the complete list at https://ui.shadcn.com/r

To install additional components, use the Shadcn CLI:


```bash
bunx shadcn@latest add [component-name]
```

For example, to add the Accordion component:

```bash
bunx shadcn@latest add accordion
```

Note: `bunx shadcn-ui@latest` is deprecated, use `bunx shadcn@latest` instead

Some commonly used components are

- Accordion
- Alert
- AlertDialog
- AspectRatio
- Avatar
- Calendar
- Checkbox
- Collapsible
- Command
- ContextMenu
- DataTable
- DatePicker
- Dropdown Menu
- Form
- Hover Card
- Menubar
- Navigation Menu
- Popover
- Progress
- Radio Group
- ScrollArea
- Select
- Separator
- Sheet
- Skeleton
- Slider
- Switch
- Table
- Textarea
- Toast
- Toggle
- Tooltip

## Component Styling

This project uses the "new-york" style variant with the "neutral" base color and CSS variables for theming, as configured in `components.json`.