← スキル一覧に戻る

ui-components
by narehart
⭐ 0🍴 0📅 2026年1月8日
SKILL.md
name: ui-components description: Create React components with CSS Modules and design tokens
UI Components
Write React components in src/ui/ following the project's component philosophy.
Requirements
- File naming: PascalCase (e.g.,
ItemCell.tsx) - CSS file: Paired
.module.cssfile (e.g.,ItemCell.module.css) - Delegate logic to hooks and utils
Pattern
import classNames from 'classnames/bind';
import type { ReactNode } from 'react';
import styles from './ComponentName.module.css';
const cx = classNames.bind(styles);
interface ComponentNameProps {
children: ReactNode;
variant?: 'primary' | 'secondary' | undefined;
isActive?: boolean | undefined;
}
export function ComponentName(props: ComponentNameProps): ReactNode {
const { children, variant = 'primary', isActive = false } = props;
return (
<div className={cx('component', `component--${variant}`, { 'component--active': isActive })}>
{children}
</div>
);
}
CSS Module Pattern
/* ComponentName.module.css */
.component {
padding: var(--space-md);
background: var(--bg-surface);
border: 1px solid var(--border-default);
}
.component--primary {
color: var(--text-primary);
}
.component--secondary {
color: var(--text-secondary);
}
.component--active {
border-color: var(--accent-primary);
}
Rules
- Check existing components first - Look for Button, Panel, Text, Flex, Icon before creating new ones
- Use primitive components - Compose with Box, Flex, Text, Button, Panel, Icon
- CSS variables only - Use design tokens, not hardcoded values
- BEM naming -
.block-element--modifierin CSS - Delegate logic - Complex logic goes in hooks/utils, not components
- No helper functions - Extract to utils if needed
classnames Binding
Always use classnames/bind for conditional classes:
import classNames from 'classnames/bind';
const cx = classNames.bind(styles);
// Good
<div className={cx('cell', { 'cell--selected': isSelected })} />
// Bad - plain string literals forbidden
<div className="cell" />
<div className={styles.cell} />
Design Token Prefixes
| Prefix | Usage |
|---|---|
font- | Typography |
space- | Spacing/padding/margins |
z- | Z-index layers |
shadow- | Box shadows |
size- | Fixed sizes |
bg- | Background colors |
text- | Text colors |
border- | Border colors |
accent- | Accent/highlight colors |
スコア
総合スコア
50/100
リポジトリの品質指標に基づく評価
✓SKILL.md
SKILL.mdファイルが含まれている
+20
○LICENSE
ライセンスが設定されている
0/10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
○タグ
1つ以上のタグが設定されている
0/5
レビュー
💬
レビュー機能は近日公開予定です