BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/motiq/environment-switcher

Environment Switcher

motiq/environment-switcher
FreeComponent

A presentation + control surface for choosing the environment an app targets (dev / staging / production, regions, preview branches). Current-environment trigger opens a searchable, fully keyboard-navigable listbox with per-environment status/health, region/branch/version/last-deploy, disabled reasons, recents + favorites, and optional groups. Production switches are icon + label marked (never color alone) and can be gated behind a confirmation dialog. Controlled value/onValueChange with app-owned switching + error/retry. It never mutates a backend.

Live preview

live · rendered by the registry
Rendered by motiq on their own page — this is the component running, not a screenshot of it.

Install it

npx shadcn@latest add https://www.motiq.dev/r/environment-switcher.json

Source

registry/developer-tools/environment-switcher.tsxwww.motiq.dev/r/environment-switcher.json · first 6 KB
1"use client";
2
3import * as React from "react";
4import { createPortal } from "react-dom";
5import { motion, AnimatePresence } from "motion/react";
6
7import { cn } from "@/lib/utils";
8import {
9 useControllableState,
10 useReducedMotion,
11 getStatusMeta,
12 statusVars,
13 formatTimestamp as defaultFormatTimestamp,
14 type StatusTone,
15} from "@/lib/motiq";
16
17/**
18 * EnvironmentSwitcher — a presentation + control surface for choosing the
19 * environment (dev / staging / production, regions, preview branches) an app is
20 * pointed at. It is NOT a deployment tool: it never opens a socket, deploys,
21 * promotes, or mutates any backend. The host application owns the actual switch;
22 * this component surfaces the choice, the per-environment status/health the host
23 * already knows, and — critically — a production safety guard.
24 *
25 * What makes it worth shipping over a bare <select>: each environment carries a
26 * status (available / active / degraded / offline / deploying / locked /
27 * restricted), optional region / branch / version / last-deploy / health, and an
28 * app-provided disabled reason. Production is treated as a first-class hazard —
29 * it is marked with an icon AND a text label (never colour alone) and, when the
30 * host opts in via `requireProductionConfirmation`, a switch to it is gated
31 * behind an explicit confirmation dialog. A switch in flight and a switch error
32 * (with retry) are app-owned states the component renders honestly.
33 *
34 * Accessibility: the trigger is a real button (aria-haspopup="listbox"); the
35 * popup is the ARIA combobox pattern — a search input (role="combobox",
36 * aria-activedescendant) controlling a role="listbox" of role="option" rows with
37 * full Arrow / Home / End / Enter / Escape keyboard support. Disabled options
38 * keep their reason readable. The current value is announced via a polite live
39 * region; production and every status use icon + text; focus is restored to the
40 * trigger on close; targets are ≥44px; under prefers-reduced-motion everything
41 * renders in its final state. Clean-room original.
42 */
43
44/* -------------------------------------------------------------------------- */
45/* Types */
46/* -------------------------------------------------------------------------- */
47
48export type EnvironmentType =
49 | "local"
50 | "development"
51 | "preview"
52 | "staging"
53 | "production"
54 | (string & {});
55
56/** App-owned health/lifecycle of an environment. */
57// … truncated

What it pulls in

npm packages

  • motion

Other registry items

  • https://motiq.dev/r/utils.json
  • https://motiq.dev/r/primitives.json

Files it writes

  • registry/developer-tools/environment-switcher.tsx

Facts

Registry
motiq
Type
registry:component
Access
Free
Files written
1
Licence
MIT
First indexed
2026-08-12
Last confirmed
today

Go to the source

Docs on motiq www.motiq.dev RMahammad/motiq on GitHub Raw registry item This item as JSON

More from motiq

All 100 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Activity Streamactivity-streammotiqComponentsFree1 dep
Adaptive Safe-Zone Gridadaptive-safe-zone-gridmotiqComponentsFreeno deps
Agent Run Timelineagent-run-timelinemotiqComponentsFree1 dep
AI Response Streamai-response-streammotiqComponentsFree1 dep
Animated Accordionanimated-accordionmotiqComponentsFree2 deps
Animated Buttonanimated-buttonmotiqComponentsFree1 dep
Animated Dialoganimated-dialogmotiqComponentsFree2 deps
Animated Gridanimated-gridmotiqComponentsFree2 deps
BlockDex

Built by

Kynth Studios

the studio behind StoreReady, ToolDrift and BreachProbe

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product.

BlockDex

BlockDex

Built by

Kynth Studios

the studio behind StoreReady, ToolDrift and BreachProbe

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product.

BlockDex

BlockDex

Built by

Kynth Studios

the studio behind StoreReady, ToolDrift and BreachProbe

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product.

BlockDex