BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/solanaui/pool-table

Pool Table

solanaui/pool-table
FreeComponent

A sortable table of liquidity pools with token icon groups, TVL, volume, APY, and rewards columns.

Live preview

live · rendered by the registry
Rendered by solanaui on their own page — this is the component running, not a screenshot of it.

Install it

npx shadcn@latest add https://www.solanaui.dev/r/pool-table.json

Source

src/registry/sol/pool-table.tsxwww.solanaui.dev/r/pool-table.json
1"use client";
2
3import { ChevronDownIcon, ChevronUpIcon } from "lucide-react";
4import React from "react";
5import { TokenIconGroup } from "@/registry/sol/token-icon-group";
6import {
7 Table,
8 TableBody,
9 TableCell,
10 TableHead,
11 TableHeader,
12 TableRow,
13} from "@/components/ui/table";
14import type { SortDirection } from "@/registry/lib/sort-utils";
15import { compareValues } from "@/registry/lib/sort-utils";
16import { cn } from "@/lib/utils";
17
18interface PoolTableColumn {
19 key: string;
20 label: string;
21 className?: string;
22}
23
24interface PoolTableRow {
25 icons: { src: string; alt?: string }[];
26 name?: string;
27 data: Record<string, string>;
28}
29
30interface PoolTableProps {
31 columns: PoolTableColumn[];
32 rows: PoolTableRow[];
33 actions?: React.ReactNode[];
34 className?: string;
35}
36
37const PoolTable = ({ columns, rows, actions, className }: PoolTableProps) => {
38 const showActions = actions && actions.length > 0;
39 const [sortKey, setSortKey] = React.useState<string | null>(null);
40 const [sortDirection, setSortDirection] = React.useState<SortDirection>(null);
41
42 const handleSort = (key: string) => {
43 if (sortKey !== key) {
44 setSortKey(key);
45 setSortDirection("asc");
46 } else if (sortDirection === "asc") {
47 setSortDirection("desc");
48 } else {
49 setSortKey(null);
50 setSortDirection(null);
51 }
52 };
53
54 const sortedIndices = React.useMemo(() => {
55 const indices = rows.map((_, i) => i);
56 if (!sortKey || !sortDirection) return indices;
57
58 return indices.sort((a, b) => {
59 let valA: string;
60 let valB: string;
61
62 if (sortKey === "__name__") {
63 valA =
64 rows[a].name ??
65 rows[a].icons
66 .map((t) => t.alt)
67 .filter(Boolean)
68 .join("/");
69 valB =
70 rows[b].name ??
71 rows[b].icons
72 .map((t) => t.alt)
73 .filter(Boolean)
74 .join("/");
75 } else {
76 valA = rows[a].data[sortKey] ?? "";
77 valB = rows[b].data[sortKey] ?? "";
78 }
79
80 const result = compareValues(valA, valB);
81 return sortDirection === "desc" ? -result : result;
82 });
83 }, [rows, sortKey, sortDirection]);
84
85 return (
86 <Table className={className}>
87 <TableHeader>
88 <TableRow>
89 <TableHead>
90 <button
91 type="button"
92 onClick={() => handleSort("__name__")}
93 className={cn(
94// … truncated

What it pulls in

npm packages

  • lucide-react

Other registry items

  • table
  • https://solanaui.dev/r/token-icon-group.json
  • https://solanaui.dev/r/sol-lib-sort-utils.json

Files it writes

  • src/registry/sol/pool-table.tsx

Facts

Registry
solanaui
Type
registry:component
Access
Free
Files written
1
Licence
the repository states none
First indexed
2026-08-03
Last confirmed
yesterday

Go to the source

Docs on solanaui www.solanaui.dev chambaz/solanaui on GitHub Raw registry item This item as JSON

More from solanaui

All 31 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Action Boxaction-boxsolanauiComponentsFreeno deps
Activity Feedactivity-feedsolanauiComponentsFree1 dep
Address Displayaddress-displaysolanauiComponentsFree1 dep
Auth Cardauth-cardsolanauiComponentsFreeno deps
Health Barhealth-barsolanauiComponentsFreeno deps
Leverage Sliderleverage-slidersolanauiComponentsFreeno deps
NFT Cardnft-cardsolanauiComponentsFreeno deps
Order Bookorder-booksolanauiComponentsFreeno deps
BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex