Env Table
Read-only environment variable table with masked values, click-to-reveal, per-row copy, and bulk copy as .env format. Designed for settings pages, deploy previews, and documentation.
Preview
Environment Variables
6Stripe live API key. Never expose client-side.
GitHub PAT for API access.
Installation
$ shadcn add https://ui.justinlevine.me/r/env-table.jsonUsage
import { EnvTable } from "@/components/env-table"<EnvTable variables={variables} title="Environment Variables" />Pass an array of { key, value, environment?, description? } objects. Values are masked by default — users click the eye icon to reveal individual values, or use the toolbar to reveal/hide all.
Examples
With environment badges
When variables include an environment field, color-coded badges show the target environment. Built-in colors for production (green), preview (blue), and development (amber).
Deploy settings
Environment Variables
6Stripe live API key. Never expose client-side.
GitHub PAT for API access.
Database config
Database
4Primary PostgreSQL connection string.
Redis cache connection string.
Without environments
Omit the environment field for a simpler key-value layout. Works well for API keys, webhook URLs, and general config.
API credentials
API Keys
4Default revealed
Set defaultRevealed to start with all values visible. Useful for non-sensitive config or documentation contexts.
Revealed by default
Runtime Config
2API Reference
EnvTable
EnvVariable
Notes
- Display-only. This component does not read from
process.envor any external source. You supply the data — it renders it. - Client component. Uses
"use client"for reveal toggle state and clipboard access. - Masking. Values show the first 4 characters plus dots. Values shorter than 5 characters show only dots. This is visual masking — values are still in the DOM. Do not use this for true secret concealment.
- Copy .env. The toolbar "Copy .env" button copies all variables in
KEY=valueformat, ready to paste into a.envfile. - Duplicate keys. The component handles duplicate keys gracefully — common when showing the same variable across multiple environments.