Created
November 22, 2023 10:50
-
-
Save YDrogen/8db911cc128d7f8d1bf4c97e18b44a3b to your computer and use it in GitHub Desktop.
A simple React component to use with Tailwind that shows the current breakpoint value
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function TailwindIndicator() { | |
return process.env.NODE_ENV === 'production' ? undefined : ( | |
<div className='fixed bottom-1 right-1 z-50 flex h-6 w-6 items-center justify-center rounded-full bg-gray-800 p-3 font-mono text-xs text-white'> | |
<div className='block sm:hidden'>{'xs'}</div> | |
<div className='hidden sm:block md:hidden'>{'sm'}</div> | |
<div className='hidden md:block lg:hidden'>{'md'}</div> | |
<div className='hidden lg:block xl:hidden'>{'lg'}</div> | |
<div className='hidden xl:block 2xl:hidden'>{'xl'}</div> | |
<div className='hidden 2xl:block'>{'2xl'}</div> | |
</div> | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment