<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Piyush Sahu</title>
    <description>The latest articles on DEV Community by Piyush Sahu (@piyush_sahu_71974ee9fb1b8).</description>
    <link>https://dev.to/piyush_sahu_71974ee9fb1b8</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3259997%2F73c72451-e49e-4b5c-b3c2-c2109564e7be.png</url>
      <title>DEV Community: Piyush Sahu</title>
      <link>https://dev.to/piyush_sahu_71974ee9fb1b8</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/piyush_sahu_71974ee9fb1b8"/>
    <language>en</language>
    <item>
      <title>How I built a responsive UI with Tailwind in 20 mins?</title>
      <dc:creator>Piyush Sahu</dc:creator>
      <pubDate>Thu, 12 Jun 2025 16:55:38 +0000</pubDate>
      <link>https://dev.to/piyush_sahu_71974ee9fb1b8/how-i-built-a-responsive-ui-with-tailwind-in-20-mins-bk5</link>
      <guid>https://dev.to/piyush_sahu_71974ee9fb1b8/how-i-built-a-responsive-ui-with-tailwind-in-20-mins-bk5</guid>
      <description>&lt;p&gt;A real-world, time-boxed breakdown of building a clean, responsive layout using just Tailwind CSS.&lt;/p&gt;

&lt;h2&gt;
  
  
  👋 Why This Post?
&lt;/h2&gt;

&lt;p&gt;I often get asked how to quickly prototype a clean UI without spending hours writing custom CSS or toggling between media queries.&lt;/p&gt;

&lt;p&gt;So, I challenged myself to build a complete, responsive web layout in under 20 minutes — and Tailwind CSS made it surprisingly easy.&lt;/p&gt;

&lt;p&gt;In this post, I’ll walk you through:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The layout structure&lt;/li&gt;
&lt;li&gt;How I handled responsiveness&lt;/li&gt;
&lt;li&gt;Tailwind tricks I used to speed things up&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  🧠 The Plan
&lt;/h2&gt;

&lt;p&gt;I picked a simple, realistic layout:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A sticky navbar with logo and links.&lt;/li&gt;
&lt;li&gt;A hero section with heading, text, and CTA button.&lt;/li&gt;
&lt;li&gt;A responsive grid showing 3 cards. (like feature highlights or blog posts)&lt;/li&gt;
&lt;li&gt;A dark footer with links.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;No JavaScript. Just HTML + Tailwind CSS.&lt;/p&gt;

&lt;h2&gt;
  
  
  🔧 Tech Stack
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Tailwind CSS via CDN (no build tools)&lt;/li&gt;
&lt;li&gt;HTML (you can swap this with Next.js or React later)&lt;/li&gt;
&lt;li&gt;Optional: &lt;a href="https://play.tailwindcss.com/" rel="noopener noreferrer"&gt;Tailwind Play&lt;/a&gt; for instant testing.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  ⚙️ Step-by-Step Breakdown
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Basic HTML Structure&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&amp;lt;body class="font-sans text-gray-800 bg-white"&amp;gt;&lt;br&gt;
  &amp;lt;!-- Navbar --&amp;gt;&lt;br&gt;
  &amp;lt;!-- Hero --&amp;gt;&lt;br&gt;
  &amp;lt;!-- Features Grid --&amp;gt;&lt;br&gt;
  &amp;lt;!-- Footer --&amp;gt;&lt;br&gt;
&amp;lt;/body&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Start with a clean skeleton. The &lt;code&gt;font-sans&lt;/code&gt; and &lt;code&gt;text-gray-800&lt;/code&gt; give a good base.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Navbar (Responsive Flex Layout)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&amp;lt;nav class="flex justify-between items-center p-4 shadow-md sticky top-0 bg-white z-10"&amp;gt;&lt;br&gt;
  &amp;lt;div class="text-xl font-bold"&amp;gt;MyBrand&amp;lt;/div&amp;gt;&lt;br&gt;
  &amp;lt;div class="space-x-4 hidden md:flex"&amp;gt;&lt;br&gt;
    &amp;lt;a href="#" class="hover:text-blue-500"&amp;gt;Home&amp;lt;/a&amp;gt;&lt;br&gt;
    &amp;lt;a href="#" class="hover:text-blue-500"&amp;gt;About&amp;lt;/a&amp;gt;&lt;br&gt;
    &amp;lt;a href="#" class="hover:text-blue-500"&amp;gt;Contact&amp;lt;/a&amp;gt;&lt;br&gt;
  &amp;lt;/div&amp;gt;&lt;br&gt;
