Last active
December 4, 2021 18:05
-
-
Save PhilippMeissner/27397248c10893257b9e617571151b6a to your computer and use it in GitHub Desktop.
React component showing active tailwind viewport
This file contains hidden or 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
const Viewport = () => { | |
return ( | |
<span className={"absolute top-4 right-4"}> | |
<pre className="sm:hidden">base</pre> | |
<pre className="hidden sm:block md:hidden">sm</pre> | |
<pre className="hidden md:block lg:hidden">md</pre> | |
<pre className="hidden lg:block xl:hidden">lg</pre> | |
<pre className="hidden xl:block 2xl:hidden">xl</pre> | |
<pre className="hidden 2xl:block">2xl</pre> | |
</span> | |
); | |
}; | |
export default Viewport; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This snippet implements the currently (at the time of writing) available default breakpoints.