Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Environment Variable Updated Success Block for React

A confirmation alert dialog shown open over a drawn variables table: three variables saved, listed as added, changed and removed with a glyph and a word each, masked values with a Reveal for typed samples, and Redeploy now or Later.

Framework
UI library

Preview

Preview width

Installation

Part of Pro
Pro unlocks the code and one-line install of every Pro button and text effect, plus the MCP for your AI editor.
Have Pro already? Sign in to open it.Opens here as soon as you're Pro.

Overview

Tell people exactly what a save changed, and ask whether to redeploy, with this confirmation alert dialog for React with Base UI. It is the Jobtide environment variables page after a save, with an Alert Dialog open over a drawn table of four masked variables: "3 variables saved to Production and Preview". The dialog lists the changes as added, changed and removed, each with a glyph (a plus, a pencil, a minus) and a word, never a colour. Values stay masked until a pressed Reveal values button shows typed samples under a line that says they are not real secrets. The footer offers Later, which has focus, and Redeploy now, the one Shine Button, which closes the dialog and sets a "Redeploying (demo)" Badge on the stage. On load the dialog is drawn open in place for the preview; the header's View changes button opens the real one. Nothing is saved or redeployed. For environment, config and secrets pages, or any save whose effect waits for a restart.

FAQ

What stays in the page, and how do I wire it for real?

Nothing was saved or redeployed. The variables, their scopes and the sample values are typed constants at the top of the file, and Redeploy now only closes the dialog, sets the badge on the drawn page and says so in the status line. To wire it, build CHANGES from the difference between the saved and the submitted variables, call your deploy API from the Redeploy now handler, and show a failure in the status line. Send the real values to the browser only when the person asks to reveal them, never in the page's first payload.

Why is the dialog open when the page loads, and what is the preview's?

So a gallery cell and the viewer show the open state. On load the dialog is a native dialog drawn open in place over the stage, wearing the alert dialog's own classes, so nothing is trapped, hidden or focused. Its Later button, Escape while focus is inside the stage and the real dialog's Escape all mean the same thing: the dialog closes, the redeploy is skipped and focus returns to View changes. View changes then opens the real alert dialog with its focus trap. In your app keep the AlertDialog, drop the in-place copy and the state that draws it.

How do the masked values and Reveal work?

Every value is masked with dots and a screen reader hears that it is hidden. Reveal values is a toggle button (it keeps its label and says it is pressed) that swaps the dots for typed sample values, such as sample-old-41 and sample-new-77, and changes the line under the list to "These are typed samples, not real secrets." Closing the dialog masks them again. Rows keep their height whichever way they show, so nothing moves.

How are the added, changed and removed rows told apart?

Each row starts with a glyph in a small tile and says its word first (Added, Changed, Removed), then the variable's name in a mono chip, then its values: "Value" for an added variable, "Was … , now …" for a changed one and "Was …" for a removed one. State is never a colour, so it reads the same in every theme and to someone who can't tell colours apart. The title counts them from the list ("3 variables saved to Production and Preview").

Where does focus go, and can I click outside to close it?

Focus starts on Later, the safe answer, not on Redeploy now. A click outside does not close an alert dialog, and Escape means Later. After a choice focus goes back to View changes, and the result is spoken from the polite status line a moment after the dialog has gone, because the page is hidden from assistive technology while it is open.

How does it look on a phone?

The in-place dialog docks to the foot of the stage with its footer pinned, the buttons stacked with Redeploy now on top, and the list scrolls if the stage is short. The real dialog uses the catalog's own phone layout.

  • Pro

    A thermostat settings page with the sheet that says what a save changed, shown open: three settings from old value to new, the version and its time, a Done button and a Revert to version 13 that redraws the page.

  • Pro

    Environment Variables Settings

    Domains and delivery

    An 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

    Unsaved Changes Dialog

    Confirm and consent

    An essay editor with its leave prompt shown open: an alert dialog that lists what changed since the last save and offers Save and leave, Discard changes and Keep editing.

  • Pro

    API Key Show Once Success

    Security and access

    A key confirmation inside an app panel: the secret masked with an eye toggle and a real copy button, a checkbox that turns it into its stored form, the key's scopes and dates, a request that uses it, and a Done button that waits for the box.

  • Pro

    Confirm Action Dialog

    Confirm and consent

    A newsletter editor with its publish confirmation shown open: an alert dialog that lists what happens to the issue, a box that remembers the answer, and a foot that gives the question back.

  • Pro

    API Key Builder Settings

    API and webhooks

    An API key settings panel with a table of keys, a builder that sets None, Read or Write for each resource, and a try-a-request check that answers Allowed or Denied with the reason before anything is saved.