# TableSkeleton

Loading rows with real table headings and matching column widths.

Connect Flood once using [the installation guide](https://flood.md/docs/installation). Then import the components you use; no per-component add command is needed.

## Example

```tsx
"use client";

import { FloodRoot, TableSkeleton } from "@flood-md/react";
import "@flood-md/react/styles.css";

export function Example() {
  return (
    <FloodRoot>
      <TableSkeleton caption="Workspace projects" rows={4} columns={[
        {id:"project",label:"Project",width:"70%",placeholderLines:2},
        {id:"members",label:"Members",width:"30%",align:"end"}
      ]} />
    </FloodRoot>
  );
}
```

## Design notes

- Use during initial loading of a plain Table. Keep the expected column widths, caption, density and row count. Use placeholderLines=2 where the eventual cell has a title and secondary line.
- Body placeholders are decorative. TableSkeleton marks its table busy and announces loading once by default. Use announce=false when the host already owns that message.
- For DataTable, use its skeleton loading appearance and column placeholderLines so selection, resize and other column tracks keep their geometry.

## API reference

| Prop | Values | Default |
| --- | --- | --- |
| `caption` | `string` | `Required` |
| `hideCaption` | `boolean` | `—` |
| `density` | `"compact" \| "comfortable"` | `—` |
| `striped` | `boolean` | `—` |
| `scrollLabel` | `string` | `—` |
| `maxViewportHeight` | `CSSProperties["maxBlockSize"]` | `—` |
| `stickyHeader` | `boolean` | `—` |
| `cellVerticalAlign` | `"top" \| "middle" \| "bottom"` | `—` |
| `columns` | `readonly TableSkeletonColumn[]` | `Required` |
| `rows` | `number` | `4` |
| `animate` | `boolean` | `true` |
| `announce` | `boolean` | `true` |
| `loadingLabel` | `string` | `"Loading rows…"` |
| `Native HTML props` | `Omit<Omit<TableHTMLAttributes<HTMLTableElement>, "children">, "children" \| "aria-busy">` | `Forwarded` |