&amp;lt;/nav&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;hidden md:flex&lt;/code&gt;: hides links on small screens.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;sticky top-0&lt;/code&gt;: keeps navbar fixed.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Hero Section&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&amp;lt;section class="text-center py-20 px-6 bg-gray-100"&amp;gt;&lt;br&gt;
  &amp;lt;h1 class="text-4xl md:text-5xl font-bold mb-4"&amp;gt;Build UIs. Fast.&amp;lt;/h1&amp;gt;&lt;br&gt;
  &amp;lt;p class="text-lg md:text-xl text-gray-600 mb-6"&amp;gt;Tailwind lets you design directly in your markup.&amp;lt;/p&amp;gt;&lt;br&gt;
  &amp;lt;button class="bg-blue-600 hover:bg-blue-700 text-white py-2 px-6 rounded-lg"&amp;gt;&lt;br&gt;
    Get Started&lt;br&gt;
  &amp;lt;/button&amp;gt;&lt;br&gt;
&amp;lt;/section&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Uses &lt;code&gt;text-4xl md:text-5xl&lt;/code&gt; for responsive font scaling.&lt;/li&gt;
&lt;li&gt;Utility-first = no switching to CSS file.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Features Grid (Responsive Columns)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&amp;lt;section class="py-16 px-6"&amp;gt;&lt;br&gt;
  &amp;lt;div class="grid grid-cols-1 md:grid-cols-3 gap-8"&amp;gt;&lt;br&gt;
    &amp;lt;div class="bg-white shadow-md p-6 rounded-lg"&amp;gt;&lt;br&gt;
      &amp;lt;h3 class="text-xl font-semibold mb-2"&amp;gt;Speed&amp;lt;/h3&amp;gt;&lt;br&gt;
      &amp;lt;p&amp;gt;Build layouts faster with prebuilt classes.&amp;lt;/p&amp;gt;&lt;br&gt;
    &amp;lt;/div&amp;gt;&lt;br&gt;
    &amp;lt;div class="bg-white shadow-md p-6 rounded-lg"&amp;gt;&lt;br&gt;
      &amp;lt;h3 class="text-xl font-semibold mb-2"&amp;gt;Flexibility&amp;lt;/h3&amp;gt;&lt;br&gt;
      &amp;lt;p&amp;gt;No opinionated styles, full control.&amp;lt;/p&amp;gt;&lt;br&gt;
    &amp;lt;/div&amp;gt;&lt;br&gt;
    &amp;lt;div class="bg-white shadow-md p-6 rounded-lg"&amp;gt;&lt;br&gt;
      &amp;lt;h3 class="text-xl font-semibold mb-2"&amp;gt;Responsiveness&amp;lt;/h3&amp;gt;&lt;br&gt;
      &amp;lt;p&amp;gt;Mobile-first classes that scale with you.&amp;lt;/p&amp;gt;&lt;br&gt;
    &amp;lt;/div&amp;gt;&lt;br&gt;
  &amp;lt;/div&amp;gt;&lt;br&gt;
&amp;lt;/section&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;grid-cols-1 md:grid-cols-3&lt;/code&gt;: responsive column layout.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;gap-8&lt;/code&gt;: spacing between cards.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Footer (Dark Theme)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&amp;lt;footer class="bg-gray-900 text-white py-6 text-center"&amp;gt;&lt;br&gt;
  &amp;lt;p&amp;gt;&amp;amp;copy; 2025 MyBrand. All rights reserved.&amp;lt;/p&amp;gt;&lt;br&gt;
&amp;lt;/footer&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Short, simple, clean.&lt;/p&gt;

&lt;p&gt;Done in under 20 minutes (with time to spare).&lt;/p&gt;

&lt;h2&gt;
  
  
  💡 Quick Tips That Helped
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Use &lt;code&gt;md:&lt;/code&gt; and &lt;code&gt;lg:&lt;/code&gt; breakpoints early for responsive tweaks.&lt;/li&gt;
&lt;li&gt;Stick to a consistent padding/margin scale. (&lt;code&gt;p-4&lt;/code&gt;, &lt;code&gt;py-6&lt;/code&gt;, &lt;code&gt;mb-4&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Tailwind UI or Heroicons can speed up design.&lt;/li&gt;
&lt;li&gt;Try using &lt;code&gt;@apply&lt;/code&gt; in real projects for reusability.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Tailwind CSS isn’t just hype — it genuinely speeds up frontend workflows without sacrificing design flexibility.&lt;/p&gt;

&lt;p&gt;Whether you're prototyping or building production UIs, it helps keep things consistent and clean.&lt;/p&gt;

&lt;p&gt;If you liked this post, drop a ❤️ or comment&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>nextjs</category>
      <category>react</category>
    </item>
  </channel>
</rss>
