Live demo
Demo source
Overview
Use the environment indicator to make it obvious that an application is
running in development, test or acceptance, so people don't mistake it for
production. It only marks the environment; it doesn't change or protect the
deployment. In production, or with no or an unknown env, it renders nothing.
Anatomy
A DEV environment indicator with its build information visible. Callouts 1, 2 and 3 mark the coloured strip, the DEV tab and the tooltip containing the environment name, version, build, commit and deployment time.
- Strip: a thin line across the top. DEV, TEST and ACC each have their own reserved colour.
- Tab: the environment label, such as "TEST", hanging from the strip. A
custom
label(up to 6 characters, such as "TEST-2") replaces it; the colour still comes fromenv. - Tooltip: on hover or focus, the environment name and any
version,build,commitanddeployedAt. Clicking the tab copies them and emitsenvironmentCopied.
Properties
| Design setting | Code | Mapping |
|---|---|---|
| Environment | env | DEV, TEST, ACC; other environments render nothing. |
| Mode | mode | auto follows window focus; focused and unfocused force a mode. |
| State | Interaction | Default, hover, keyboard focus and copied feedback. |
| Enabled | disabled | Set to true to suppress the indicator. |
| Label visible | persistent, hideDelay | The tab normally hides after 5000 ms. |
| Custom label | label | Uppercase, limited to six characters; colour still follows env. |
| Build information | tooltip, version, build, commit, deployedAt | Version, build and commit form the build line; deployment time can appear on its own. |
| Deploy-time configuration | autoDetect | Reads unset values from window.__NOVA_ENVIRONMENT__ or nova-* meta tags. |
| Page title | prefixTitle | Adds the environment prefix to the document title. |
| Preview containment | contained | Anchors inside a positioned parent without changing the page layout. |
| Copy confirmation | environmentCopied | Emits the copied text after a successful copy. |
Look and feel
Each environment has a reserved colour. The focused appearance is a 4 px strip with a hanging tab; the unfocused appearance frames the page. Both support Spark and Ocean in light and dark mode.
Hover and keyboard focus reveal the tooltip. A successful copy briefly replaces the tab label with “Copied”. A hidden tab returns when the pointer approaches it, on keyboard focus, or when the window regains focus.
Behavior
Only the strip takes space in the document. Content scrolls beneath it. When the window loses focus, the page scales into the coloured frame without reflowing. If a click restores focus, the frame remains until that click has landed, then the page returns to its normal scale.
Use the framework environment service to read application configuration:
NovaEnvironmentProvider in React, NvEnvironmentService in Vue,
provideNovaEnvironment in Angular, or AddNovaEnvironment in Blazor.
Plain HTML can use autoDetect for deployment-time configuration. The
examples show the
framework-specific setup.
The live demo uses contained and a forced mode so the indicator stays
inside the preview. Application roots normally use the default auto mode.
Accessibility
The environment label identifies the context independently of colour. Keyboard focus reveals both the tab and its tooltip, including when the tab has automatically hidden. The “Copied” state confirms the copy action.
Usage
- Mount one indicator at the application root in non-production deployments.
- Use a short custom label such as
TEST-2for parallel environments. - Keep deployment context separate from business status; the indicator does not render in production and does not protect a deployment.
- Avoid adding a second environment banner for the same application.
Related
Use a status indicator to describe a system or process within the page.