A web application for creating CSS Grid layouts with drag and drop functionality. Build grid layouts visually and export CSS or Tailwind CSS code.
Inspirations:
- https://cssgrid-generator.netlify.app
- https://www.tailwindgen.com
- https://github.com/react-grid-layout/react-grid-layout
- Visual grid builder with drag and drop interface
- Configurable grid dimensions and gap spacing
- Real-time preview of grid layouts
- Code generation for CSS, HTML, and Tailwind CSS
- Item resizing and positioning
- Reset functionality
- Responsive design
- Advanced grid layout management with react-grid-layout
- React 18 - Modern React with hooks
- TypeScript - Type-safe development
- Tailwind CSS 4 - Utility-first CSS framework
- Radix UI - Accessible component primitives
- react-grid-layout - Flexible grid layout library
- Prism - Syntax highlighting for code output
Prerequisites:
- Node.js (version specified in
.nvmrc) - pnpm package manager
- Clone the repository:
git clone <repository-url>
cd my-css-grid-generator- Install dependencies:
pnpm install- Start the development server:
pnpm dev- Open your browser and navigate to
http://localhost:5173
pnpm dev- Start development serverpnpm build- Build for productionpnpm preview- Preview production buildpnpm lint- Run ESLintpnpm format- Format code with Prettier
- Configure Grid: Use the control panel to set the number of columns and rows, and adjust gap spacing
- Add Items: Click the "+" buttons in empty grid cells to add new items
- Customize Items: Edit item content and styling directly in the grid
- Drag & Drop: Move items around the grid using drag and drop
- Resize Items: Drag the edges of items to resize them
- Copy Code: Copy the generated CSS, HTML, or Tailwind CSS code from the output panel
- Reset: Use the reset button to clear the grid and start over
The application generates three types of output:
Clean, vanilla CSS with grid properties:
.grid-container {
display: grid;
grid-template-columns: repeat(4, 1fr);
grid-template-rows: repeat(4, 1fr);
gap: 8px 8px;
width: 100%;
}Utility-first CSS classes:
.grid-container {
@apply grid grid-cols-4 grid-rows-4 gap-2 w-full;
}Semantic HTML structure:
<div class="grid-container">
<div class="grid-item-1">Item 1</div>
<div class="grid-item-2">Item 2</div>
</div>Current Date and Time (UTC - YYYY-MM-DD HH:MM:SS formatted): 2025-12-25 15:40:20 Current User's Login: rushi