Environment Indicator
Displays which environment the application runs in, such as production, staging, or a developer's machine
Environment Indicator displays which environment the application is running in, such as staging, testing, or production. Choose from three viewport-fixed presentations: a top stripe, a full-window frame, or a top banner.
<sa-environment-stripe label="Testing" color="EnvironmentStripeColor.Warning"/>Usage
Add <sa-environment-stripe>, <sa-environment-frame>, or <sa-environment-banner> to your layout for the environments that should display an indicator:
@if (environmentName is not null)
{
<sa-environment-stripe label="@environmentName" color="EnvironmentStripeColor.Warning" />
}The label attribute is required and must be non-empty. Each indicator is fixed to the viewport and automatically selects dark or light foreground text for contrast against its background color.
Examples
Frame
Use <sa-environment-frame> to display a colored border around the entire viewport with a centered top tab naming the environment.
<sa-environment-frame label="Local" color="EnvironmentFrameColor.Info"/>Banner
Use <sa-environment-banner> to display a full-width bar across the top of the viewport with an optional description after the environment name. The page content and fixed sidebar shift down automatically by the banner's height so nothing is obscured behind it.
<sa-environment-banner label="Live" color="EnvironmentBannerColor.Danger" description="Changes affect live customers"/>Custom color
Set custom-color to any valid CSS color to override the theme palette, and set custom-dark-color to provide a separate color for dark mode.
<sa-environment-banner label="Staging" custom-color="#7c3aed" custom-dark-color="#c4b5fd" description="Data is reset every night"/>Tab size
Set tab-size on <sa-environment-stripe> or <sa-environment-frame> to adjust the size of the tab displaying the environment name.
<sa-environment-stripe label="Testing" color="EnvironmentStripeColor.Warning" tab-size="EnvironmentStripeTabSize.ExtraLarge"/>Accessibility
All three environment indicators render non-interactive <div> elements and compute contrasting light or dark text automatically from the background color in both light and dark mode. <sa-environment-stripe> and <sa-environment-frame> apply pointer-events: none so they never intercept interactions with underlying controls, while <sa-environment-banner> offsets the page and fixed sidebar so content remains unobstructed.
Do not rely on color alone to distinguish environments. Provide a clear, recognizable label (and a description on <sa-environment-banner> when extra context helps) so every user can identify the active environment.
API Reference
<sa-environment-stripe>
Renders a <div> element fixed to the top of the window and forwards global attributes.
Prop
Type
<sa-environment-frame>
Renders a <div> element bordering the window and forwards global attributes.
Prop
Type
<sa-environment-banner>
Renders a <div> element fixed to the top of the window and forwards global attributes.
Prop
Type