Environment Config Viewer
Tabbed environment-variable viewer that switches between Production, Staging, and Development (or however many environments you pass), rendering each one's KEY=value pairs in a terminal-style panel. Secret-looking values render masked by default with a one-click reveal toggle. Perfect for onboarding docs or an internal config-diff page.
Docs
Installation
A real shadcn registry command, not a copy-paste stand-in: it fetches this block plus its dependencies and any missing npm packages, and installs them straight into your project.
npx shadcn add https://staaarter.com/r/environment-config-viewer.jsonPrefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/devtools/devtools9.tsx instead.
Usage
The file also exports devtools9Demo, 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 { Devtools9, devtools9Demo } from "@/components/blocks/devtools/devtools9"; export default function Page() { return <Devtools9 {...devtools9Demo} />; }
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| heading | string | "Environment variables" | Section heading. |
| description | string | "Compare configuration across environments before you promote a deploy." | Section intro text below the heading. |
| environments | EnvironmentConfig[] | none | The environments shown as tabs; the first entry is selected by default. |
| className | string | none | Extra classes for the outer section element. |
Types
type EnvVar = { key: string; value: string; masked?: boolean; }; type EnvironmentConfig = { id: string; label: string; variables: EnvVar[]; };
Behavior notes
- This is a client component: the environment tabs are real state (clicking a tab swaps which environment's variables render below) and the Reveal/Mask button is real state too, not decorative.
- Masking is computed at render from the real value (first 8 characters, then a fixed run of bullets, then the last 4 characters) for any row with masked: true; there is no separate pre-masked string to keep in sync with the real value.
- The Reveal/Mask button only appears in the panel header when the currently active environment has at least one masked row, and it is a single toggle for all masked rows in that environment, not one button per row.
- The reveal state is shared across environments: switching tabs while revealed keeps secrets visible in the newly selected environment too, rather than re-masking on every tab change.
- The dark terminal-style panel (neutral-950 background, traffic-light dots, monospace) is a deliberate fixed-color exception for this block, matching this repo's established code-window convention rather than using semantic tokens.
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.