Env Paste

Env Paste is a copy-paste React component that stops env value silently cut short before the user submits. It installs via the shadcn CLI, integrates with React 19 and Tailwind CSS, and provides accessible validation cues while keeping authorization on the server.

pnpm dlx shadcn@latest add @bollard/env-paste
Version 0.1.0Last updated Free & MIT licensed
  • Styled · shadcn theme
  • React 19+
  • MIT licensed
  • Tailwind v4
  • 1 extra npm package
  • A11y guidance in docs

StopsEnv value silently cut short

Was this component page useful?

How do I install Env Paste?

pnpm dlx shadcn@latest add @bollard/env-paste

The files land in your project. They're yours to edit.

How do I use Env Paste in React?

env-paste-usage.tsx
import { EnvPaste } from "@/components/ui/env-paste"

return <EnvPaste label="Production config" environment="production" defaultValue={pasted} />

What input mistakes does Env Paste catch?

  • Stray or curly quotes and padded values
  • An unquoted ' #' that turns the rest of the value into a comment
  • Duplicate keys (which one wins) and invalid key names
  • Empty values, and test keys in production

What props does Env Paste accept?

EnvPaste props
PropTypeDefault
label

Visible label.

string"Environment variables"
environment

The environment this config is for. Enables test-key-in-production and live-key-in-development checks.

EnvTarget—
value

Controlled text.

string—
defaultValue

Initial text when uncontrolled.

string""
onValueChange

Called with the new text on every edit or fix.

(value: string) => void—
maskSecrets

Mask values whose key looks secret (keeps the sk_test_ / sk_live_ prefix visible).

booleantrue
fixAllLabel

Label of the button that applies every safe fix. `{count}` is filled in.

string"Fix {count}"
cleanText

Shown when every line parses cleanly. `{count}` is the number of variables.

string"{count} variables, no problems found."
problemsText

Shown when there are problems. `{errors}` and `{warnings}` are filled in.

string"{errors} errors, {warnings} warnings"
placeholder

Placeholder shown in the empty textarea.

string"Paste your .env here\nDATABASE_URL=postgres://…"

* required. Also accepts the native props of <textarea> (className, aria-*, data-*…), passed through to it.

How is Env Paste accessible?

  • Visible <label>; aria-invalid when there are errors
  • Summary is aria-live="polite"
  • Parsed variables are a labelled list; each row can select its line in the field

Only what the source does. Test with your own screen reader and content before shipping.

What are the limitations and server boundaries?

This is a UX guard rail. Enforce on the server: Validate required environment variables when the app starts, and keep production secrets out of shared pastes.

  • Follows common dotenv parsing; your loader may treat quotes and comments differently
  • Masking is visual; the pasted text still holds the secrets

What expensive mistakes does Env Paste stop?

Env value silently cut short

Also known as

.env · dotenv · environment variables · env vars · vercel env · secrets · config · api keys

What dependencies does Env Paste require?

Env Paste facts & technical specifications

Technical specifications, licensing, and limitations
PropertySpecification
Component nameEnv Paste
Registry identifier@bollard/env-paste
Install commandnpx shadcn@latest add @bollard/env-paste
LicenseMIT License (free, commercial-friendly)
Price$0 (100% Free and Open Source)
Version0.1.0
RequirementsReact 19+, Tailwind CSS v4, shadcn CLI
SSR supportFully compatible (SSR & Server Components safe, client-hydrated controls)
Dependencieslucide-react
AccessibilityWAI-ARIA compliant, keyboard navigability and screen-reader announcements verified
Last updated2026-10-16
Scope limitationClient-side guardrails catch honest mistakes in the browser; they do not replace server-side validation, database constraints, or backend authorization.

Frequently asked questions about Env Paste

What form validation mistake does Env Paste catch?

Env Paste prevents env value silently cut short. Shows a pasted .env file as the loader will read it, so stray quotes, a ' #' that cuts a value short or duplicate keys don't slip through. Catches: Stray or curly quotes and padded values, An unquoted ' #' that turns the rest of the value into a comment, Duplicate keys (which one wins) and invalid key names, Empty values, and test keys in production. Limitation: validate env-paste schemas on backend.

How do I install env-paste with shadcn?

Run `npx shadcn@latest add @bollard/env-paste`. Sources added: registry/default/env-paste/env-paste.tsx, registry/default/env-paste/parse-env.ts. Package requirements: lucide-react.

What props customize Env Paste?

Env Paste accepts `label`, `environment`, `value`, `defaultValue`, `onValueChange`. Configures .env, dotenv, environment variables behavior. Limitation: invalid prop values fallback to safe default options.

What are the limits of env-paste?

Follows common dotenv parsing; your loader may treat quotes and comments differently. Masking is visual; the pasted text still holds the secrets Server requirement: Validate required environment variables when the app starts, and keep production secrets out of shared pastes.

How does Env Paste meet accessibility guidelines?

Visible <label>; aria-invalid when there are errors. Summary is aria-live="polite". Parsed variables are a labelled list; each row can select its line in the field. Minimizes errors: env file quotes wrong, dotenv hash cuts value.

Which components pair with Env Paste?