{"id":368179,"date":"2023-02-10T10:01:57","date_gmt":"2023-02-10T10:01:57","guid":{"rendered":"https:\/\/webkul.com\/blog\/?p=368179"},"modified":"2026-02-26T13:35:08","modified_gmt":"2026-02-26T13:35:08","slug":"how-to-use-tailwind-css-in-next-js","status":"publish","type":"post","link":"https:\/\/webkul.com\/blog\/how-to-use-tailwind-css-in-next-js\/","title":{"rendered":"Tailwind implementation in Next.js"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Installing and using Tailwind CSS with Next.js<\/h2>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Create your project<\/strong><\/h2>\n\n\n\n<p>To start creating some UI&#8217;s awesome first create a new <a href=\"https:\/\/webkul.com\/nextjs-development-services\/\" target=\"_blank\" rel=\"noreferrer noopener\">Next.js<\/a> project to use Tailwind CSS with it. if you don\u2019t have one set up already and if you already created one move on to the next step.<\/p>\n\n\n\n<p>The most common approach is to use&nbsp;<a href=\"https:\/\/nextjs.org\/docs\/api-reference\/create-next-app\">Create Next App<\/a>.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">npx create-next-app@latest<\/pre>\n\n\n\n<p>after creating the project go inside the project directory and install Tailwind as instructed below:<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Install Tailwind CSS<\/h2>\n\n\n\n<p>Next, Install&nbsp;<code>tailwindcss<\/code> too&nbsp;and add its peer dependencies via npm, and then run the init command to create both&nbsp;<strong><code>tailwind.config.js<\/code>&nbsp;<\/strong>and<strong>&nbsp;<code>postcss.config.js<\/code>.<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">\/\/For tailwind install\nnpm install -D tailwindcss postcss autoprefixer\n\/\/For config file\nnpx tailwindcss init -p<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Configure your template paths<\/h2>\n\n\n\n<p>And then add the paths to all of your template files in your&nbsp;<code><strong>tailwind.config.js<\/strong><\/code><mark style=\"background-color:#abb8c3\" class=\"has-inline-color\">&nbsp;<\/mark>file.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">\/** @type {import(&#039;tailwindcss&#039;).Config} *\/\nmodule.exports = {\n  content: &#091;\n    &quot;.\/app\/**\/*.{js,ts,jsx,tsx}&quot;,\n    &quot;.\/pages\/**\/*.{js,ts,jsx,tsx}&quot;,\n    &quot;.\/components\/**\/*.{js,ts,jsx,tsx}&quot;,\n  ],\n  theme: {\n    extend: {},\n  },\n  plugins: &#091;],\n}<\/pre>\n\n\n\n<p>and if you are using the src directory add their path in the content as well:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&quot;.\/src\/**\/*.{js,ts,jsx,tsx}&quot;,<\/pre>\n\n\n\n<p>Furthermore, like this, you can add any path in your config file to use tailwind in that directory.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Add the Tailwind directives to your CSS<\/h2>\n\n\n\n<p>Completed the above steps? <\/p>\n\n\n\n<p>Then Move on to the next step finally, and add the&nbsp;<code><strong>@tailwind<\/strong><\/code>&nbsp;directives for each Tailwind\u2019s layers to your&nbsp;<code><strong>globals.css<\/strong><\/code>&nbsp;file or any file in which you want to use Tailwind.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">@tailwind base;\n@tailwind components;\n@tailwind utilities;<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Start using Tailwind and create awesome designs<\/h2>\n\n\n\n<p>After all this finally, you are ready to use tailwind in your next.js project and make UI&#8217;s with responsiveness.<\/p>\n\n\n\n<p>And lots of customization without creating lots of classes and without making your project bulky.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">     &lt;div className=&quot;max-w-sm px-8 py-8 mx-auto space-y-2 bg-white shadow-lg rounded-xl sm:py-4 sm:flex sm:items-center sm:space-y-0 sm:space-x-6&quot;&gt;\n        &lt;Image\n          src={PLACEHOLDER_IMG}\n          width={80}\n          height={80}\n          alt=&quot;demo&quot;\n          className=&quot;rounded-full&quot;\n        \/&gt;\n        &lt;div className=&quot;space-y-2 text-center sm:text-left&quot;&gt;\n          &lt;div className=&quot;space-y-0.5&quot;&gt;\n            &lt;p className=&quot;text-lg font-semibold text-black&quot;&gt;Erin Lindford&lt;\/p&gt;\n            &lt;p className=&quot;font-medium text-slate-500&quot;&gt;Software Engineer&lt;\/p&gt;\n          &lt;\/div&gt;\n          &lt;button className=&quot;px-4 py-1 text-sm font-semibold text-purple-600 border border-purple-200 rounded-full hover:text-white hover:bg-purple-600 hover:border-transparent focus:outline-none focus:ring-2 focus:ring-purple-600 focus:ring-offset-2&quot;&gt;\n            Message\n          &lt;\/button&gt;\n        &lt;\/div&gt;\n      &lt;\/div&gt;<\/pre>\n\n\n\n<figure class=\"wp-block-image size-full is-resized is-style-default\" id=\"https:\/\/tailwindcss.com\/docs\/utility-first-why-not-just-use-inline-styles\"><img decoding=\"async\" width=\"1600\" height=\"800\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/12\/name_card.png\" alt=\"name_card\" class=\"wp-image-415308\" style=\"width:823px;height:315px\" title=\"Name Card\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/12\/name_card.png 1600w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/12\/name_card-300x150.png 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/12\/name_card-1200x600.png 1200w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/12\/name_card-250x125.png 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/12\/name_card-768x384.png 768w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/12\/name_card-1536x768.png 1536w\" sizes=\"(max-width: 1600px) 100vw, 1600px\" loading=\"lazy\" \/><figcaption class=\"wp-element-caption\">Name Card<\/figcaption><\/figure>\n\n\n\n<p>and if you want to use CSS in an external file:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">.btn{\n@apply text-purple-600 font-semibold rounded-full border border-purple-200 hover:text-white;\n}<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Why choose Tailwind over other CSS frameworks?<\/strong><\/h2>\n\n\n\n<p>Tailwind CSS is a utility-first CSS framework developed to enable users to create applications faster, more modular, and easier. <\/p>\n\n\n\n<p>You can use utility classes like text-[], font-[], and hover: to control the layout, color, spacing, typography, shadows. <\/p>\n\n\n\n<p>And more to create a completely custom component design \u2014 without leaving your HTML or writing a single line of custom CSS only using tailwind.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Some benefits of using tailwindCss<\/h4>\n\n\n\n<p>There are many benefits of using the CSS framework Tailwind over other frameworks. Below are the major ones.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Write less or even no custom CSS Or without meaning fewer classes<\/strong>. With TailwindCss, you style elements by applying pre-defined reusable classes directly in your HTML. By using utility classes in this way, you can build custom designs without writing CSS. <\/li>\n\n\n\n<li>And besides all of this tailwind provides <a href=\"https:\/\/tailwindcss.com\/docs\/adding-custom-styles#customizing-your-theme\" target=\"_blank\" rel=\"noreferrer noopener\">tailwind.config<\/a> file as well for custom CSS and <a href=\"https:\/\/tailwindcss.com\/docs\/adding-custom-styles#using-arbitrary-values\" target=\"_blank\" rel=\"noreferrer noopener\">arbitrary<\/a> values as well for your custom value.<\/li>\n\n\n\n<li><strong>You keep CSS files small or even<\/strong> <strong>don&#8217;t need them.<\/strong>&nbsp;Without a framework like Tailwind, you have to keep writing CSS and then projects become bulky and have a large number of meaningless classes. <\/li>\n\n\n\n<li>By using utilities like Tailwind\u2019s grid and margin utilities, most styles are reusable so you rarely need to write or even no need to write new CSS and you can even create your desired classes through the Tailwind config file.<\/li>\n\n\n\n<li><strong>You can make safer changes.<\/strong>&nbsp;With the traditional approach, if you make any changes to CSS, you may have chances to break something across your site. <\/li>\n\n\n\n<li>Unlike CSS, utility classes in your HTML are local. This means that you can change them without worrying about breaking or diminishing something else on your page or on your site.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Here are some Main Features of tailwind<\/h2>\n\n\n\n<h4 class=\"wp-block-heading\">Tailwind is a Utility-First Framework: <\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>You aren\u2019t wasting energy inventing new class names which may be meaningless<\/strong>. No more adding silly class names like&nbsp;<code>outer-div<\/code>&nbsp;just to be able to style something, and no more worrying over the perfect abstract or meaningful name for something that\u2019s really just a flex container.<\/li>\n\n\n\n<li><strong>Your CSS stops growing<\/strong> <strong>and becomes reusable<\/strong>. Using the old approach of CSS, your CSS files get bigger every time you add a new feature. With utilities and predefined classes, everything is reusable so you rarely need to write new CSS.<\/li>\n\n\n\n<li><strong> Changes become safer<\/strong> <strong>and easier<\/strong>. CSS is global and you never know what you\u2019re breaking when you make a change. Classes in your HTML are local, so you can change them without worrying about something else breaking.<\/li>\n\n\n\n<li>And then finally, if you want to create your own classes no worries you can create them as well by your tailwind config file in this way:<\/li>\n<\/ul>\n\n\n\n<pre class=\"EnlighterJSRAW\">module.exports = {\n  theme: {\n    screens: {\n      xl: &#039;1440px&#039;,\n    },\n    colors: {\n      &#039;blue&#039;: &#039;#1fb6ff&#039;,\n      &#039;gray-light&#039;: &#039;#d3dce6&#039;,\n    },\n    fontFamily: {\n      sans: &#091;&#039;Graphik&#039;, &#039;sans-serif&#039;],\n    },\n    extend: {\n      spacing: {\n        &#039;144&#039;: &#039;36rem&#039;,\n      },\n    }\n  }\n}<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Tailwind makes design responsive<\/h4>\n\n\n\n<p>Using responsive utility variants to build adaptive user interfaces.<\/p>\n\n\n\n<h5 class=\"wp-block-heading\" id=\"overview\">Overview<\/h5>\n\n\n\n<p>Moreover, Every utility class in Tailwind can be applied conditionally at different breakpoints, which makes it super easy to build complex responsive interfaces in addition to ever leaving your HTML.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong><mark style=\"background-color:#ffffff\" class=\"has-inline-color has-black-color\">md:    768px<\/mark><\/strong><\/li>\n\n\n\n<li><strong><mark style=\"background-color:#ffffff\" class=\"has-inline-color has-black-color\">lg:   1024px<\/mark><\/strong><\/li>\n\n\n\n<li><strong><mark style=\"background-color:#ffffff\" class=\"has-inline-color has-black-color\">xl:   1280px<\/mark><\/strong><\/li>\n\n\n\n<li><strong><mark style=\"background-color:#ffffff\" class=\"has-inline-color has-black-color\">2xl:    1536px<\/mark><\/strong><\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">Furthermore, It supports all your pseudo-classes<\/h4>\n\n\n\n<p>Every utility class in Tailwind can be applied&nbsp;<em>conditionally<\/em>&nbsp;by adding a modifier to the beginning of the class name that describes the condition you want to target.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/tailwindcss.com\/docs\/hover-focus-and-other-states#pseudo-classes\" target=\"_blank\" rel=\"noreferrer noopener\">Pseudo-classes<\/a>, like&nbsp;<strong><code>:hover<\/code>,&nbsp;<code>:focus<\/code>,&nbsp;<code>:first-child<\/code><\/strong><code>, etc<\/code><\/li>\n\n\n\n<li><a href=\"https:\/\/tailwindcss.com\/docs\/hover-focus-and-other-states#pseudo-elements\">Pseudo-elements<\/a>, like&nbsp;<strong><code>::before<\/code>,&nbsp;<code>::after<\/code><\/strong>, etc.<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">Tailwind dark mode<\/h4>\n\n\n\n<p>And finally, Now the tailwind awesome dark mode feature is a first-class feature for many operating systems, it\u2019s becoming more and more common to design a dark version of your website. <\/p>\n\n\n\n<p>The reason for that is trends or some health reasons to go along with the default design. A dark pseudo-class is well provided in tailwind:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">  &lt;div className=&quot;text-black dark:text-white&quot;&gt;<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Adding Custom Styles<\/h4>\n\n\n\n<p>Furthermore creating UI&#8217;s biggest challenge is when working with a framework and figuring out what you\u2019re supposed to do when there\u2019s something you need that the framework doesn\u2019t handle for you.<\/p>\n\n\n\n<p>Tailwind has many options for that condition as well and Tailwind is too extensible and customizable. So that no matter what you\u2019re building you never feel like you\u2019re fighting the framework. <\/p>\n\n\n\n<p>Some ways are:<\/p>\n\n\n\n<h5 class=\"wp-block-heading\">Customize through config file:<\/h5>\n\n\n\n<p>Furthermore, Want to change things like your spacing scale, or typography scale add your customizations to the&nbsp;<code>theme<\/code>&nbsp;section of your&nbsp;<code><strong>tailwind.config.js<\/strong><\/code> file:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">module.exports = {\n  theme: {\n    extend: {\n      spacing: {\n        &#039;128&#039;: &#039;32rem&#039;,\n        &#039;144&#039;: &#039;36rem&#039;,\n      },\n      textSize: {\n        &#039;4xl&#039;: &#039;2rem&#039;,\n      }\n    }\n  }\n}<\/pre>\n\n\n\n<h5 class=\"wp-block-heading\" id=\"using-arbitrary-values\">By arbitrary values:<\/h5>\n\n\n\n<p>While creating well-crafted designs using a set of design tokens, once in a while you need to break out of those tailwind constraints to get things to look as good as you need.<\/p>\n\n\n\n<p>When you find yourself really needing something like&nbsp;font: 2rem&nbsp;to get a text in just the right size, use Tailwind\u2019s square bracket notation to generate a class with any arbitrary value:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;h2 className=&quot;text-&#091;2rem]&quot;&gt;\n You can customize any thing like this\n&lt;\/h2&gt;<\/pre>\n\n\n\n<h5 class=\"wp-block-heading\" id=\"arbitrary-properties\">Arbitrary properties<\/h5>\n\n\n\n<p>Like arbitrary values, if you ever need to use a CSS property that Tailwind doesn\u2019t include a utility for out of the box then no worries. <\/p>\n\n\n\n<p>You can also use square bracket notation to write completely arbitrary CSS:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;div className=&quot;hover:&#091;mask-type:alpha]&quot;&gt;\n&lt;p&gt;You can design in your own way by this.&lt;\/p&gt;\n&lt;\/div&gt;<\/pre>\n\n\n\n<h5 class=\"wp-block-heading\">Arbitrary variants<\/h5>\n\n\n\n<p>Arbitrary&nbsp;variants these are&nbsp;are like arbitrary values but for doing selector modification in a tailwinds way like you have a built-in pseudo-class for that variant<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;ul role=&quot;list&quot; className=&quot;lg:&#091;&amp;:nth-child(3)]:hover:underline&quot;&gt;\n    &lt;li &gt;item1&lt;\/li&gt;\n    &lt;li &gt;item2&lt;\/li&gt;\n    &lt;li &gt;item3&lt;\/li&gt;\n&lt;\/ul&gt;<\/pre>\n\n\n\n<h5 class=\"wp-block-heading\">White spaces<\/h5>\n\n\n\n<p>You can handle white space in your custom classes by an <strong>_<\/strong> and if you need an underscore in any case use <strong>\\_. <\/strong>Ways of doing this are:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">\/\/If you need a space\n\nclassName=&quot;before:content-&#091;&#039;tailwind_nextjs&#039;]&quot;\n\n\/* if you need a underscore\nString.raw() so the backslash isn\u2019t treated as a JavaScript escape character. *\/\n\nclassName={String.raw`before:content-&#091;&#039;tailwind\\_nextjs&#039;]`}<\/pre>\n\n\n\n<h5 class=\"wp-block-heading\">And finally, custom CSS<\/h5>\n\n\n\n<p>If you want to add too many customs you can also add this way:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">@tailwind base;\n@tailwind components;\n\n\/* This will always be included in your compiled CSS *\/\n.card {\n  background-color: lightblue;\n}\n\n@tailwind utilities;<\/pre>\n\n\n\n<h5 class=\"wp-block-heading\">Plugins<\/h5>\n\n\n\n<p>You can use any number of plugins to create UI like <a href=\"https:\/\/cssnano.co\/\" target=\"_blank\" rel=\"noreferrer noopener\">cssnano<\/a>, forms, typography, and other things. You can add them in this way:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">\/\/tailwind plugins in tailwind config\nmodule.exports = {\n  \/\/ ...\n  plugins: &#091;\n    require(&#039;@tailwindcss\/forms&#039;),\n    require(&#039;@tailwindcss\/typography&#039;),\n  ],\n}\n\n\/\/and other plugins in postcss config\nmodule.exports = {\n  plugins: {\n\n    ...(process.env.NODE_ENV === &#039;production&#039; ? { cssnano: {} } : {})\n  }\n}<\/pre>\n\n\n\n<p><strong>Note: <\/strong><a href=\"https:\/\/cssnano.co\/\" target=\"_blank\" rel=\"noreferrer noopener\">cssnano<\/a> takes your nicely formatted CSS and runs it through many focused optimizations, to ensure that the final result is as small as possible for a production environment.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Now you are ready to use tailwind:<\/h2>\n\n\n\n<p>Now you are free to use Tailwind on your own after creating this much and you are free to <a href=\"https:\/\/webkul.com\/blog\/how-to-use-tailwind-css-in-next-js\/\">Read it again<\/a>. <\/p>\n\n\n\n<p>For more info visit tailwind&#8217;s official documentation: <a href=\"https:\/\/tailwindcss.com\/docs\/installation\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/tailwindcss.com\/docs\/installation<\/a>.<\/p>\n\n\n\n<p><strong>For next.js you can visit: <a href=\"https:\/\/nextjs.org\/\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/nextjs.org\/<\/a><\/strong><\/p>\n\n\n\n<p><strong><strong>Check out Tailwind implementation with Mui as well in Next.js <a href=\"https:\/\/webkul.com\/blog\/tailwind-css-material-ui-with-next-js\/\">here<\/a>.<\/strong><\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Installing and using Tailwind CSS with Next.js Create your project To start creating some UI&#8217;s awesome first create a new Next.js project to use Tailwind CSS with it. if you don\u2019t have one set up already and if you already created one move on to the next step. The most common approach is to use&nbsp;Create <a href=\"https:\/\/webkul.com\/blog\/how-to-use-tailwind-css-in-next-js\/\">[&#8230;]<\/a><\/p>\n","protected":false},"author":496,"featured_media":368346,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1202,198,924,1177,6124],"tags":[217,2824,12572,6449,13578,13579],"class_list":["post-368179","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-design-trends","category-javascript","category-responsive","category-theme","category-user-experience","tag-css","tag-design","tag-next-js","tag-responsiveness","tag-tailwindcss","tag-user-interface"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Ready to use Tailwind css + Next.js - Continue with webkul blog<\/title>\n<meta name=\"description\" content=\"Create UI&#039;s in next.js with tailwind CSS on your own with lots of customization and without any meaningless classes with full responsiveness.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/webkul.com\/blog\/how-to-use-tailwind-css-in-next-js\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Ready to use Tailwind css + Next.js - Continue with webkul blog\" \/>\n<meta property=\"og:description\" content=\"Create UI&#039;s in next.js with tailwind CSS on your own with lots of customization and without any meaningless classes with full responsiveness.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webkul.com\/blog\/how-to-use-tailwind-css-in-next-js\/\" \/>\n<meta property=\"og:site_name\" content=\"Webkul Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webkul\/\" \/>\n<meta property=\"article:published_time\" content=\"2023-02-10T10:01:57+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-02-26T13:35:08+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/02\/g71rf0asqkk4dstgorpk.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"1600\" \/>\n\t<meta property=\"og:image:height\" content=\"900\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"Arun Tiwari\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@webkul\" \/>\n<meta name=\"twitter:site\" content=\"@webkul\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Arun Tiwari\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":[\"Article\",\"BlogPosting\"],\"@id\":\"https:\/\/webkul.com\/blog\/how-to-use-tailwind-css-in-next-js\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-use-tailwind-css-in-next-js\/\"},\"author\":{\"name\":\"Arun Tiwari\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/b3d968b3f55f433fda5b0d660dbea4aa\"},\"headline\":\"Tailwind implementation in Next.js\",\"datePublished\":\"2023-02-10T10:01:57+00:00\",\"dateModified\":\"2026-02-26T13:35:08+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-use-tailwind-css-in-next-js\/\"},\"wordCount\":1284,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-use-tailwind-css-in-next-js\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/02\/g71rf0asqkk4dstgorpk.webp\",\"keywords\":[\"css\",\"Design\",\"Next.js\",\"responsiveness\",\"TailwindCss\",\"User Interface\"],\"articleSection\":[\"Design Trends\",\"JavaScript\",\"responsive\",\"Theme\",\"User Experience\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/webkul.com\/blog\/how-to-use-tailwind-css-in-next-js\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/webkul.com\/blog\/how-to-use-tailwind-css-in-next-js\/\",\"url\":\"https:\/\/webkul.com\/blog\/how-to-use-tailwind-css-in-next-js\/\",\"name\":\"Ready to use Tailwind css + Next.js - Continue with webkul blog\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-use-tailwind-css-in-next-js\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-use-tailwind-css-in-next-js\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/02\/g71rf0asqkk4dstgorpk.webp\",\"datePublished\":\"2023-02-10T10:01:57+00:00\",\"dateModified\":\"2026-02-26T13:35:08+00:00\",\"description\":\"Create UI's in next.js with tailwind CSS on your own with lots of customization and without any meaningless classes with full responsiveness.\",\"breadcrumb\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-use-tailwind-css-in-next-js\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webkul.com\/blog\/how-to-use-tailwind-css-in-next-js\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/how-to-use-tailwind-css-in-next-js\/#primaryimage\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/02\/g71rf0asqkk4dstgorpk.webp\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/02\/g71rf0asqkk4dstgorpk.webp\",\"width\":1600,\"height\":900,\"caption\":\"use-tailwind-in-next.js\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webkul.com\/blog\/how-to-use-tailwind-css-in-next-js\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/webkul.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Tailwind+Next.js\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/webkul.com\/blog\/#website\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"name\":\"Webkul Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/webkul.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/webkul.com\/blog\/#organization\",\"name\":\"WebKul Software Private Limited\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"width\":380,\"height\":380,\"caption\":\"WebKul Software Private Limited\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webkul\/\",\"https:\/\/x.com\/webkul\",\"https:\/\/www.instagram.com\/webkul\/\",\"https:\/\/www.linkedin.com\/company\/webkul\",\"https:\/\/www.youtube.com\/user\/webkul\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/b3d968b3f55f433fda5b0d660dbea4aa\",\"name\":\"Arun Tiwari\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/07faf0906e0520912140e99abd63bf5620be60c11bb1220fe25dacda8a9f4896?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/07faf0906e0520912140e99abd63bf5620be60c11bb1220fe25dacda8a9f4896?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"caption\":\"Arun Tiwari\"},\"description\":\"Arun Tiwari, a skilled Software Engineer, specializes in making Magento Headless compatible extensions. With deep expertise in headless architecture, Arun crafts seamless, scalable solutions.\",\"url\":\"https:\/\/webkul.com\/blog\/author\/aruntiwari-mg565\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Ready to use Tailwind css + Next.js - Continue with webkul blog","description":"Create UI's in next.js with tailwind CSS on your own with lots of customization and without any meaningless classes with full responsiveness.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/webkul.com\/blog\/how-to-use-tailwind-css-in-next-js\/","og_locale":"en_US","og_type":"article","og_title":"Ready to use Tailwind css + Next.js - Continue with webkul blog","og_description":"Create UI's in next.js with tailwind CSS on your own with lots of customization and without any meaningless classes with full responsiveness.","og_url":"https:\/\/webkul.com\/blog\/how-to-use-tailwind-css-in-next-js\/","og_site_name":"Webkul Blog","article_publisher":"https:\/\/www.facebook.com\/webkul\/","article_published_time":"2023-02-10T10:01:57+00:00","article_modified_time":"2026-02-26T13:35:08+00:00","og_image":[{"width":1600,"height":900,"url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/02\/g71rf0asqkk4dstgorpk.webp","type":"image\/webp"}],"author":"Arun Tiwari","twitter_card":"summary_large_image","twitter_creator":"@webkul","twitter_site":"@webkul","twitter_misc":{"Written by":"Arun Tiwari","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":["Article","BlogPosting"],"@id":"https:\/\/webkul.com\/blog\/how-to-use-tailwind-css-in-next-js\/#article","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/how-to-use-tailwind-css-in-next-js\/"},"author":{"name":"Arun Tiwari","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/b3d968b3f55f433fda5b0d660dbea4aa"},"headline":"Tailwind implementation in Next.js","datePublished":"2023-02-10T10:01:57+00:00","dateModified":"2026-02-26T13:35:08+00:00","mainEntityOfPage":{"@id":"https:\/\/webkul.com\/blog\/how-to-use-tailwind-css-in-next-js\/"},"wordCount":1284,"commentCount":0,"publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"image":{"@id":"https:\/\/webkul.com\/blog\/how-to-use-tailwind-css-in-next-js\/#primaryimage"},"thumbnailUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/02\/g71rf0asqkk4dstgorpk.webp","keywords":["css","Design","Next.js","responsiveness","TailwindCss","User Interface"],"articleSection":["Design Trends","JavaScript","responsive","Theme","User Experience"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/webkul.com\/blog\/how-to-use-tailwind-css-in-next-js\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/webkul.com\/blog\/how-to-use-tailwind-css-in-next-js\/","url":"https:\/\/webkul.com\/blog\/how-to-use-tailwind-css-in-next-js\/","name":"Ready to use Tailwind css + Next.js - Continue with webkul blog","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/webkul.com\/blog\/how-to-use-tailwind-css-in-next-js\/#primaryimage"},"image":{"@id":"https:\/\/webkul.com\/blog\/how-to-use-tailwind-css-in-next-js\/#primaryimage"},"thumbnailUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/02\/g71rf0asqkk4dstgorpk.webp","datePublished":"2023-02-10T10:01:57+00:00","dateModified":"2026-02-26T13:35:08+00:00","description":"Create UI's in next.js with tailwind CSS on your own with lots of customization and without any meaningless classes with full responsiveness.","breadcrumb":{"@id":"https:\/\/webkul.com\/blog\/how-to-use-tailwind-css-in-next-js\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webkul.com\/blog\/how-to-use-tailwind-css-in-next-js\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/how-to-use-tailwind-css-in-next-js\/#primaryimage","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/02\/g71rf0asqkk4dstgorpk.webp","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/02\/g71rf0asqkk4dstgorpk.webp","width":1600,"height":900,"caption":"use-tailwind-in-next.js"},{"@type":"BreadcrumbList","@id":"https:\/\/webkul.com\/blog\/how-to-use-tailwind-css-in-next-js\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webkul.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Tailwind+Next.js"}]},{"@type":"WebSite","@id":"https:\/\/webkul.com\/blog\/#website","url":"https:\/\/webkul.com\/blog\/","name":"Webkul Blog","description":"","publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/webkul.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/webkul.com\/blog\/#organization","name":"WebKul Software Private Limited","url":"https:\/\/webkul.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","width":380,"height":380,"caption":"WebKul Software Private Limited"},"image":{"@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webkul\/","https:\/\/x.com\/webkul","https:\/\/www.instagram.com\/webkul\/","https:\/\/www.linkedin.com\/company\/webkul","https:\/\/www.youtube.com\/user\/webkul\/"]},{"@type":"Person","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/b3d968b3f55f433fda5b0d660dbea4aa","name":"Arun Tiwari","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/07faf0906e0520912140e99abd63bf5620be60c11bb1220fe25dacda8a9f4896?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/07faf0906e0520912140e99abd63bf5620be60c11bb1220fe25dacda8a9f4896?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","caption":"Arun Tiwari"},"description":"Arun Tiwari, a skilled Software Engineer, specializes in making Magento Headless compatible extensions. With deep expertise in headless architecture, Arun crafts seamless, scalable solutions.","url":"https:\/\/webkul.com\/blog\/author\/aruntiwari-mg565\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/368179","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/users\/496"}],"replies":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/comments?post=368179"}],"version-history":[{"count":28,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/368179\/revisions"}],"predecessor-version":[{"id":475049,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/368179\/revisions\/475049"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/media\/368346"}],"wp:attachment":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/media?parent=368179"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/categories?post=368179"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/tags?post=368179"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}