Token导航 LogoToken导航TokenDH.com
前端设计需要联网github未标认证来源可访问clear审计通过

creating-dashboards创建仪表板

Agent Skill

用于辅助前端页面、组件、样式和交互逻辑的开发与维护。它适合让 Agent 生成或审查 React、Next.js、Vue、Tailwind、CSS 等相关代码,整理组件结构,或定位布局和性能问题。使用时需要结合项目现有设计系统、路由和构建方式,避免只生成孤立片段;涉及页面改动时,应配合本地预览和构建检查确认视觉效果。

总安装

5,574

周安装

237

GitHub Stars

350

下载量

1,953
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:creating-dashboards(创建仪表板)
来源仓库:https://github.com/ancoleman/ai-design-components
仓库路径:skills/creating-dashboards
安装命令:
npx skills add https://github.com/ancoleman/ai-design-components --skill creating-dashboards
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/ancoleman/ai-design-components --skill creating-dashboards

简介

用于辅助前端页面、组件、样式和交互逻辑的开发与维护。

  • 适合生成或审查 React、Next.js、Vue、Tailwind、CSS 等相关代码,整理组件结构。
  • 结合项目现有设计系统、路由和构建方式使用,避免生成孤立片段。
  • 涉及页面改动时需配合本地预览和构建检查确认视觉效果。
  • creating-dashboards 属于前端设计类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Creating Dashboards

Purpose

This skill enables the creation of sophisticated dashboard interfaces that aggregate and present data through coordinated widgets including KPI cards, charts, tables, and filters. Dashboards serve as centralized command centers for data-driven decision making, combining multiple component types from other skills (data-viz, tables, design-tokens) into unified analytics experiences with real-time updates, responsive layouts, and interactive filtering.

When to Use

Activate this skill when:

  • Building business intelligence or analytics dashboards
  • Creating executive reporting interfaces
  • Implementing real-time monitoring systems
  • Designing KPI displays with metrics and trends
  • Developing customizable widget-based layouts
  • Coordinating filters across multiple data displays
  • Building responsive data-heavy interfaces
  • Implementing drag-and-drop dashboard editors
  • Creating template-based analytics systems
  • Designing multi-tenant SaaS dashboards

Core Dashboard Elements

KPI Card Anatomy

┌────────────────────────────┐
│ Revenue (This Month)       │ ← Label with time period
│                            │
│  $1,245,832               │ ← Big number (primary metric)
│  ↑ 15.3% vs last month    │ ← Trend indicator with comparison
│  ▂▃▅▆▇█ (sparkline)       │ ← Mini visualization
└────────────────────────────┘

Widget Container Structure

  • Title bar with widget name and actions
  • Loading state (skeleton or spinner)
  • Error boundary with retry option
  • Resize handles for adjustable layouts
  • Settings menu (export, configure, refresh)

Dashboard Layout Types

Fixed Layout: Designer-defined placement, consistent across users Customizable Grid: User drag-and-drop, resizable widgets, saved layouts Template-Based: Pre-built patterns, industry-specific starting points

Global Dashboard Controls

  • Date range picker (affects all widgets)
  • Filter panel (coordinated across widgets)
  • Refresh controls (manual/auto-refresh)
  • Export actions (PDF, image, data)
  • Theme switcher (light/dark/custom)

Implementation Approach

1. Choose Dashboard Architecture

For Quick Analytics Dashboard → Use Tremor Pre-built KPI cards, charts, and tables with minimal code:

npm install @tremor/react

For Customizable Dashboard → Use react-grid-layout Drag-and-drop, resizable widgets, user-defined layouts:

npm install react-grid-layout

2. Set Up Global State Management

Implement filter context for cross-widget coordination:

// Dashboard context for shared filters
const DashboardContext = createContext({
  filters: { dateRange: null, categories: [] },
  setFilters: () => {},
  refreshInterval: 30000
});

// Wrap dashboard with provider
<DashboardContext.Provider value={dashboardState}>
  <FilterPanel />
  <WidgetGrid />
</DashboardContext.Provider>

3. Implement Data Fetching Strategy

Parallel Loading: Fetch all widget data simultaneously Lazy Loading: Load visible widgets first, others on scroll Cached Updates: Serve from cache while fetching fresh data

4. Configure Real-Time Updates

Server-Sent Events (Recommended for Dashboards):

const eventSource = new EventSource('/api/dashboard/stream');
eventSource.onmessage = (event) => {
  const update = JSON.parse(event.data);
  updateWidget(update.widgetId, update.data);
};

5. Apply Responsive Design

Define breakpoints for different screen sizes:

  • Desktop (>1200px): Multi-column grid
  • Tablet (768-1200px): 2-column layout
  • Mobile (<768px): Single column stack

Quick Start with Tremor

Basic KPI Dashboard

import { Card, Grid, Metric, Text, BadgeDelta, AreaChart } from '@tremor/react';

