Table
Structured data grid with header, body, and footer slots. Header cells reserve space for right-aligned icons like sorting.
Playground
Live preview
Hunt | Region | Status | Reward | Actions |
|---|---|---|---|---|
| Midnight Vault | EU-West | Live | 240 PH | |
| Neon Harbor | US-East | Live | 180 PH | |
| Static Ridge | AP-South | Review | 95 PH | |
| Ghost Circuit | EU-North | Draft | — | |
| Total rewards | 515 PH | |||
Examples
Long cell content
Full synthetic wallet addresses and long headers wrap within fixed columns while neighboring values remain readable.
| Full wallet address | TransactionReferenceWithoutSpaces | Balance |
|---|---|---|
| 0x1234567890abcdef1234567890abcdef12345678 | abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789 | 1,234.56 PH |
| 0x0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef | A long description with spaces wraps naturally as the row grows. | 98.00 PH |
Examples
Sortable columns
Hunt | Region | Status | Reward |
|---|---|---|---|
| Midnight Vault | EU-West | Live | 240 PH |
| Neon Harbor | US-East | Live | 180 PH |
| Static Ridge | AP-South | Review | 95 PH |
| Ghost Circuit | EU-North | Draft | — |
| Total rewards | 515 PH | ||
Row actions
| Hunter | Wallet | Hunts | Volume | Actions |
|---|---|---|---|---|
| Kael Voss | 0x71c…9f2a | 24 | 3.2k PH | |
| Mira Chen | 0x3ab…d081 | 17 | 1.8k PH | |
| Dario Lenz | 0x9e0…44bd | 9 | 740 PH |
Column alignment
| Asset | Holdings | Value |
|---|---|---|
| PH Token | 1,240 | 3.2k PH |
| Guild Badge | 3 | 180 PH |
| Hunter Pass | 1 | 95 PH |
| Total | 3.5k PH | |
Plain
| Key | Value |
|---|---|
| Chain | Polygon |
| Token | PH |
| Decimals | 18 |
Code
import {
IconButton,
Table,
TableBody,
TableCell,
TableEmpty,
TableHead,
TableHeader,
TableRow,
} from "@npolyhunter/ui";
import {
EyeBoldDuotoneIcon,
MenuDotsBoldDuotoneIcon,
PenBoldDuotoneIcon,
SortBoldDuotoneIcon,
TrashBinTrashBoldDuotoneIcon,
} from "@npolyhunter/ui/icons";
// Header cells are 44px, surface-subtle bg, border-subtle bottom border.
// Leave space on the right for icons (sort, filter, menu…) — a flex row
// with justify-between does it.
// Use the align prop ("left" default | "center" | "right") on TableHead
// and TableCell to align columns — numeric columns are usually right.
// Text wraps by default, including unbroken addresses and URLs. Use
// table-fixed + colgroup to keep long content within assigned column widths.
<TableHead align="right">Value</TableHead>
<TableCell align="right">3.2k PH</TableCell>
<Table>
<TableHeader>
<TableRow>
<TableHead>
<div className="flex items-center justify-between gap-2">
Hunt
<IconButton size="small" aria-label="Sort by hunt">
<SortBoldDuotoneIcon />
</IconButton>
</div>
</TableHead>
<TableHead>Region</TableHead>
</TableRow>
</TableHeader>
<TableBody>
<TableRow>
<TableCell>Midnight Vault</TableCell>
<TableCell>EU-West</TableCell>
</TableRow>
</TableBody>
</Table>
// Empty state: the container gradient shows through, and TableEmpty
// provides the centered message style.
<Table>
<TableHeader>…</TableHeader>
<TableBody>
<TableRow>
<TableEmpty colSpan={2}>No hunts found.</TableEmpty>
</TableRow>
</TableBody>
</Table>
// Row actions: a right-aligned column of IconButtons. Use an sr-only
// TableHead so the column stays accessible, and justify-end to cluster
// the icons on the right.
<Table>
<TableHeader>
<TableRow>
<TableHead>Hunter</TableHead>
<TableHead>
<span className="sr-only">Actions</span>
</TableHead>
</TableRow>
</TableHeader>
<TableBody>
<TableRow>
<TableCell>Kael Voss</TableCell>
<TableCell>
<div className="flex items-center justify-end gap-1">
<IconButton size="small" aria-label="View hunter">
<EyeBoldDuotoneIcon />
</IconButton>
<IconButton size="small" aria-label="Edit hunter">
<PenBoldDuotoneIcon />
</IconButton>
<IconButton
size="small"
variant="destructive"
aria-label="Delete hunter"
>
<TrashBinTrashBoldDuotoneIcon />
</IconButton>
<IconButton size="small" aria-label="More actions">
<MenuDotsBoldDuotoneIcon />
</IconButton>
</div>
</TableCell>
</TableRow>
</TableBody>
</Table>Code
import {
IconButton,
Table,
TableBody,
TableCell,
TableEmpty,
TableHead,
TableHeader,
TableRow,
} from "@npolyhunter/ui";
import {
EyeBoldDuotoneIcon,
MenuDotsBoldDuotoneIcon,
PenBoldDuotoneIcon,
SortBoldDuotoneIcon,
TrashBinTrashBoldDuotoneIcon,
} from "@npolyhunter/ui/icons";
// Header cells are 44px, surface-subtle bg, border-subtle bottom border.
// Leave space on the right for icons (sort, filter, menu…) — a flex row
// with justify-between does it.
// Use the align prop ("left" default | "center" | "right") on TableHead
// and TableCell to align columns — numeric columns are usually right.
// Text wraps by default, including unbroken addresses and URLs. Use
// table-fixed + colgroup to keep long content within assigned column widths.
<TableHead align="right">Value</TableHead>
<TableCell align="right">3.2k PH</TableCell>
<Table>
<TableHeader>
<TableRow>
<TableHead>
<div className="flex items-center justify-between gap-2">
Hunt
<IconButton size="small" aria-label="Sort by hunt">
<SortBoldDuotoneIcon />
</IconButton>
</div>
</TableHead>
<TableHead>Region</TableHead>
</TableRow>
</TableHeader>
<TableBody>
<TableRow>
<TableCell>Midnight Vault</TableCell>
<TableCell>EU-West</TableCell>
</TableRow>
</TableBody>
</Table>
// Empty state: the container gradient shows through, and TableEmpty
// provides the centered message style.
<Table>
<TableHeader>…</TableHeader>
<TableBody>
<TableRow>
<TableEmpty colSpan={2}>No hunts found.</TableEmpty>
</TableRow>
</TableBody>
</Table>
// Row actions: a right-aligned column of IconButtons. Use an sr-only
// TableHead so the column stays accessible, and justify-end to cluster
// the icons on the right.
<Table>
<TableHeader>
<TableRow>
<TableHead>Hunter</TableHead>
<TableHead>
<span className="sr-only">Actions</span>
</TableHead>
</TableRow>
</TableHeader>
<TableBody>
<TableRow>
<TableCell>Kael Voss</TableCell>
<TableCell>
<div className="flex items-center justify-end gap-1">
<IconButton size="small" aria-label="View hunter">
<EyeBoldDuotoneIcon />
</IconButton>
<IconButton size="small" aria-label="Edit hunter">
<PenBoldDuotoneIcon />
</IconButton>
<IconButton
size="small"
variant="destructive"
aria-label="Delete hunter"
>
<TrashBinTrashBoldDuotoneIcon />
</IconButton>
<IconButton size="small" aria-label="More actions">
<MenuDotsBoldDuotoneIcon />
</IconButton>
</div>
</TableCell>
</TableRow>
</TableBody>
</Table>Used in
Includes use through shared UI components.
AppBack Office
