This project provides a user-friendly interface to preview various Tailwind CSS layout components and easily copy their corresponding HTML code. It leverages Next.js for the frontend, Shadcn/ui for UI components, and features a dynamic 3D background using Three.js.
The primary goal is to accelerate frontend development by offering a categorized library of ready-to-use layout patterns.
git clone <repository-url>
cd tailwind-layout-preview
npm install
# or
yarn install
npm run dev
# or
yarn dev
src/app/
: Contains the main application pages and layout (using Next.js App Router).page.tsx
: The main page displaying the sidebar and preview area.layout.tsx
: The root layout for the application.globals.css
: Global styles and Tailwind CSS theme configuration (HSL variables).api/layout/[name]/route.ts
: API route to fetch layout content dynamically.src/components/
: Reusable React components.ui/
: Components generated by Shadcn/ui.layout-preview.tsx
: Component responsible for displaying the iframe preview and handling layout selection.header.tsx
: The main application header.three-background.tsx
: The 3D animated background component.dark-mode-toggle.tsx
: Theme switching component.src/layouts/
: Stores the raw HTML files for each layout component. Files are named descriptively (e.g., Hero Section Simple Centered.html
).src/lib/
: Utility functions.layouts.ts
: Server-side functions for reading layout files.utils.ts
: General utility functions (like cn
for class names).src/hooks/
: Custom React hooks.use-toast.ts
: Hook for displaying toast notifications.public/
: Static assets (if any).tailwind.config.ts
: Tailwind CSS configuration.next.config.ts
: Next.js configuration.