科研技能库/统计显示
图表可视化
未发现用户侧风险

统计显示

当需要展示关键指标和统计数据时使用。

文件预览

2 个文件
references
SKILL.md
4.0 KB · 可预览
---
name: statistics
description: "Use when you need to display key metrics and statistics."
metadata:
  id: statistics
  category: data-display
  pattern: Statistics Display
  source: uxpatterns.dev
  url: https://uxpatterns.dev/patterns/data-display/statistics
  sourcePath: apps/web/content/patterns/data-display/statistics.mdx
---

# Statistics Display

Display key metrics and statistics

## What it solves

A **Statistics Display** pattern helps teams create a reliable way to surface a small set of key metrics with enough context that users can judge direction, magnitude, and urgency quickly. It is most useful when teams need headline KPI strips.
Compared with adjacent patterns, this pattern should reduce friction without hiding the state, rules, or recovery paths people need to keep moving.

## When to use

- Headline KPI strips
- Status cards in dashboards
- Summary metrics on landing pages

## When to avoid

- Use a simpler view when users only need one or two values and not the full layout.
- Avoid this pattern when the task is creation or editing rather than interpretation.
- Do not force the same view onto mobile if another representation would be clearer.

## Implementation workflow

1. Confirm the pattern matches the problem and constraints before copying the example.
2. Start from the anatomy and examples in `references/pattern.md`, then choose the smallest viable variation.
3. Apply accessibility, performance, and interaction guardrails before layering visual polish.
4. Use the testing guidance to verify behavior across keyboard, screen reader, responsive, and failure scenarios.

## Accessibility guardrails

### Keyboard Interaction
- [ ] Verify that statistics display can be completed using keyboard alone.
- [ ] Keep focus order logical when the pattern opens, updates, or reveals additional UI.
- [ ] Preserve a visible focus state that is still readable at high zoom.
### Screen Reader Support
- [ ] Use semantic elements first, then add ARIA only where semantics alone are not enough.
- [ ] Announce state changes such as errors, loading, or completion in the right place and with the right politeness.
- [ ] Connect labels, hints, and status text with `aria-describedby` or structural headings when useful.
### Visual Accessibility
- [ ] Do not rely on color alone to convey severity, completion, or selection state.

## Performance guardrails

- Measure the cost of rendering the default view before adding richer adornments such as nested actions, charts, or inline filters.
- Use [pagination](/glossary/pagination), windowing, or progressive disclosure when the layout would otherwise render too many items at once.
- Stabilize heights and placeholder geometry so loading and data refresh states do not cause large layout shifts.

## Common mistakes

### **Choosing the layout before the task**

**The Problem:**
Teams often pick a visually familiar pattern before confirming whether users need comparison, exploration, or scanning.

**How to Fix It?**
Start from the user task, then map the layout to comparison, chronology, hierarchy, or overview needs.

### **Ignoring non-happy states**

**The Problem:**
A polished default view still feels broken when loading, empty, and error states are inconsistent.

**How to Fix It?**
Design the data lifecycle up front, including empty, partial, stale, and failed results.

### **Shipping a desktop-only density model**

**The Problem:**
Large tables, dense dashboards, and heavy cards collapse quickly on small screens.

**How to Fix It?**
Define a mobile strategy such as stacked cards, progressive disclosure, or alternate summaries before implementation.

## Related patterns

- https://uxpatterns.dev/patterns/data-display/chart
- https://uxpatterns.dev/patterns/data-display/comparison-table
- https://uxpatterns.dev/patterns/data-display/dashboard

---

For full implementation detail, examples, and testing notes, see `references/pattern.md`.

Pattern page: https://uxpatterns.dev/patterns/data-display/statistics

SKILL.md

元数据
namestatistics
description当需要展示关键指标和统计数据时使用。
metadata{ "id": "statistics", "category": "data-display", "pattern": "统计显示", "source": "uxpatterns.dev", "url": "https://uxpatterns.dev/patterns/data-display/statistics", "sourcePath": "apps/web/content/patterns/data-display/statistics.mdx" }

统计显示

展示关键指标和统计数据。

解决的问题

统计显示模式帮助团队创建一种可靠的方式,以足够的上下文展示少量关键指标,让用户能够快速判断方向、量级和紧迫性。在团队需要标题KPI条时最有用。 与相邻模式相比,此模式应在不隐藏用户继续操作所需的状态、规则或恢复路径的情况下减少阻力。

何时使用

  • 标题KPI条
  • 仪表板中的状态卡片
  • 着陆页上的摘要指标

何时避免

  • 当用户只需求一两个值而不需要完整布局时,使用更简单的视图。
  • 当任务是创建或编辑而非解读时,避免使用此模式。
  • 不要将相同的视图强加给移动端,如果有更清晰的表示方式。

实现工作流

  1. 在复制示例之前,确认模式与问题和约束相匹配。
  2. 从references/pattern.md中的结构和示例开始,然后选择最小的可行变体。
  3. 在添加视觉润色之前,应用无障碍、性能和交互护栏。
  4. 使用测试指南验证键盘、屏幕阅读器、响应式和失败场景下的行为。

无障碍护栏

键盘交互

  • 验证统计显示可以仅使用键盘完成。
  • 当模式打开、更新或显示额外UI时,保持焦点顺序合乎逻辑。
  • 保留在高缩放比下仍可读的可见焦点状态。

屏幕阅读器支持

  • 优先使用语义化元素,然后仅在语义化不足时添加ARIA。
  • 在正确的位置以合适的礼貌方式播报状态变化,例如错误、加载中或完成。
  • 在有用时,使用aria-describedby或结构性标题连接标签、提示和状态文本。

视觉无障碍

  • 不要仅依赖颜色来传达严重程度、完成状态或选择状态。

性能护栏

  • 在添加更丰富的装饰(如嵌套操作、图表或内联筛选器)之前,衡量渲染默认视图的成本。
  • 当布局可能一次渲染过多项目时,使用分页、窗口化或渐进式显示。
  • 稳定高度和占位符几何形状,使加载和数据刷新状态不会导致大的布局偏移。

常见错误

在明确任务之前选择布局

问题: 团队通常在选择视觉上熟悉的模式之前,未确认用户是否需要比较、探索或浏览。

如何解决? 从用户任务出发,然后将布局映射到比较、时间顺序、层级或概览需求。

忽略非正常状态

问题: 即使精心设计的默认视图,在加载、空状态和错误状态不一致时,仍会感觉有缺陷。

如何解决? 预先设计数据生命周期,包括空结果、部分结果、过时结果和失败结果。

交付仅限桌面端的密度模型

问题: 大表格、密集仪表板和重型卡片在小屏幕上迅速崩溃。

如何解决? 在实施前定义移动端策略,例如堆叠卡片、渐进式显示或备用摘要。

相关模式


有关完整的实现细节、示例和测试说明,请参阅references/pattern.md。

模式页面:https://uxpatterns.dev/patterns/data-display/statistics