---
description: Scaffold shadcn/ui components for Tanstack Start with distinctive design, accessibility, and animation best practices built-in. Prevents generic aesthetics from the start.
---
# Tanstack Component Generator Command
Generate shadcn/ui components for Tanstack Start projects with distinctive design patterns, deep customization, accessibility features, and engaging animations built-in. Prevents generic "AI aesthetic" by providing branded templates from the start.
## Introduction
Senior Component Architect with expertise in shadcn/ui, Radix UI, React 19, Tailwind CSS, accessibility, and distinctive design patterns
**Design Philosophy**: Start with distinctive, accessible, engaging components rather than fixing generic patterns later.
## Prerequisites
- Tanstack Start project with React 19
- shadcn/ui components installed
- Tailwind 4 CSS configured with custom theme
- (Optional) shadcn/ui MCP server for component API validation
## Command Usage
```bash
/es-tanstack-component [options]
```
### Arguments:
- ``: Component type (button, card, form, dialog, dashboard, hero, etc.)
- ``: Component name in PascalCase (e.g., `PrimaryButton`, `FeatureCard`)
- `[options]`: Optional flags:
- `--theme `: Theme variant
- `--animations `: Animation complexity
- `--accessible`: Include enhanced accessibility features (default: true)
- `--output `: Custom output path (default: `src/components/`)
### Examples:
```bash
# Generate primary button component
/es-tanstack-component button PrimaryButton
# Generate feature card with rich animations
/es-tanstack-component card FeatureCard --animations rich
# Generate dashboard layout
/es-tanstack-component dashboard AdminDashboard --theme dark
```
## Main Tasks
### 1. Detect Project Framework
Verify this is a Tanstack Start project before generating components.
```bash
# Check for Tanstack Start
if ! grep -q "@tanstack/start" package.json; then
echo "❌ Not a Tanstack Start project"
echo "This command requires Tanstack Start."
echo "Run /es-init to set up a new Tanstack Start project."
exit 1
fi
```
### 2. Verify shadcn/ui Setup
```bash
# Check if shadcn/ui is initialized
if [ ! -f "components.json" ]; then
echo "shadcn/ui not initialized. Running setup..."
pnpx shadcn@latest init
fi
```
### 3. Install Required shadcn/ui Components
Use MCP to verify components and install:
```typescript
// Check if component exists via MCP
const components = await shadcn-ui.list_components()
const required = ['button', 'card', 'dialog'] // Based on type
for (const comp of required) {
if (await componentInstalled(comp)) continue
// Install via CLI
await exec(`pnpx shadcn@latest add ${comp}`)
}
```
### 4. Generate Component with Distinctive Design
**Anti-Generic Aesthetics** (CRITICAL):
```tsx
// ❌ GENERIC (FORBIDDEN)
export function Button() {
return (
)
}
// ✅ DISTINCTIVE (REQUIRED)
export function PrimaryButton() {
return (
)
}
```
### 5. Component Templates
#### Button Component
```tsx
// src/components/PrimaryButton.tsx
import { Button } from "@/components/ui/button"
import type { ButtonProps } from "@/components/ui/button"
interface PrimaryButtonProps extends ButtonProps {
loading?: boolean
}
export function PrimaryButton({
children,
loading,
...props
}: PrimaryButtonProps) {
return (
)
}
```
#### Card Component
```tsx
// src/components/FeatureCard.tsx
import { Card, CardHeader, CardTitle, CardContent } from "@/components/ui/card"
interface FeatureCardProps {
title: string
description: string
icon?: React.ReactNode
}
export function FeatureCard({ title, description, icon }: FeatureCardProps) {
return (
{icon && {icon}
}
{title}
{description}
)
}
```
### 6. Generate Component File
**Task tanstack-ui-architect(component type and requirements)**:
- Verify component props via MCP
- Generate TypeScript interfaces
- Implement accessibility features
- Add distinctive styling (NOT generic)
- Include animation patterns
- Add JSDoc documentation
- Export component
### 7. Generate Storybook/Example (Optional)
Create example usage:
```tsx
// src/examples/PrimaryButtonExample.tsx
import { PrimaryButton } from "@/components/PrimaryButton"
export function PrimaryButtonExample() {
return (
Default
Loading...
Disabled
)
}
```
## Design System Guidelines
### Required Customizations
✅ **Custom Fonts** (NOT Inter/Roboto):
- Heading: Fraunces, Playfair Display, Merriweather
- Body: Source Sans, Open Sans, Lato
✅ **Custom Colors** (NOT purple gradients):
- Warm: Amber, Orange, Rose
- Cool: Teal, Sky, Indigo
- Earthy: Stone, Slate, Zinc
✅ **Thoughtful Animations**:
- Hover: scale-105, shadow transitions
- Focus: ring-offset with brand colors
- Loading: custom spinners
❌ **Forbidden**:
- Inter or Roboto fonts
- Purple gradients (#8B5CF6)
- Default shadcn/ui colors without customization
- Glass-morphism effects
- Generic spacing (always 1rem, 2rem)
## Validation
Before completing:
- [ ] Component props verified via MCP
- [ ] TypeScript types defined
- [ ] Accessibility features implemented (ARIA attributes)
- [ ] Keyboard navigation supported
- [ ] Distinctive design (NOT generic)
- [ ] Animations included
- [ ] Dark mode supported (if applicable)
- [ ] Example usage provided
## Resources
- **shadcn/ui**: https://ui.shadcn.com
- **Radix UI**: https://www.radix-ui.com
- **Tailwind CSS**: https://tailwindcss.com/docs
- **Google Fonts**: https://fonts.google.com
## Success Criteria
✅ Component generated with distinctive design
✅ No prop hallucination (MCP verified)
✅ Accessibility validated
✅ TypeScript types included
✅ Example usage provided