function QuickDashboard({ data }) {
  return (
    <Grid numItems={1} numItemsSm={2} numItemsLg={4} className="gap-4">
      {/* KPI Cards */}
      <Card>
        <Text>Total Revenue</Text>
        <Metric>$45,231.89</Metric>
        <BadgeDelta deltaType="increase">+12.5%</BadgeDelta>
      </Card>

      <Card>
        <Text>Active Users</Text>
        <Metric>1,234</Metric>
        <BadgeDelta deltaType="decrease">-2.3%</BadgeDelta>
      </Card>

      {/* Chart Widget */}
      <Card className="lg:col-span-2">
        <Text>Revenue Trend</Text>
        <AreaChart
          data={data.revenue}
          index="date"
          categories={["revenue"]}
          valueFormatter={(value) => `$${value.toLocaleString()}`}
        />
      </Card>
    </Grid>
  );
}

For complete implementation, see examples/tremor-dashboard.tsx.

Customizable Dashboard Implementation

Drag-and-Drop Grid Layout

import { Responsive, WidthProvider } from 'react-grid-layout';
import 'react-grid-layout/css/styles.css';

const ResponsiveGridLayout = WidthProvider(Responsive);

function CustomizableDashboard() {
  const [layouts, setLayouts] = useState(getStoredLayouts());

  return (
    <ResponsiveGridLayout
      layouts={layouts}
      breakpoints={{ lg: 1200, md: 996, sm: 768 }}
      cols={{ lg: 12, md: 10, sm: 6 }}
      rowHeight={60}
      onLayoutChange={(layout, layouts) => {
        setLayouts(layouts);
        localStorage.setItem('dashboardLayout', JSON.stringify(layouts));
      }}
      draggableHandle=".widget-header"
    >
      <div key="kpi1">
        <KPIWidget data={kpiData} />
      </div>
      <div key="chart1">
        <ChartWidget data={chartData} />
      </div>
      <div key="table1">
        <TableWidget data={tableData} />
      </div>
    </ResponsiveGridLayout>
  );
}

For full example with widget catalog, see examples/customizable-dashboard.tsx.

Real-Time Data Patterns

Server-Sent Events (Recommended)

Best for unidirectional updates from server to dashboard:

function useSSEUpdates(endpoint) {
  useEffect(() => {
    const eventSource = new EventSource(endpoint);

    eventSource.onmessage = (event) => {
      const update = JSON.parse(event.data);
      // Update specific widget or all widgets
      dispatch({ type: 'UPDATE_WIDGET', payload: update });
    };

    return () => eventSource.close();
  }, [endpoint]);
}

WebSocket (For Bidirectional)

Use when dashboard needs to send commands back to server:

const ws = new WebSocket('ws://localhost:3000/dashboard');
ws.onmessage = (event) => {
  const data = JSON.parse(event.data);
  updateDashboard(data);
};
// Send filter changes to server
ws.send(JSON.stringify({ type: 'FILTER_CHANGE', filters }));

Smart Polling Fallback

For environments without WebSocket/SSE support:

function useSmartPolling(fetchData, interval = 30000) {
  const [isPaused, setIsPaused] = useState(false);

  useEffect(() => {
    if (isPaused || document.hidden) return;

    const timer = setInterval(fetchData, interval);
    return () => clearInterval(timer);
  }, [isPaused, interval]);

  // Pause when tab inactive
  useEffect(() => {
    const handleVisibilityChange = () => {
      setIsPaused(document.hidden);
    };
    document.addEventListener('visibilitychange', handleVisibilityChange);
    return () => document.removeEventListener('visibilitychange', handleVisibilityChange);
  }, []);
}

For detailed patterns including error handling and reconnection, see references/real-time-updates.md.

Performance Optimization

Lazy Loading Strategy

function DashboardGrid({ widgets }) {
  const [visibleWidgets, setVisibleWidgets] = useState(new Set());

  return widgets.map(widget => (
    <LazyLoad
      key={widget.id}
      height={widget.height}
      offset={100}
      once
      placeholder={<WidgetSkeleton />}
    >
      <Widget {...widget} />
    </LazyLoad>
  ));
}

Parallel Data Fetching

// Fetch all widget data simultaneously
const loadDashboard = async () => {
  const [kpis, charts, tables] = await Promise.all([
    fetchKPIs(),
    fetchChartData(),
    fetchTableData()
  ]);

  return { kpis, charts, tables };
};

Widget-Level Caching

function CachedWidget({ id, fetcher, ttl = 60000 }) {
  const cache = useRef({ data: null, timestamp: 0 });

  const getData = async () => {
    const now = Date.now();
    if (cache.current.data && now - cache.current.timestamp < ttl) {
      return cache.current.data;
    }

    const fresh = await fetcher();
    cache.current = { data: fresh, timestamp: now };
    return fresh;
  };

  // Use cached data while fetching fresh
  return <Widget data={cache.current.data} onRefresh={getData} />;
}

To analyze and optimize dashboard performance, run:

python scripts/optimize-dashboard-performance.py --analyze dashboard-config.json

