Skip to content
Back to skills

2748 Routing Patterns 959a3406

ASecurity

| File | Descrizione | |------|-------------| | `page.tsx` | Pagina pubblica accessibile tramite URL | | `layout.tsx` | Layout condiviso che wrappa i page | | `loading.tsx` | UI di caricamento durante fetch dati | | `error.tsx` | UI per gestione errori | | `not-found.tsx` | UI per 404 | | `template.tsx` | Layout re-mounted su navigazione | | `default.tsx` | Fallback per parallel routes | | `route.ts` | API Route Handler |

  • 11 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added May 31, 2026
datagoreactnodeapi

Works with

  • api

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned May 31, 2026

npx -y skills add tools-only/X-Skills --skill 2748-routing-patterns_959a3406 --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of 2748 Routing Patterns 959a3406?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for 2748 Routing Patterns 959a3406
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/tools-only-2748-routing-patterns-959a3406/badge)](https://www.skillsdirectory.com/skills/tools-only-2748-routing-patterns-959a3406)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
# Routing Patterns

## File Conventions

| File | Descrizione |
|------|-------------|
| `page.tsx` | Pagina pubblica accessibile tramite URL |
| `layout.tsx` | Layout condiviso che wrappa i page |
| `loading.tsx` | UI di caricamento durante fetch dati |
| `error.tsx` | UI per gestione errori |
| `not-found.tsx` | UI per 404 |
| `template.tsx` | Layout re-mounted su navigazione |
| `default.tsx` | Fallback per parallel routes |
| `route.ts` | API Route Handler |

## Parallel Routes (@slot)

Permettono di renderizzare più pagine nello stesso layout simultaneamente.

```tsx
// app/dashboard/layout.tsx
export default function DashboardLayout({
  children,
  team,
  analytics,
}: {
  children: React.ReactNode;
  team: React.ReactNode;
  analytics: React.ReactNode;
}) {
  return (
    <div>
      {children}
      <div className="grid grid-cols-2">
        {team}
        {analytics}
      </div>
    </div>
  );
}
```

```tsx
// app/dashboard/@team/page.tsx
export default function TeamPage() {
  return <div>Team Section</div>;
}
```

```tsx
// app/dashboard/@analytics/page.tsx
export default function AnalyticsPage() {
  return <div>Analytics Section</div>;
}
```

## Intercepting Routes

Permettono di intercettare route e mostrarle in modalità diversa (es: modal).

| Pattern | Intercetta |
|---------|-----------|
| `(.)` | Stesso livello |
| `(..)` | Un livello sopra |
| `(..)(..)` | Due livelli sopra |
| `(...)` | Root |

```
app/
├── feed/
│   └── page.tsx
└── feed/
    └── @modal/
        └── (.)photo/
            └── [id]/
                └── page.tsx  <- Intercetta /feed/photo/[id]
```

## Route Groups

Organizzano route senza influenzare l'URL (usando parentesi).

```
app/
├── (marketing)/
│   ├── about/
│   │   └── page.tsx      -> /about
│   └── contact/
│       └── page.tsx      -> /contact
├── (shop)/
│   ├── products/
│   │   └── page.tsx      -> /products
│   └── cart/
│       └── page.tsx      -> /cart
└── layout.tsx
```

## Dynamic Routes

```tsx
// app/blog/[slug]/page.tsx
interface PageProps {
  params: Promise<{ slug: string }>;
}

export default async function BlogPost({ params }: PageProps) {
  const { slug } = await params;
  // Use slug...
}

// Catch-all
// app/docs/[...slug]/page.tsx

// Optional catch-all
// app/docs/[[...slug]]/page.tsx
```

## Generate Static Params

```tsx
// app/blog/[slug]/page.tsx
export async function generateStaticParams() {
  const posts = await fetchPosts();

  return posts.map((post) => ({
    slug: post.slug,
  }));
}

// Con multiple dynamic segments
export async function generateStaticParams() {
  const products = await fetchProducts();

  return products.map((product) => ({
    category: product.category,
    id: product.id,
  }));
}
```

Files in this skill

  • README.md1 KB
  • skill.md2.8 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in data →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.