Component Patterns logo

Component Patterns

Community
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.

Overview

Publisherflitzrrr
Repositoryfrontend-design-skills
Skill namecomponent-patterns
Stars
9
Forks
2
Bundled files
2
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 2 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by flitzrrr on GitHub. Read the source before you install it.

Installation

Install the Component Patterns AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/flitzrrr/frontend-design-skills/tree/main/skills-src/component-patterns
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

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
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Component Patterns in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Component Patterns on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Component Patterns is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

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

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Component Patterns AI skill do?

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.

Why use Component Patterns on TypingMind?

Because you install it once and use it with any model. Component Patterns is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Component Patterns in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/flitzrrr/frontend-design-skills/tree/main/skills-src/component-patterns. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Component Patterns?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Component Patterns?

As many as you like. As long as a model supports skills, you can use Component Patterns with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Component Patterns AI skill free?

Yes. It is published on GitHub by flitzrrr under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