Communitygithub.com

YepAPI/skills

佈局網格、KPI 卡片、支援排序與篩選的資料表格、側邊欄導航以及響應式中斷點。

skills 是什麼?

此技能為一款儀表板設計模組,提供標準化的佈局規則與可複用元件,協助開發者快速建構內部工具或數據可視化頁面。它定義了固定的側邊欄與流體主內容區、KPI 卡片響應式網格、支援排序與篩選的分頁資料表格,並內建載入骨架與日期範圍篩選器等常見 UI 模式。技能基於 `@tanstack/react-table` 與 shadcn/ui 元件庫,適用於 Claude Code、Cursor 及 Codex 等 AI 代理平台。開發者只需遵循 SKILL.md 中的 TypeScript 範例與佈局結構,即可產出一致且高品質的儀表板介面,同時避免常見的 UX 陷阱,如缺乏空狀態或側邊欄不可收合等問題。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/YepAPI/skills/tree/HEAD/skills/dashboard-design

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

儀表板設計

規則

  • 側邊欄 + 主內容區佈局:固定寬度側邊欄(w-64),流體主內容區並帶有內距
  • 側邊欄導航:圖示 + 標籤連結,活動狀態高亮,在行動裝置上可收合
  • 頂端的 KPI 卡片列:3-4 張卡片組成響應式網格,包含指標名稱、數值、趨勢(增減百分比),可選用迷你圖
  • 資料表格:欄位可排序,可依搜尋/狀態篩選,支援分頁(預設 10-25 行)
  • 使用 @tanstack/react-table 進行無頭表格邏輯,搭配 shadcn/ui 的 Table 元件
  • 響應式:側邊欄在 md 中斷點折疊為漢堡選單,卡片堆疊為 1-2 欄
  • 載入狀態:使用與卡片/表格形狀相符的骨架佔位符,絕不造成版面偏移
  • 日期範圍選擇器用於篩選儀表板資料,預設為最近 30 天

佈局結構

┌──────────┬────────────────────────────┐
│ 側邊欄    │  標頭 / 麵包屑              │
│          ├────────────────────────────┤
│ 導航連結  │  KPI 卡片(3-4 欄網格)     │
│          ├────────────────────────────┤
│          │  圖表 / 圖形               │
│          ├────────────────────────────┤
│          │  資料表格                  │
└──────────┴────────────────────────────┘

模式

// KPI 卡片
function KPICard({ title, value, change }: { title: string; value: string; change: number }) {
  return (
    <Card>
      <CardHeader className="pb-2">
        <CardTitle className="text-sm font-medium text-muted-foreground">{title}</CardTitle>
      </CardHeader>
      <CardContent>
        <div className="text-2xl font-bold">{value}</div>
        <p className={cn("text-xs", change >= 0 ? "text-green-600" : "text-red-600")}>
          {change >= 0 ? "+" : ""}{change}% 相較於上一期
        </p>
      </CardContent>
    </Card>
  );
}

避免事項

  • 固定寬度的主內容區 ─ 一律使用填滿可用空間的流體佈局
  • 沒有分頁的表格 ─ 大型資料集會嚴重影響效能與可用性
  • 缺少載入/空狀態 ─ 務必顯示骨架或「無資料」訊息
  • 無法收合的側邊欄 ─ 行動裝置使用者需要完整的視窗寬度
  • 局部頁面更新使用旋轉載入器 ─ 針對特定區塊應使用骨架
  • 塞入過多 KPI ─ 突顯 3-5 個關鍵指標,其餘放在可展開區段中
  • 從零開始自訂側邊欄 ─ 使用 shadcn 的 sidebar 元件
  • 沒有動作按鈕的空狀態 ─ 一律包含 CTA(例如「尚無活動。建立你的第一個活動 →」)

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

YepAPI/skills

WCAG 2.1 AA — semantic HTML, keyboard navigation, screen readers.

YepAPI/skills

Experiment setup, variant splitting, statistical significance, and feature flag integration.

YepAPI/skills

CRUD generators, data tables, user management, role-based access, and bulk operations.

YepAPI/skills

Monitor what ChatGPT and Gemini say about your brand using YepAPI.

YepAPI/skills

Queue workers with BullMQ/Inngest/Trigger.dev, job retries, dead letter queues, concurrency.

YepAPI/skills

Commander.js, interactive prompts with Clack, spinners, colors, config files, exit codes, and npm publishing.

YepAPI/skills

cmdk integration, Cmd+K trigger, fuzzy search, grouped actions, keyboard navigation, and dynamic action registration.

YepAPI/skills

Content planning with trend and sentiment data from YepAPI.

YepAPI/skills

Content calendar, keyword-driven planning, and content briefs.

YepAPI/skills

Theme switching with CSS variables, system preference detection, next-themes, and persistence.

YepAPI/skills

Threaded comments, @mentions, reactions, moderation queue, optimistic UI, and cursor pagination.

YepAPI/skills

Competitive analysis between domains using YepAPI.

YepAPI/skills

Data encryption — TLS everywhere, AES-256-GCM for PII, bcrypt passwords, encrypted backups.

YepAPI/skills

Chart patterns with Recharts/Nivo/D3, responsive containers, color scales, and accessibility.

YepAPI/skills

Drizzle schema definition, push vs migrate, type-safe queries, relations, transactions, and prepared statements.

YepAPI/skills

Upload handling, resize/compress, CDN delivery, blur placeholders, and next/image patterns.

YepAPI/skills

Local business and Google Maps research using YepAPI.

YepAPI/skills

Cursor-based pagination, IntersectionObserver, virtualized lists with @tanstack/react-virtual, and scroll position restoration.

YepAPI/skills

Tenant isolation (row-level vs schema), subdomain routing, per-tenant config, and data partitioning.

YepAPI/skills

Chat UI components, streaming responses with AI SDK, context window management, and RAG patterns.

相關技能