DEV Community

Priyanka-Chettri
Priyanka-Chettri

Posted on

Unveiling the Magic of hover, focus and active variants in Tailwind CSS.

๐Ÿ’ก๐๐ซ๐จ ๐“๐ข๐ฉ: Make your UI elements pop with Tailwind CSS! Use ๐ก๐จ๐ฏ๐ž๐ซ, ๐Ÿ๐จ๐œ๐ฎ๐ฌ, and ๐š๐œ๐ญ๐ข๐ฏ๐ž variants to enhance user experience and engagement. Your designs will thank you!

Cover Page

Dive into this demo to see them in action!
Ready to give it a try? Check out the code below and start
experimenting! ๐Ÿ‘‡

โžก๏ธ Snippet of "hover" variant applied to a button.
Hover Code

โžก๏ธ Snippet of a "focus" variant applied to a button
Focus Code

โžก๏ธ Snippet of an "active" variant applied to a button
Active Code

Top comments (2)

Collapse
 
moopet profile image
Ben Sinclair

Just a heads up that the Markdown we use here supports syntax highlighting, and is generally more accessible than inserting an image of code. Images of text are an issue for people using screen readers, for example, and their content won't get picked up by the site's search facility.

You can add code blocks with 3 backticks: code block with colors example More details in our editor guide!

Collapse
 
priyankachettri profile image
Priyanka-Chettri

Noted. Thanks for the feedback!