Careeroza
Real World Example
A Responsive Product Grid
Every shopping site has the same grid: 2 columns on phones, 3 on tablets, 4–5 on laptops. Indian traffic is mostly mobile, so design phone-first.
import ProductCard from '@/components/ProductCard';
import { getProducts } from '@/lib/products';
export default async function ProductsPage() {
const products = await getProducts();
return (
<section className="mx-auto max-w-7xl px-4">
<h1 className="font-display text-2xl font-bold my-6">Mobiles</h1>
<div className="grid grid-cols-2 gap-3 sm:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5">
{products.map((p) => (
<ProductCard key={p.id} name={p.name} price={p.price} mrp={p.mrp} />
))}
</div>
</section>
);
}Which Styling Option
| Option | Pick when |
|---|---|
| Tailwind CSS | New projects, fast UI work, design systems like shadcn/ui |
| CSS Modules | You prefer writing CSS, or migrating existing CSS |
| Global CSS | Resets, variables, third-party widget styles |
| CSS-in-JS (styled-components) | Only in Client Components; extra setup with the App Router |