Environment Indicator

Shows which environment the application runs in, such as production, staging or a developer's machine.

<sa-environment-stripe label="Testing" color="EnvironmentStripeColor.Warning"/>

Usage

Add one of the three indicators to your layout: <sa-environment-stripe>, a thin bar across the top of the window with the name of the environment on a tab, as above; <sa-environment-frame>; or <sa-environment-banner>. Each is fixed to the window, so it can go anywhere in the page. Render it only in the environments that should show one, however your application determines its environment.

@if (environmentName is not null)
{
    <sa-environment-stripe label="@environmentName" color="EnvironmentStripeColor.Warning" />
}

The text on the indicator is white or dark, whichever reads better on its colour.

Examples

Frame

A border around the whole window, with the name of the environment on a tab at the top.

<sa-environment-frame label="Local" color="EnvironmentFrameColor.Info"/>

A bar across the top of the window, with room for a description after the name. The page and the sidebar move down by the banner's height, so nothing is hidden under it.

<sa-environment-banner label="Live" color="EnvironmentBannerColor.Danger" description="Changes affect live customers"/>

Custom colour

Set custom-color to any CSS colour to use it in place of the theme colours, and custom-dark-color to use another colour in 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 a stripe or frame to make the tab that names the environment smaller or larger.

<sa-environment-stripe label="Testing" color="EnvironmentStripeColor.Warning" tab-size="EnvironmentStripeTabSize.ExtraLarge"/>

API Reference

<sa-environment-stripe>

Renders a <div> element fixed to the top of the window, forwarding any global attributes.

Prop

Type

<sa-environment-frame>

Renders a <div> element that borders the window, forwarding any global attributes.

Prop

Type

<sa-environment-banner>

Renders a <div> element fixed to the top of the window, forwarding any global attributes.

Prop

Type

On this page