Background
Break News
How to add local font to Tailwind Css and NextJS? - Tutorial Design Pattern? - Blockchain Technology, How to create own Bitcoin virtual currency - Zustand mordern management state - Design Pattern - Flyweight Pattern? - Docker Full training Topic

[Tips] Tailwind CSS Fast build sale category items with Tailwind CSS and NextJS

Wednesday, 23 November 2022
|
Read: Completed in minutes

[Tips] Tailwind CSS Fast build sale category items with Tailwind CSS and NextJS

 ✋✋✋Hello everyone, welcome back to Learn Tech Tips Blogspot. I am Zidane (大家好, 我是雞蛋🥚🥚) 

Fast Build Sale Category Items with Tailwind CSS and NextJS

This topic is for NextJS developer, who is working with NextJS and want to fast build UI without write CSS, this topic is for you. On this topic I will use Tailwind css (Slogan: Rapid build modern website without ever leaving your HTML - The slogan is so impressive that I was fascinated and curious when I first met, The Tailwind is very cool and very useful for frontend developer now. Thanks Tailwind) and NextJS for build one page recent search, you will see Tailwind very helpful in build UI. As my idea, Tailwind maybe will become a new trends on the future for web development, because of its convenience and support fast build, I really love it now.

 

Fast build sale category items with Tailwind CSS and NextJS


Ok. Let's go though the topic, Let check the UI below and please imagine if you want to build it with normal CSS , how much time you will complete, but with Tailwind you just need around 20-30 minutes for not professional. Its true, hehe, let check it out from my video

@learntechtips Easy build sale category item component with Tailwind #tailwind #tailwindcss #ui #frontend #learntechtipszidane ♬ Motivation For Success - TimTaj

 

 

 

 Or you can reference on source code here

        
import Image from "next/image";
import Head from "next/head";
import WomanLongSleeved from "/public/images/woman-long-sleeved.jpg";

export default function sale() {
return (
<>
<div>
<Head>
<title> Woman long sleeved </title>
<link rel="icon" href="/favicon.ico" />
</Head>
</div>

<div className="flex font-sans p-4 bg-white shadow-lg m-8 rounded-lg max-w-lg">
<div className="flex-none w-48 relative">
<div className="absolute inset-0 w-full h-full object-cover">
<Image
src={WomanLongSleeved}
alt ="long sleeved"
layout="fill"
objectFit='contain'
/>
</div>
</div>
<form className="flex-auto p-6">
<div className="flex flex-wrap">
<h1 className="flex-auto text-lg font-semibold text-slate-900">
Woman long-sleeved
</h1>
<div className="text-lg font-semibold text-rose-500">$110.00</div>
<div className="w-full flex-none text-sm font-medium text-slate-700 mt-2">
In stock
</div>
</div>
<div className="mt-4 mb-6 pb-6 border-b border-slate-200">
<div className="space-x-2 flex text-sm">
<label>
<input
className="sr-only peer"
name="size"
type="radio"
value="xs"
checked
/>
<div className="w-9 h-9 rounded-lg flex items-center justify-center text-slate-700 peer-checked:font-semibold peer-checked:bg-slate-900 peer-checked:text-white">
XS
</div>
</label>
<label>
<input
className="sr-only peer"
name="size"
type="radio"
value="s"
/>
<div className="w-9 h-9 rounded-lg flex items-center justify-center text-slate-700 peer-checked:font-semibold peer-checked:bg-slate-900 peer-checked:text-white">
S
</div>
</label>
<label>
<input
className="sr-only peer"
name="size"
type="radio"
value="m"
/>
<div className="w-9 h-9 rounded-lg flex items-center justify-center text-slate-700 peer-checked:font-semibold peer-checked:bg-slate-900 peer-checked:text-white">
M
</div>
</label>
<label>
<input
className="sr-only peer"
name="size"
type="radio"
value="l"
/>
<div className="w-9 h-9 rounded-lg flex items-center justify-center text-slate-700 peer-checked:font-semibold peer-checked:bg-slate-900 peer-checked:text-white">
L
</div>
</label>
<label>
<input
className="sr-only peer"
name="size"
type="radio"
value="xl"
/>
<div className="w-9 h-9 rounded-lg flex items-center justify-center text-slate-700 peer-checked:font-semibold peer-checked:bg-slate-900 peer-checked:text-white">
XL
</div>
</label>
</div>
</div>
<div className="flex space-x-4 mb-6 text-sm font-medium">
<div className="flex-auto flex space-x-4">
<button
className="h-10 px-6 font-semibold rounded-md bg-black text-white"
type="submit"
>
Buy now
</button>
<button
className="h-10 px-6 font-semibold rounded-md border border-slate-200 text-slate-900 w-full"
type="button"
>
Add to bag
</button>
</div>
<button
className="flex-none flex items-center justify-center w-9 h-9 rounded-md text-slate-300 border border-slate-200"
type="button"
aria-label="Like"
>
<svg
width="20"
height="20"
fill="currentColor"
aria-hidden="true"
>
<path
fill-rule="evenodd"
clip-rule="evenodd"
d="M3.172 5.172a4 4 0 015.656 0L10 6.343l1.172-1.171a4 4 0 115.656 5.656L10 17.657l-6.828-6.829a4 4 0 010-5.656z"
/>
</svg>
</button>
</div>
<p className="text-sm text-slate-700">
Free shipping on all continental US orders.
</p>
</form>
</div>
</>
);
}

Or you can view on live demo here:

https://nextjs-cms-tailwind-zidane168.vercel.app/admin/member/ui/sale


 

Thanks for reading fast build sale category items with Tailwind CSS and NextJS topic. I hope this helps. Feel free to ask back any questions and let us know how it goes, I will keep working with you until it's resolved.
✋✋✋✋ Learn Tech Tips - I am Zidane, See you next time

 

 


🙇🏼🙇🏼 We Appreciate Your Comments and Suggestions - Webzone, all things Tech Tips web development
Popular Webzone Tech Tips topic maybe you will be like it - by Webzone Tech Tips - Zidane
As a student, I found Blogspot very useful when I joined in 2014. I have been a developer for years . To give back and share what I learned, I started Webzone, a blog with tech tips. You can also search for tech tips zidane on Google and find my helpful posts. Love you all,

I am glad you visited my blog. I hope you find it useful for learning tech tips and webzone tricks. If you have any technical issues, feel free to browse my posts and see if they can help you solve them. You can also leave a comment or contact me if you need more assistance. Here is my blog address: https://learn-tech-tips.blogspot.com.

My blog where I share my passion for web development, webzone design, and tech tips. You will find tutorials on how to build websites from scratch, using hot trends frameworks like nestjs, nextjs, cakephp, devops, docker, and more. You will also learn how to fix common bugs on development, like a mini stackoverflow. Plus, you will discover how to easily learn programming languages such as PHP (CAKEPHP, LARAVEL), C#, C++, Web(HTML, CSS, javascript), and other useful things like Office (Excel, Photoshop). I hope you enjoy my blog and find it helpful for your projects. :)

Thanks and Best Regards!
Follow me on Tiktok @learntechtips and send me a direct message. I will be happy to chat with you.
Webzone - Zidane (huuvi168@gmail.com)
I'm developer, I like code, I like to learn new technology and want to be friend with people for learn each other
I'm a developer who loves coding, learning new technologies, and making friends with people who share the same passion. I have been a full stack developer since 2015, with more than years of experience in web development.
Copyright @2022(November) Version 1.0.0 - By Webzone, all things Tech Tips for Web Development Zidane
https://learn-tech-tips.blogspot.com