Env Variables

Environment variables per environment, write-only values, and a reminder to redeploy.

PROGet Env Variables and 168 other Pro components with pro lifetime — Get Pro

Category
Workspace
Access
Pro
Source
364 lines · one file
States
5 drawn
Added
3 Nov 2026

The decision inside it

Saving is not the same as live

A changed variable does nothing until the app is redeployed, which is the step people forget. After a save, the environments affected are named with a Redeploy button, instead of a green tick that suggests it's done.

When to use it

Use Env Variables for a project's environment variables across production, preview and development. For API keys people create and revoke use API Keys Table; for deploy history use Deployments Table.

Installation

How you get it

Paste this into Claude Code, Cursor, Codex or any coding agent. It installs the file and uses it as it is, instead of writing a new one.

Use Liro's Env Variables for this.
Install it: npx shadcn@latest add @liro/env-variables
(the @liro registry is set up in components.json, with LIRO_KEY in .env.local)
Import it from @/components/ui/env-variables.
Do not rewrite or restyle it. Pass my data through its props
and keep its built-in states.

For the full brief with every prop and the mistakes assistants usually make, use Copy prompt above. Pro components install through the @liro registry with your CLI token: see the Namespaced tab.

Usage

components/project-env.tsx
import { EnvVariables, type EnvVar, type EnvChange, type EnvName } from "@/components/ui/env-variables";

export function ProjectEnv({ vars, api }: {
  vars: EnvVar[];
  api: { save: (changes: EnvChange[]) => Promise<void>; redeploy: (envs: EnvName[]) => Promise<void> };
}) {
  return <EnvVariables vars={vars} onSave={api.save} onRedeploy={api.redeploy} />;
}

API reference

“Copy prompt” above puts a full brief on your clipboard, install command, dependencies, props, and the mistakes an assistant usually makes with this component.

Props

Read from the component’s own TypeScript interface when the site is built, so this table cannot drift from the file you install.

TypeNotes
varsEnvVar[] Yes–
onSave(changes: EnvChange[]) => void | Promise<void> NoSaves every pending change at once. May return a promise.
onRedeploy(envs: EnvName[]) => void | Promise<void> NoRedeploys the given environments. May return a promise.
titlestring No–
lookLook No–

Dependencies

npm packages

clsxframer-motionlucide-reacttailwind-merge

Liro foundations, installed alongside it

liro-themebutton

States

All of them are drawn by the component. None is left for you to design.

  • Variables
  • Adding
  • Invalid key
  • Unsaved changes
  • Redeploy needed

Accessibility

  • Keyboard reachable throughout, in visual order
  • Focus trapped in overlays, Escape closes them
  • Focus returns to whatever opened it
  • Live regions announce what changed, not that something did
  • Honours prefers-reduced-motion

Responsive behavior

  • Sizes to its container, not the viewport
  • Usable from 320px up
  • Pointer-based interaction, so trackpad and touch both work
  • No hover-only affordances