Skip to content

Instantly share code, notes, and snippets.

@adevinwild
Created December 31, 2023 07:24
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adevinwild/324915ea165d8e866f6f3f52f614a3de to your computer and use it in GitHub Desktop.
Save adevinwild/324915ea165d8e866f6f3f52f614a3de to your computer and use it in GitHub Desktop.
A simple dev indicator for React using TailwindCSS
const isDev = process.env.NODE_ENV === "development";
const DevIndicator = () => {
if (!isDev) {
return null;
}
return (
<>
<div className="w-full h-full fixed ring-4 opacity-80 ring-orange-300 ring-inset z-[9999]"></div>
<div className="fixed bottom-4 opacity-80 left-4 py-1 px-2 bg-orange-300 ring-1 ring-orange-400 text-orange-600 rounded z-[9999]">
<span className="font-mono text-sm font-bold">DEV MODE</span>
</div>
</>
);
};
export default DevIndicator;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment