ChainwindCSS is a visual tool that helps you generate Tailwind CSS code through a node-based interface. Connect nodes, draw frames, and instantly get the corresponding Tailwind CSS code.
This example has been created using the tldraw SDK, offering features similar to computer.tldraw.com.
- Node-based visual interface
- Real-time Tailwind CSS code generation
- Support for text, frames, and image inputs
- Interactive design workflow
Before you begin, ensure you have:
- Node.js installed
- An OpenAI API key
- Create
.envfile in the root directory - Add your OpenAI API key:
OPENAI_API_KEY=your_api_key_here
- Create
- Clone the repository
- Install dependencies:
npm install
- Set up your environment variables (see Prerequisites)
- Run the development server:
npm run dev
- Connect text nodes to the Tailwind generate node using arrows
- Draw your desired layout using Frames and connect them to the Tailwind generate node
- Connect images to the Tailwind generate node for image-based generation
chainwindcss/
├── src/
│ ├── app/
│ │ ├── api/
│ │ │ └── generate/
│ │ │ └── tailwind/
│ │ ├── layout.tsx
│ │ └── page.tsx
│ ├── components/
│ │ ├── draw/
│ │ │ ├── code-preview.tsx
│ │ │ ├── drawing-canvas.tsx
│ │ │ ├── error-boundary.tsx
│ │ │ └── generate-box.tsx
│ │ ├── svg/
│ │ ├── tiptap/
│ │ │ └── Tiptap.tsx
│ │ └── tldraw/
│ │ ├── tailwindShape.tsx
│ │ └── textInputShape.tsx
│ └── tldraw-utils/
│ └── custom.ts
├── public/
│ ├── globe.svg
│ └── file.svg
├── .env
├── next.config.js
├── package.json
├── postcss.config.mjs
└── tsconfig.json
Contributions are welcome! Feel free to submit issues and pull requests.