Database Schema Explorer
A database schema browser listing tables with their row counts. Selecting a table expands its column list, showing each column's type, a PK/FK badge on key columns, and whether it's nullable. Built for internal admin tools and database documentation pages.
Docs
Installation
A real shadcn registry command, not a copy-paste stand-in: it fetches this block plus its badge dependencies and any missing npm packages, and installs them straight into your project.
npx shadcn add https://staaarter.com/r/database-schema-explorer.jsonPrefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/devtools/devtools20.tsx instead.
Usage
The file also exports devtools20Demo, the exact props behind the preview above. Spread it to get a working section in one line, then replace it with your own data.
import { Devtools20, devtools20Demo } from "@/components/blocks/devtools/devtools20"; export default function Page() { return <Devtools20 {...devtools20Demo} />; }
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| heading | string | "Database Schema" | Section heading. |
| description | string | undefined | Section intro text below the heading. |
| tables | DatabaseTable[] | none | Table rows, each with its own column list. |
| defaultExpandedIds | string[] | [] | Table ids expanded on first render. |
| className | string | none | Extra classes for the outer section element. |
Types
type TableColumn = { name: string; type: string; nullable: boolean; key?: "PK" | "FK"; }; type DatabaseTable = { id: string; name: string; rowCount: string; columns: TableColumn[]; };
Behavior notes
- Table expand/collapse is real local state (a Set of expanded table ids) seeded once from defaultExpandedIds; it does not query any real database, it only reveals the static columns already supplied for that table.
- rowCount is a plain caller-supplied string (e.g. "8,204 rows"); the component does not count rows or connect to any data source.
- PK/FK badges are decorative labels driven by each column's key field; there is no foreign-key relationship diagram or click-through to the referenced table.
- Tables render in the order given with no reordering, search, or filtering.
More DevTools Blocks
View all →api-endpoints-sample-call
API Endpoints With Sample Call
Reference list of API endpoints paired with a live sample request and response panel.
cicd-pipeline-status
CI/CD Pipeline Status
Recent CI/CD pipeline runs with per-stage status chips and overall run badges.
code-diff-viewer
Code Diff Viewer
Unified code diff panel with a file header change summary and colored addition/deletion lines.
keyboard-shortcuts-reference
Keyboard Shortcuts Reference
Grouped keyboard shortcut reference with keycap-styled key combos.
performance-waterfall
Performance Waterfall
Network request waterfall chart with cascading timing bars colored by duration.
service-health-board
Service Health Board
Infrastructure status board with a live summary strip and per-service uptime, latency, and health.