Ir al contenido
Español

Cómo funciona

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.

Úsalo para

  • 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.

Busca otra opción cuando

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

Uso

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}
    />
  )
}

Propiedades

PropiedadTipoPor defectoQué hace
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.

Accesibilidad

  • 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.

Movimiento

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.

Añádelo a tu proyecto

Copia la instrucción en Codex o Claude Code. El agente lee el código publicado, te muestra lo que va a escribir y añade el componente junto a los tuyos.

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

Los dos archivos se instalan juntos. La hoja de estilos lee las variables de tokens.css y lleva valores de reserva, así que también funciona sola.

Tablas
Tabla comparativa viene con Pro. La vista previa aparece al desbloquearlo.
Tabla con barras de datos viene con Pro. La vista previa aparece al desbloquearlo.