← Back to list

create-component
by tech-with-seth
React Router 7 starter with Polar.sh, BetterAuth, Prisma, and Tailwind
⭐ 1🍴 0📅 Jan 24, 2026
SKILL.md
name: create-component description: Create CVA + DaisyUI components following Iridium patterns. Use when asked to create UI components, buttons, inputs, cards, modals, alerts, or any reusable UI element.
Create Component
When to Use
- Creating new UI components (buttons, inputs, cards, modals)
- Building form elements with labels and error states
- User asks to "add a component" or "create a component"
Critical Rules
1. Always Import from CVA Config
// CORRECT
import type { VariantProps } from 'cva';
import { cva, cx } from '~/cva.config';
// WRONG
import { cva } from 'cva'; // Wrong package
import { cn } from '~/lib/utils'; // Wrong utility
2. className Last in cx()
className={cx(buttonVariants({ size, status }), className)} // className always last
Quick Start
import type { VariantProps } from 'cva';
import { cva, cx } from '~/cva.config';
export const buttonVariants = cva({
base: 'btn',
variants: {
status: {
primary: 'btn-primary',
secondary: 'btn-secondary',
},
size: {
sm: 'btn-sm',
md: 'btn-md',
lg: 'btn-lg',
},
},
defaultVariants: {
status: 'primary',
size: 'md',
},
});
interface ButtonProps
extends React.ButtonHTMLAttributes<HTMLButtonElement>,
VariantProps<typeof buttonVariants> {
loading?: boolean;
}
export function Button({ status, size, className, children, ...props }: ButtonProps) {
return (
<button className={cx(buttonVariants({ status, size }), className)} {...props}>
{children}
</button>
);
}
Component Directories
| Category | Directory | Examples |
|---|---|---|
| Actions | app/components/actions/ | Button |
| Data Display | app/components/data-display/ | Card, Badge |
| Data Input | app/components/data-input/ | TextInput, Select |
| Feedback | app/components/feedback/ | Alert, Modal |
| Layout | app/components/layout/ | Container |
Checklist
- Create in appropriate category directory
- Define CVA variants with
base,variants,defaultVariants - Extend native HTML attributes in props interface
- Put
classNamelast incx()call - Add JSDoc with usage example
Templates
Full Reference
See .github/instructions/component-patterns.instructions.md and .github/instructions/cva.instructions.md for:
- Form component patterns
- Boolean variants
- Compound variants
- DaisyUI class reference
Score
Total Score
65/100
Based on repository quality metrics
✓SKILL.md
SKILL.mdファイルが含まれている
+20
✓LICENSE
ライセンスが設定されている
+10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
✓最近の活動
1ヶ月以内に更新
+10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
✓タグ
1つ以上のタグが設定されている
+5
Reviews
💬
Reviews coming soon

