---
id: patricio0312rev/skills/page-layout-builder
version: "cc03ac1e"
license: MIT
install: manual
updated: 2026-01-12
---
# page-layout-builder — Page Layout Builder creates complete, responsive page structures for common application patterns including dashboards, authentication flows, settings panels, and CRUD interfaces. Each layout includes routing setup, navigation components, and state management scaffolding ready for your business logic.
Publisher: patricio0312rev · Stars: 52 · Updated: 2026-01-12
Install (manual): `git clone https://github.com/patricio0312rev/skills`
## SKILL.md
# Page Layout Builder
Generate production-ready page layouts with routing, navigation, and state patterns.
## Core Workflow
1. **Choose page type**: Dashboard, auth, settings, CRUD, landing, etc.
2. **Setup routing**: Create route files with proper structure
3. **Build layout**: Header, sidebar, main content, footer
4. **Add navigation**: Nav menus, breadcrumbs, tabs
5. **State placeholders**: Data fetching, forms, modals
6. **Responsive design**: Mobile-first with breakpoints
7. **Loading states**: Skeletons and suspense boundaries
## Common Page Patterns
### Dashboard Layout
```typescript
// app/dashboard/layout.tsx
import { Sidebar } from "@/components/Sidebar";
import { Header } from "@/components/Header";
export default function DashboardLayout({
children,
}: {
children: React.ReactNode;
}) {
return (
{/* Sidebar - Hidden on mobile, shown on desktop */}
{/* Main Content Area */}
{/* Header */}
{/* Page Content */}
{children}
);
}
```
```typescript
// app/dashboard/page.tsx
import { StatsCard } from "@/components/dashboard/StatsCard";
import { RecentActivity } from "@/components/dashboard/RecentActivity";
import { Chart } from "@/components/dashboard/Chart";
export default function DashboardPage() {
return (
Dashboard
Welcome back! Here's your overview.
{/* Stats Grid */}
{/* Charts and Activity */}
);
}
```
### Authentication Pages
```typescript
// app/(auth)/layout.tsx
export default function AuthLayout({
children,
}: {
children: React.ReactNode;
}) {
return (
{/* Left side - Branding (hidden on mobile) */}
Welcome to AppName
The best platform for managing your workflow
{/* Right side - Auth form */}
);
}
```
```typescript
// app/(auth)/login/page.tsx
"use client";
import { useState } from "react";
import { useRouter } from "next/navigation";
import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
import Link from "next/link";
export default function LoginPage() {
const router = useRouter();
const [isLoading, setIsLoading] = useState(false);
const handleSubmit = async (e: React.FormEvent) => {
e.preventDefault();
setIsLoading(true);
// TODO: Implement authentication logic
try {
// await signIn(formData);
router.push("/dashboard");
} catch (error) {
console.error("Login failed:", error);
} finally {
setIsLoading(false);
}
};
return (
Sign In
Enter your credentials to access your account
Don't have an account?{" "}
Sign up
);
}
```
### Settings/Profile Page
```typescript
// app/settings/layout.tsx
import { SettingsSidebar } from "@/components/settings/SettingsSidebar";
export default function SettingsLayout({
children,
}: {
children: React.ReactNode;
}) {
return (
Settings
Manage your account settings and preferences
);
}
```
```typescript
// app/settings/profile/page.tsx
"use client";
import { useState } from "react";
import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
import { Card } from "@/components/ui/card";
export default function ProfileSettingsPage() {
const [isSaving, setIsSaving] = useState(false);
const handleSubmit = async (e: React.FormEvent) => {
e.preventDefault();
setIsSaving(true);
// TODO: Save profile changes
setIsSaving(false);
};
return (
);
}
```
### CRUD Page (List/Create/Edit/Delete)
```typescript
// app/users/page.tsx
"use client";
import { useState } from "react";
import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
import { Table } from "@/components/ui/table";
import { CreateUserModal } from "@/components/users/CreateUserModal";
import { DeleteConfirmDialog } from "@/components/ui/DeleteConfirmDialog";
export default function UsersPage() {
const [isCreateModalOpen, setIsCreateModalOpen] = useState(false);
const [searchQuery, setSearchQuery] = useState("");
return (
{/* Header */}
Users
Manage your team members
{/* Filters */}
setSearchQuery(e.target.value)}
className="max-w-sm"
/>
{/* Table */}
{/* TODO: Implement table with data */}
{/* Modals */}
setIsCreateModalOpen(false)}
/>
);
}
```
## Navigation Components
### Sidebar Navigation
```typescript
// components/Sidebar.tsx
"use client";
import Link from "next/link";
import { usePathname } from "next/navigation";
import { cn } from "@/lib/utils";
import {
HomeIcon,
UsersIcon,
SettingsIcon,
ChartBarIcon,
} from "@/components/icons";
const navigation = [
{ name: "Dashboard", href: "/dashboard", icon: HomeIcon },
{ name: "Users", href: "/users", icon: UsersIcon },
{ name: "Analytics", href: "/analytics", icon: ChartBarIcon },
{ name: "Settings", href: "/settings", icon: SettingsIcon },
];
export function Sidebar({ className }: { className?: string }) {
const pathname = usePathname();
return (
);
}
```
### Header with User Menu
```typescript
// components/Header.tsx
"use client";
import { Button } from "@/components/ui/button";
import { Avatar } from "@/components/ui/avatar";
import { DropdownMenu } from "@/components/ui/dropdown-menu";
import { BellIcon, MenuIcon } from "@/components/icons";
export function Header() {
return (
{/* Mobile menu button */}
{/* Search (optional) */}
{/* Search component */}
{/* Right side actions */}
);
}
```
## Routing Structure
### Next.js App Router
```
app/
├── (auth)/ # Auth group (no dashboard layout)
│ ├── layout.tsx
│ ├── login/
│ │ └── page.tsx
│ ├── register/
│ │ └── page.tsx
│ └── forgot-password/
│ └── page.tsx
├── dashboard/ # Dashboard section
│ ├── layout.tsx
│ └── page.tsx
├── users/ # CRUD section
│ ├── page.tsx # List
│ ├── [id]/
│ │ ├── page.tsx # Detail/Edit
│ │ └── loading.tsx
│ └── new/
│ └── page.tsx # Create
├── settings/ # Settings section
│ ├── layout.tsx
│ ├── profile/
│ │ └── page.tsx
│ ├── security/
│ │ └── page.tsx
│ └── notifications/
│ └── page.tsx
└── layout.tsx # Root layout
```
## State Management Patterns
### Data Fetching Pattern
```typescript
// app/users/page.tsx
import { Suspense } from "react";
import { UsersTable } from "@/components/users/UsersTable";
import { UsersTableSkeleton } from "@/components/users/UsersTableSkeleton";
async function getUsers() {
// Server-side data fetching
const res = await fetch("https://api.example.com/users", {
cache: "no-store",
});
return res.json();
}
export default async function UsersPage() {
const users = await getUsers();
return (
Users
}>
);
}
```
### Client-Side State
```typescript
"use client";
import { useState, useEffect } from "react";
import { useUsers } from "@/hooks/useUsers";
export default function UsersPage() {
const { users, isLoading, error } = useUsers();
const [selectedUser, setSelectedUser] = useState(null);
if (isLoading) return ;
if (error) return ;
return {/* Page content */}
;
}
```
## Loading States
### Skeleton Screens
```typescript
// components/dashboard/DashboardSkeleton.tsx
export function DashboardSkeleton() {
return (
{Array.from({ length: 4 }).map((_, i) => (
))}
);
}
```
### Loading Component
```typescript
// app/dashboard/loading.tsx
import { DashboardSkeleton } from "@/components/dashboard/DashboardSkeleton";
export default function Loading() {
return ;
}
```
## Responsive Patterns
### Mobile Navigation
```typescript
"use client";
import { useState } from "react";
import { Sheet } from "@/components/ui/sheet";
export function MobileNav() {
const [isOpen, setIsOpen] = useState(false);
return (
<>
setIsOpen(false)}>
>
);
}
```
## Best Practices
1. **Consistent layouts**: Use layout files for shared structure
2. **Route groups**: Organize related pages with (groupName)
3. **Loading states**: Add loading.tsx for automatic suspense
4. **Error boundaries**: Add error.tsx for error handling
5. **Mobile-first**: Design for mobile, enhance for desktop
6. **Accessibility**: Semantic HTML, ARIA labels, keyboard nav
7. **SEO**: Use metadata, proper heading hierarchy
8. **Performance**: Code splitting, lazy loading, optimized images
## Output Checklist
Every page layout should include:
- [ ] Proper route structure with layout files
- [ ] Responsive navigation (sidebar + mobile menu)
- [ ] Header with actions
- [ ] Main content area with proper spacing
- [ ] Loading states (skeletons)
- [ ] Empty states
- [ ] Error boundaries
- [ ] State management placeholders
- [ ] Breadcrumbs or page headers
- [ ] Mobile-responsive breakpoints
[View on SkillFed](https://skillfed.io/patricio0312rev/skills/page-layout-builder) · [View on GitHub](https://github.com/patricio0312rev/skills)