技能 编程开发 可重用界面组件模式生成

可重用界面组件模式生成

v20260427
ui-pattern
本技能旨在帮助开发者根据现有设计系统(如StyleSeed的原子组件)生成结构化、可复用的UI布局模式。适用于构建需要跨多个页面保持设计一致性和重复使用性的组件,例如卡片列表、数据表、表单区域等。它指导如何从最小的构建块开始,确保组件的动态性和可扩展性,避免重复编写页面特定的标记代码。
获取技能
453 次下载
概览

UI Pattern

Overview

Part of StyleSeed, this skill builds reusable composed patterns from the seed's primitives. It is intended for sections like card lists, grids, form blocks, ranking lists, and chart wrappers that appear across multiple pages and need to look deliberate rather than ad hoc.

When to Use

  • Use when you need a reusable layout pattern rather than a one-off page section
  • Use when a page repeats the same arrangement of cards, rows, filters, or data blocks
  • Use when you want to build from existing StyleSeed primitives instead of copying markup
  • Use when you want a pattern component with props for dynamic content

How It Works

Step 1: Identify the Pattern Type

Common pattern families include:

  • card section
  • two-column grid
  • horizontal scroller
  • list section
  • form section
  • stat grid
  • data table
  • detail card
  • chart card
  • filter bar
  • action sheet

Step 2: Read the Available Building Blocks

Inspect both:

  • components/ui/ for primitives
  • components/patterns/ for neighboring patterns that can be extended

The goal is composition, not duplication.

Step 3: Apply StyleSeed Layout Rules

Keep the Toss seed defaults intact:

  • card surfaces on semantic tokens
  • rounded corners from the system scale
  • shadow tokens instead of improvised shadow values
  • consistent internal padding
  • section wrappers that align with the page margin system

Step 4: Make the Pattern Dynamic

Expose data through props instead of hardcoding content. If a pattern has multiple variants, keep the API explicit and small.

Step 5: Keep the Pattern Reusable Across Pages

Avoid page-specific assumptions unless the user explicitly wants a one-off section. If the markup only works on one route, it probably belongs in a page component, not a shared pattern.

Output

Provide:

  1. The generated pattern component
  2. The target location
  3. Expected props and usage example
  4. Notes on which existing primitives were reused

Best Practices

  • Start from the smallest existing building block that solves the problem
  • Keep container, section, and item responsibilities separate
  • Use tokens and spacing rules consistently
  • Prefer extending a pattern over adding a near-duplicate sibling

Additional Resources

Limitations

  • Use this skill only when the task clearly matches the scope described above.
  • Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
  • Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
信息
Category 编程开发
Name ui-pattern
版本 v20260427
大小 3.13KB
更新时间 2026-04-28
语言