shadcn.io is not affiliated with official shadcn/ui
Masked Environment Variables Table Block for React
A table of environment variables whose values stay masked until you show them, with scope tabs, a reveal toggle and a copy button per row, and Reveal all and Hide all.
Installation
Overview
Keep secrets out of sight until someone asks, with this masked variables table for React with Base UI. Each value shows as bullets with its last four characters, and a toggle on the row (pressed means shown) turns that one value into text. Tabs above the table choose the scope (All, Production, Preview, Development), each saying how many variables it holds, and the rows swap in a frame that keeps its height. Reveal all and Hide all work on the tab you are looking at, a copy button puts the real value on your clipboard, and a status line says what was shown, hidden or copied, or that the browser refused. Every value is a typed sample, not a real secret and not shaped like one. On a phone the Updated column goes and the scope folds under the key. It's built from Tabs, Copy Button, Badge and Guides. For hosting dashboards, config screens and any table of values that should not be shown by default.
FAQ
How is a value masked?
The table renders the value as eight bullets followed by its last four characters until you press the toggle on that row, which is a button with aria-pressed. The real text is only put on the page for rows you have shown. Masking hides a value from a glance; it is not security, so never ship a real secret to the browser.
How do the scope tabs work?
Each tab shows the variables of one scope, with a count in the tab, and All lists them together with the scope in its own column. The frame under the tabs keeps one height whichever tab you choose, and the rows you have revealed stay revealed when you switch.
What do Reveal all and Hide all do?
They act on the tab you are looking at only. Each is a quiet, always-present button: if everything is already shown or hidden it answers in the status line instead of doing nothing silently.
What does the copy button copy?
The full value of that row, on the real clipboard. If the browser refuses, for example on a page that is not served over HTTPS, the status line says so instead of claiming it copied. The values here are samples with a demo prefix, so copying one exposes nothing.
How does it fit on a phone?
The Updated and Scope columns go below the medium breakpoint and the scope moves under the key name, the tab names shorten (Prod and Dev) while keeping their full names for screen readers, and a long revealed value wraps inside its cell.
What stays local, and how do I wire it for real?
The variables are typed in the file and showing or hiding one is this page's state; nothing is read from or sent to a host. For real use, fetch only the variables the visitor may see, send the masked form by default and request a value from your server when its toggle is pressed.
Related
- Pro
Environment Variables Settings
Domains and deliveryAn environment variables settings panel that shows where each variable is set across Production, Preview and Development, counts what is missing, fills a missing value with Copy from, and previews a pasted .env file before it imports.
- Pro
Copy Cell Table
Select and actA table of discount codes where each code is a button across its whole cell that copies it to the real clipboard and says Copied for two seconds, with a Copy all in the head and a foot line that counts what was copied.
- Pro
Sortable Members Table
Sort and searchA members table whose column heads are buttons: press one to sort, again to reverse, a third time for the original order, with aria-sort on the active head, ties settled by name and a spoken line for each result.
- Pro
Avatar Stack Table
Rich cellsA sprint board whose assignee cell is a stack of initials and a plus count that opens a popover of checkboxes: ticking assigns a teammate, unticking removes them, an empty cell is a dashed circle and Unassigned.
- Pro
Badge Count Table
Rich cellsModeration queues as counts: compact badges like 1.2K, a quiet dash for zero, a strip of three totals and a number field that flags any queue past a limit with a flag glyph and the words Over limit, never a colour.
- Pro
Color Indicator Table
Rich cellsA project table whose categories are marked by shape, weight and word, never colour: a circle, square, diamond and triangle in foreground weights, and a legend of toggle chips with counts that dims the other categories.