本文へ移動
日本語

仕組み

A card with a filter row and a 40px-row table. Each status is a dot with a soft halo next to a label in a darker shade of the same colour, so it reads in text, not just colour. Statuses marked pulse send out a ring every 1.8 seconds. The chips show a live count per status; the selected chip turns ink with an inverted count. Changing the filter remounts the body so the matching rows fade up in turn, and a polite line under the table says how many are shown. The card is an inline-size container: columns marked hideBelow step out under 460px.

向いている場面

  • Service health, job queues, device fleets, order pipelines: many items, each in one of a few states.
  • When people mostly ask “which ones need attention?” and filter to that state.

向かない場面

  • A single status over time: use the tracker bar.
  • Rich rows with many actions: use a full data table.

使い方

import { StatusBoardTable } from './StatusBoardTable.jsx'

const statuses = {
  up: { label: 'Operational', tone: 'success' },
  degraded: { label: 'Degraded', tone: 'warning' },
  down: { label: 'Down', tone: 'danger', pulse: true },
}

export function Services({ services }) {
  return (
    <StatusBoardTable
      title="Services"
      caption="Service status"
      statuses={statuses}
      columns={[
        { key: 'name', title: 'Service' },
        { key: 'region', title: 'Region', hideBelow: true },
        { key: 'status', title: 'Status' },
        { key: 'latency', title: 'Latency', align: 'right' },
      ]}
      rows={services}
    />
  )
}

プロパティ

プロパティ型既定値説明
statusesRecord<string, { label: string, tone: 'success' | 'warning' | 'danger' | 'accent' | 'neutral' | string, pulse?: boolean }>—Every status in filter order. The column whose key equals statusKey renders as dot and label; pulse adds a soft ring for critical states.
columns{ key: string, title: ReactNode, align?: 'left' | 'right', width?: number | string, render?: (row) => ReactNode, hideBelow?: boolean }[]—The first column is the row header. hideBelow hides a column when the card is narrower than 460px.
rows / rowKey / statusKeyobject[] / (row, i) => key / string- / row.id ?? i / 'status'The data, a stable key, and the field that holds the status.
defaultFilter / filter / onFilterChangestring'all'Uncontrolled start filter, or a controlled one.
title / subtitle / captionReactNode / string—Heading of the card and the table's accessible caption.
labels{ all, filter, showing(n, total), empty }—Every built-in string.

アクセシビリティ

  • Filters are a radio group: one chip is in the Tab order, arrow keys move and select, and each chip reads its label and count.
  • Statuses are always text; the dot and the pulse are decorative.
  • The table has a caption, column headers and a row header; the “Showing n of total” line is a polite live region.
  • Reduced motion stops the pulse and the row entrance.

モーション

Rows: 320ms fade-up with a 30ms stagger after each filter change. Pulse: a ring that grows to 2.6× and fades every 1.8s.

プロジェクトに追加

プロンプトを Codex または Claude Code に貼り付けます。エージェントが公開ソースを読み、書き込む内容を示したうえで、既存のコンポーネントの隣に追加します。

StatusBoardTable.jsxstatus-board-table.csstokens.cssREADME.md

2 つのファイルを一緒に導入します。スタイルは tokens.css の変数を読み、予備の値も持つため、単体でも表示できます。

テーブル
「比較テーブル」は Pro に含まれます。解除するとプレビューが表示されます。
「データバー付きテーブル」は Pro に含まれます。解除するとプレビューが表示されます。