The Grid Layout Generator is a web-based tool created with React and Vite, designed to simplify the creation of CSS grid layouts. It allows users to visually design grids, manage grid areas, and provides options to copy or download the generated HTML and CSS code.
-
Resizable Grid Layout: Adjust the number of rows and columns dynamically, and set their sizes using any CSS unit (px, %, fr, etc.).
-
Area Management:
- Add new areas by clicking on any cell.
- Resize, move, or delete areas using the handles or through area options.
- Rename areas for better identification.
-
Alignment Options: Customize the alignment of individual areas using
align-self
andjustify-self
properties. -
Code Generation:
- Copy the code to your clipboard.
- Download the code as a file for future use.
Follow these steps to set up the project locally:
-
Clone the repository
git clone https://github.com/NethminaGunasekara/grid-layout-generator.git
-
Navigate to the project directory
cd grid-layout-generator
-
Install dependencies
npm install
-
Run the development server
npm run dev
-
Open the app in your browser at
http://localhost:5173
.
This project includes the following npm scripts:
dev
: Starts the development server using Vite.build
: Builds the project using TypeScript and Vite for production.lint
: Runs ESLint to analyze the code for issues.preview
: Serves the production build locally using Vite.test
: Runs unit tests using Vitest.
-
Start the development server to work on the project:
npm run dev
-
Run tests to ensure code quality and reliability:
npm run test
-
Lint your code for any issues:
npm run lint
-
Build the app for production:
npm run build
-
Preview the production build locally:
npm run preview
This project was built with the help of:
-
React Toastify for toast messages.
-
SVG Repo for icons.
-
Netlify for hosting.
-
Husky and lint-staged for pre-commit checks.
-
React Code Blocks for previewing the HTML/CSS code for the grid.
-
@fontsource for web fonts.
- Add support for
grid-template-areas
. - Add support for Tailwind CSS
Contributions are welcome! If you have ideas, suggestions, or find a bug, please open an issue or submit a pull request.