Grid Layout

This is a Grid Layout component.

Normal Card

This is a simple card.

Wide Card

This card spans multiple columns and is great for larger content.

Full-Width Card

This card spans the entire width of the grid.

Installation

1. Dependencies

npm install clsx tailwind-merge

2. Paste inside @/lib/utils.ts

import { clsx } from "clsx";
import { twMerge } from "tailwind-merge";

export function cn(...inputs: Parameters<typeof clsx>) {
  return twMerge(clsx(...inputs));
}

3. Copy Grid Layout Code

Loading...

Copy Grid Layout Code

Grid Props

NameTypeRequiredDefaultDescription
childrenReactNodeYesundefinedThe child elements to be rendered inside the grid.
classNamestringNo""Additional class names for styling.
colsstringNo1 to 4Number of columns in the grid.
gapstringNo"gap-6"Gap between grid items.

GridCol Props

NameTypeRequiredDefaultDescription
childrenReactNodeYesundefinedThe child elements to be rendered inside the grid column.
classNamestringNo""Additional class names for styling.
colSpanstringNo"col-span-1"Custom col-span if needed.
variant"card" | "wide" | "full"No"card"Predefined variant options for col-span.