amankaushik481

Loading Table

Component

About

A skeleton placeholder for data tables that renders a header row and shimmering body rows while the real rows are still loading.

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

Code

How Loading Table 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 { LoadingTable } from "@/components/ui/loading-table";

export default function LoadingTableDemo() {
  const [isLoading, setIsLoading] = React.useState(true);

  React.useEffect(() => {
    const t = setTimeout(() => setIsLoading(false), 2000);
    return () => clearTimeout(t);
  }, []);

  const rows = [
    ["Ada Lovelace", "Engineering", "Active", "2024-01-12"],
    ["Grace Hopper", "Research", "Active", "2023-11-02"],
    ["Alan Turing", "Research", "Invited", "2024-03-21"],
  ];

  return (
    <div className="w-full max-w-xl">
      {isLoading ? (
        <LoadingTable rows={3} cols={4} label="Loading team members" />
      ) : (
        <div className="w-full overflow-hidden rounded-xl border border-border">
          <div className="grid grid-cols-4 border-b border-border bg-sunken px-3 py-3 text-xs font-medium text-fg">
            <span>Name</span>
            <span>Team</span>
            <span>Status</span>
            <span>Joined</span>
          </div>
          {rows.map((row) => (
            <div
              key={row[0]}
              className="grid grid-cols-4 border-b border-border px-3 py-3 text-sm last:border-b-0"
            >
              {row.map((cell) => (
                <span key={cell}>{cell}</span>
              ))}
            </div>
          ))}
        </div>
      )}
    </div>
  );
}

More by amankaushik481

View all
  • Chip Filter

    Chip Filter

    7
  • Icon Button

    Icon Button

    5
  • Background Boxes

    Background Boxes

    4
  • Emoji Picker

    Emoji Picker

    4
  • Morphing Text

    Morphing Text

    2
  • Typing Text

    Typing Text

    1
  • Treemap Chart

    Treemap Chart

    1
  • Particles

    Particles

    1