Environment switcher
Switch between development, preview, staging and production from one control. Production is marked live everywhere it appears, and a notice above risky settings says so in words.
Settings below apply to staging only.
When to use
- Developer platforms and admin consoles with several environments.
- Settings that differ per environment.
When not to use
- Switching workspaces or accounts; use the workspace switcher.
Installation
pnpm dlx shadcn@latest add @caliper/environment-switcher
Adds its 3 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.
API reference
EnvironmentSwitcher
5 props
ProductionNotice
3 props
Keyboard
- ↓
- Moves to the next item or value.
- ↑
- Moves to the previous item or value.
- Home
- Jumps to the first item or the minimum.
- End
- Jumps to the last item or the maximum.
- Enter
- Activates the focused control.
- Space
- Activates the focused control.
Accessibility
It exposes listbox, option and note semantics, with aria-label, aria-hidden, aria-activedescendant and aria-selected kept in step with state.
Notes for AI
Give your coding assistant this page as Markdown instead of screenshots: the props, keyboard and examples in one file.
/docs/components/environment-switcher.mdThe index of every part is at /llms.txt.