UI コンポーネント作成スキル
shadcn/ui + デザインシステムパターン
使用するタイミング: 新しい UI コンポーネントを作成する場合
重要: 最初にデザインシステムを読む
UI を生成する前に: /DESIGN-SYSTEM.md を読んでください
品質ゲート: 以下について 9/10 以上を維持:
- 視覚的な独自性
- ブランドへの適合性
- アクセシビリティ
パターン: shadcn/ui コンポーネント
'use client';
import { Card } from '@/components/ui/card';
import { Button } from '@/components/ui/button';
export function MyComponent({ data }: { data: any }) {
return (
<Card className="p-6 border-border-subtle bg-bg-card">
<h2 className="text-xl font-semibold text-text-primary mb-4">
{data.title}
</h2>
<p className="text-text-secondary mb-4">
{data.description}
</p>
<Button variant="default" className="bg-accent-500 hover:bg-accent-600">
アクション
</Button>
</Card>
);
}
デザイントークン(必須)
生の値ではなく、これらを使用:
色:
bg-bg-card(bg-whiteではなく)text-text-primary(text-gray-900ではなく)accent-500(#ff6b35 オレンジ)border-border-subtle
スペーシング:
- Tailwind クラス(p-4, mb-6 など)
禁止パターン
❌ bg-white(代わりに bg-bg-card を使用)
❌ text-gray-600(代わりに text-text-secondary を使用)
❌ レスポンシブ対応なしの grid grid-cols-3 gap-4(md:、lg: を追加)
必須パターン
✅ システムのデザイントークンを使用 ✅ すべての状態(ホバー、フォーカス、無効) ✅ レスポンシブブレークポイント ✅ アクセシビリティ(aria-labels)
標準: デザイントークンを使用し、すべての状態を実装し、アクセシビリティを確保