Mehi

Streaming Data Rows

Dashboards 6

About

An animated live table that inserts, updates, resorts and highlights changed cells as your app streams new rows in, with numeric value morphing, status pills, loading/empty/error states and reduced-motion support.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Streaming Data Rows to your project and fits it to your theme.

Code

How Streaming Data Rows is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

"use client";

import * as React from "react";
import StreamingDataRows, {
  StatusPill,
  type Column,
} from "@/components/ui/streaming-data-rows";

interface Trade {
  id: string;
  symbol: string;
  price: number;
  change: number;
  status: string;
}

const initialRows: Trade[] = [
  { id: "1", symbol: "AAPL", price: 189.32, change: 0.4, status: "active" },
  { id: "2", symbol: "MSFT", price: 412.18, change: -0.2, status: "pending" },
  { id: "3", symbol: "NVDA", price: 924.5, change: 1.1, status: "success" },
  { id: "4", symbol: "TSLA", price: 176.42, change: -0.8, status: "warning" },
];

const columns: Column<Trade>[] = [
  { key: "symbol", header: "Symbol", value: (r) => r.symbol },
  {
    key: "price",
    header: "Price",
    align: "end",
    sortable: true,
    numeric: true,
    value: (r) => r.price,
    format: (n) => `$${n.toFixed(2)}`,
  },
  {
    key: "change",
    header: "Change",
    align: "end",
    numeric: true,
    value: (r) => r.change,
    format: (n) => `${n > 0 ? "+" : ""}${n.toFixed(2)}%`,
  },
  {
    key: "status",
    header: "Status",
    value: (r) => r.status,
    render: (r) => <StatusPill status={r.status} />,
  },
];

export default function StreamingDataRowsDemo() {
  const [rows, setRows] = React.useState(initialRows);

  React.useEffect(() => {
    const id = setInterval(() => {
      setRows((prev) =>
        prev.map((row) => ({
          ...row,
          price: Math.max(1, row.price + (Math.random() - 0.5) * 4),
          change: (Math.random() - 0.5) * 2,
        })),
      );
    }, 2000);
    return () => clearInterval(id);
  }, []);

  return (
    <div className="w-full max-w-2xl p-6">
      <StreamingDataRows
        rows={rows}
        columns={columns}
        getRowId={(r) => r.id}
        caption="Live trades"
      />
    </div>
  );
}

Dependencies

More by Mehi

View all
  • Border Beam Panel

    Border Beam Panel

    929
  • Compare Reveal

    Compare Reveal

    304
  • Decrypt Text

    Decrypt Text

    240
  • Holo Card

    Holo Card

    220
  • Magnetic Dock

    Magnetic Dock

    157
  • Luminous Topography

    Luminous Topography

    106
  • Lens Card

    Lens Card

    83
  • Copperplate Hatch

    Copperplate Hatch

    59

More in Dashboards

View all
  • Dashboard with Collapsible Sidebar

    Dashboard with Collapsible Sidebar

    2.4K
  • Sidebar

    Sidebar

    234
  • SaaS Template

    SaaS Template

    2.4K
  • Chat template

    Chat template

    598
  • Stats Bento

    Stats Bento

    1.1K
  • Financial Bento Grid

    Financial Bento Grid

    71
  • Statistics Card 2

    Statistics Card 2

    264
  • Course Design Cards

    Course Design Cards

    1.1K