Cross-Skill Integration

Using Data Visualization Components

Reference the data-viz skill for chart widgets:

// Use charts from data-viz skill
import { createChart } from '../data-viz/chart-factory';

const revenueChart = createChart('area', {
  data: revenueData,
  xAxis: 'date',
  yAxis: 'revenue',
  theme: dashboardTheme
});

Integrating Data Tables

Reference the tables skill for data grids:

// Use advanced tables from tables skill
import { DataGrid } from '../tables/data-grid';

<DataGrid
  data={transactions}
  columns={columnDefs}
  pagination={true}
  sorting={true}
  filtering={true}
/>

Applying Design Tokens

Use the design-tokens skill for consistent theming:

// Dashboard-specific tokens from design-tokens skill
const dashboardTokens = {
  '--dashboard-bg': 'var(--color-bg-secondary)',
  '--widget-bg': 'var(--color-white)',
  '--widget-shadow': 'var(--shadow-lg)',
  '--kpi-value-size': 'var(--font-size-4xl)',
  '--kpi-trend-positive': 'var(--color-success)',
  '--kpi-trend-negative': 'var(--color-error)'
};

Filter Input Components

Optionally use the forms skill for filter controls:

// Advanced filter inputs from forms skill
import { DateRangePicker, MultiSelect } from '../forms/inputs';

<FilterPanel>
  <DateRangePicker onChange={handleDateChange} />
  <MultiSelect options={categories} onChange={handleCategoryFilter} />
</FilterPanel>

Library Selection Guide

Choose Tremor When:

  • Need to build dashboards quickly
  • Want pre-styled, professional components
  • Using Tailwind CSS in your project
  • Building standard analytics interfaces
  • Limited customization requirements

Choose react-grid-layout When:

  • Users need to customize layouts
  • Drag-and-drop is required
  • Different users need different views
  • Building a dashboard builder tool
  • Maximum flexibility is priority

Combine Both When:

  • Use Tremor for widget contents (KPIs, charts)
  • Use react-grid-layout for layout management
  • Get best of both worlds

Bundled Resources

Scripts (Token-Free Execution)

  • scripts/generate-dashboard-layout.py - Generate responsive grid configurations
  • scripts/calculate-kpi-metrics.py - Calculate trends, comparisons, sparklines
  • scripts/validate-widget-config.py - Validate widget and filter configurations
  • scripts/optimize-dashboard-performance.py - Analyze and optimize performance
  • scripts/export-dashboard.py - Export dashboards to various formats

Run scripts directly without loading into context:

python scripts/calculate-kpi-metrics.py --data metrics.json --period monthly

References (Detailed Patterns)

  • references/kpi-card-patterns.md - KPI card design patterns and variations
  • references/layout-strategies.md - Grid systems and responsive approaches
  • references/real-time-updates.md - WebSocket, SSE, and polling implementations
  • references/filter-coordination.md - Cross-widget filter synchronization
  • references/performance-optimization.md - Advanced optimization techniques
  • references/library-guide.md - Detailed Tremor and react-grid-layout guides

Examples (Complete Implementations)

  • examples/sales-dashboard.tsx - Full sales analytics dashboard
  • examples/monitoring-dashboard.tsx - Real-time monitoring with alerts
  • examples/executive-dashboard.tsx - Polished executive reporting
  • examples/customizable-dashboard.tsx - Drag-and-drop with persistence
  • examples/tremor-dashboard.tsx - Quick Tremor implementation
  • examples/filter-context.tsx - Global filter coordination

Assets (Templates & Configurations)

  • assets/dashboard-templates.json - Pre-built dashboard layouts
  • assets/widget-library.json - Widget catalog and configurations
  • assets/grid-layouts.json - Responsive grid configurations
  • assets/kpi-formats.json - Number formatting rules
  • assets/theme-tokens.json - Dashboard-specific design tokens

Dashboard Creation Workflow

  1. Define Requirements: Fixed or customizable? Real-time or static?
  2. Choose Libraries: Tremor for quick, react-grid-layout for flexible
  3. Set Up Structure: Global state, filter context, layout system
  4. Build Widgets: KPI cards, charts (data-viz), tables (tables skill)
  5. Implement Data Flow: Fetching strategy, caching, updates
  6. Add Interactivity: Filters, drill-downs, exports
  7. Optimize Performance: Lazy loading, parallel fetching, caching
  8. Apply Theming: Use design-tokens for consistent styling
  9. Test Responsiveness: Desktop, tablet, mobile breakpoints
  10. Deploy & Monitor: Track performance, user engagement

For specific patterns and detailed implementations, explore the bundled resources referenced above.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

29.75%
按下载量换算581

Gemini CLI

23.62%
按下载量换算461

Antigravity

16.67%
按下载量换算326

OpenCode

14.41%
按下载量换算281

roo

7.94%
按下载量换算155

Cursor

4.11%
按下载量换算80

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

来源信息

继续浏览同类 Skills