Env variables
ProEnvironment variables as an editable table: names checked as you type, secrets masked and never shown again after saving, per-environment checkboxes, paste a whole .env file, and one save bar that counts the changes.
pnpm dlx shadcn@latest add @caliper/env-variablesEnvironment variables
Read by your app at build and run time. Secrets are encrypted and can’t be read back.
| Name | Value | Development | Preview | Production | Actions |
|---|---|---|---|---|---|
| Secret | |||||
| Secret | |||||
When to use #
Use it for
- Hosting, CI and serverless products.
- Any app with configuration per environment.
Skip it when
- A handful of app settings; use a settings form.
Installation #
pnpm dlx shadcn@latest add @caliper/env-variables
Adds its 12 files to components/ui/, each with its own stylesheet, and installs their packages. Pro installs with your access token, set up once per project. See Pro access. The first part also adds Caliper UI’s tokens; import them once as in Installation.
Usage #
Import it from your copy of the source. The example behind the preview comes with the source. It is built from parseDotenv and EnvVariables.
import { parseDotenv, EnvVariables } from "@/components/ui/env-variables"
The worked example comes with Pro
The 56-line example behind the preview opens here with a Pro or Team licence.
API reference #
parseDotenv
component
No props of its own; it accepts the native props of its root element.
EnvVariables
component
Accessibility #
It exposes region, alert and status semantics, with aria-labelledby, aria-hidden, aria-label, aria-invalid, aria-describedby and aria-pressed kept in step with state. Changes that matter are announced through a live region.
Keyboard and focus handling comes from Radix dialog: arrow keys move through items, Enter and Space select, and Escape closes and returns focus.
Motion #
Transitions use the shared duration and easing tokens. Under prefers-reduced-motion those tokens collapse to instant and travel distances go to zero, so state changes still happen without movement.