Component Patternsのロゴ

Component Patterns

コミュニティ
flitzrrr
component-patterns

Modern UI component selection, composition, and theming patterns for web applications. Covers compound components, design tokens, variant systems, responsive patterns, and form architecture derived from 21st.dev SDK, Godly featured products, and current best practices.

概要

公開者flitzrrr
リポジトリfrontend-design-skills
スキル名component-patterns
スター
9
フォーク
2
同梱ファイル
2
ライセンスMIT
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 2個の同梱ファイル

    モデルが作業中に読み取れるスクリプト、テンプレート、参考資料です。ファイルは読み取り専用で、実行されることはありません。

  • オープンソース

    flitzrrrがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキル「Component Patterns」をTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/flitzrrr/frontend-design-skills/tree/main/skills-src/component-patterns
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/flitzrrr/frontend-design-skills.git /tmp/frontend-design-skills
mkdir -p .claude/skills
cp -r /tmp/frontend-design-skills/skills-src/component-patterns .claude/skills/component-patterns
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでComponent Patternsを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあるとすぐに、モデルが自動的にComponent Patternsを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Component Patternsは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、スキルを使わない間は指示の読み込みにトークンを消費しません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

Component-Patterns

Modern UI component patterns for web applications. Component selection, composition, theming, and token systems following current standards (21st.dev SDK, Tailwind, Radix UI).

Scope

Use this skill when:

  • You are designing or selecting UI components
  • You are building a design token system
  • You are implementing theming (dark/light/custom)
  • You are planning compound components or variant systems
  • You are designing form architectures
  • You are defining responsive component strategies

Principles

1. Composition over Inheritance

Build components by assembling small, specialized parts. Props for configuration, children for content, slots for variation.

2. Server-First, Client Where Needed

Server Components as the default. Client Components only for interactivity (state, event handlers, browser APIs).

3. Token-Based Theming

Design tokens (CSS Custom Properties) control all visual aspects. No hardcoding of colors, spacing, or font sizes.

4. Accessibility as Architecture

ARIA roles, keyboard navigation, and focus management are part of the component definition, not an afterthought.

5. Composable Primitives

Base primitives (Button, Input, Text, Box) are unstyled and maximally flexible. Design system components build on top of them.

Rules

Component Structure

  • DO: Each component as a single file with a clear export. One component = one responsibility.
  • DO: Explicitly type the props interface (TypeScript). Zod schemas for validated inputs.
  • DO: Compound components for complex UI elements:
    <Card>
      <Card.Header />
      <Card.Body />
      <Card.Footer />
    </Card>
  • DO: Variants with class-variance-authority (cva) instead of conditional classes.
  • DON'T: Components with more than 10 props. Split when responsibilities grow too many.
  • DON'T: Runtime CSS-in-JS. Tailwind CSS or CSS Modules for static styles.
  • DON'T: Div soup. Use semantic HTML elements (section, article, nav, header, footer, main).

Theming and Design Tokens

  • DO: Three-tier token system:
    • Global Tokens: Raw values (colors.blue.500, spacing.4, radius.md)
    • Semantic Tokens: Purpose-bound (color.primary, color.surface, spacing.section)
    • Component Tokens: Specific (button.bg, card.padding, input.border)
  • DO: Theme switching via CSS Custom Properties with a data attribute or class on html/body.
  • DO: Dark/light as minimum. Optionally: high contrast, brand-specific themes.
  • DON'T: Inline styles for themeable values. Always reference tokens.
  • DON'T: Token names that describe colors (--blue-500). Use semantic names (--color-primary).

Form Components

  • DO: Schema-driven forms: Zod schemas define fields and validation.
  • DO: React Hook Form or similar for performance (uncontrolled components).
  • DO: Consistent field anatomy: Label > Input > Helper Text > Error Message.
  • DON'T: Custom selects without keyboard support. Use native Select or Radix UI Select.
  • DON'T: Forms without loading and success states after submit.

Responsive Components

  • DO: Container queries for component-based responsiveness.
  • DO: Mobile variants as dedicated states (chat panel becomes fullscreen, sidebar becomes drawer).
  • DO: Touch targets at least 44x44px on mobile.
  • DON'T: Hover-dependent interactions without a touch alternative.
  • DON'T: Horizontal scrolling in components on mobile (exception: carousels).

Extended rules and code examples: see references/implementation.md

Patterns

PatternUsageCore Idea
Three-Panel LayoutDashboards, chat appsNavigation (240px) + Content (flex) + Context (320px)
Progressive Disclosure CardComplex data, API responsesSummary > Details > Raw Data
Form-Agent HybridForm assistantsForm left, chat right, agent populates fields
Real-Time Status DashboardMonitoring, DevOpsLive updates via WebSocket/SSE, color-coded tiles
Skill Configuration PanelAgent setupSystem prompt + skill library + deploy button

Detailed pattern descriptions: see references/patterns.md

Anti-Patterns

  1. God Component -- One component for chat, tools, form, and navigation simultaneously. Split it up.
  2. Prop drilling for theme -- Theme values passed through 5+ levels. Use context or CSS Custom Properties.
  3. Client-side everything -- Everything as a Client Component. Use Server Components for static content.
  4. Inline styles for layout -- style={{ marginTop: 20 }} instead of token-based utilities.
  5. Modal for everything -- Prefer inline expansion, drawers, or panels.
  6. Uncontrolled state explosion -- Use a central state store or server state (React Query/SWR).
  7. Hardcoded breakpoints -- Define breakpoint tokens in the theme configuration.
  8. Missing error boundaries -- Place React Error Boundaries around critical sections.

Checklist

  • Every component has a typed props interface (TypeScript)
  • Compound components for complex elements (Card, Dialog, Tabs)
  • Variants with cva or similar system
  • Design tokens in three tiers: global, semantic, component
  • Theme switch via CSS Custom Properties, not JS runtime
  • Forms use Zod schemas for validation
  • Server Components as default, client only when needed
  • Container queries for component-based responsiveness
  • Error boundaries around critical UI sections
  • Mobile touch targets at least 44x44px
  • Keyboard navigation for all interactive elements
  • ARIA roles and labels for screen readers
  • Semantic HTML elements instead of div soup

Cross-References

  • design-trends -- Trends influencing component design (motion, dark mode)
  • ui-patterns -- UI patterns implemented as components
  • visual-direction -- Visual tokens (colors, typography, spacing) for the token system
  • agent-ui-design -- Agent-specific components (chat, tools, streaming)
  • accessibility -- Accessibility requirements
  • responsive-design -- Breakpoint strategies and container queries

同梱ファイル

スキルが読み込まれている間、モデルは必要に応じてこれらを読み取ります。読み取り可能なファイルとして提供され、実行されることはありません。

よくある質問

AIスキル「Component Patterns」では何ができますか?

Modern UI component selection, composition, and theming patterns for web applications. Covers compound components, design tokens, variant systems, responsive patterns, and form architecture derived from 21st.dev SDK, Godly featured products, and current best practices.

TypingMindでComponent Patternsを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Component Patternsはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにComponent Patternsをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/flitzrrr/frontend-design-skills/tree/main/skills-src/component-patternsを貼り付けてください。TypingMindがSKILL.mdを読み込み、関連ファイルをまとめて、チャットごとに有効にできるスキルとしてインストールします。

Component Patternsを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストの内容がこのスキルの用途に合ったときに、このスキルを読み込めます。

Component Patternsで使えるAIモデルの数に制限はありますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもComponent Patternsを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Component Patterns」は無料ですか?

はい。flitzrrrがMITライセンスのもとでGitHubに公開しています。ご利用のAIプロバイダーに支払うのは、使用したトークンの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