litestar-vite litestar-vite litestar-vite
    • Get Started Install litestar-vite, wire the runtime, and choose the right workflow path.
    • Framework Guides React, Vue, Svelte, Angular, HTMX, Inertia, and SSR framework guides.
    • API Reference Configuration, CLI, plugin, loader, and codegen reference.
    • Contribution Guide How to contribute to litestar-vite.
    • Changelog Track notable changes and migration points.
    • GitHub Repository, issues, discussions, and release history.
/

Documentation

  • Getting Started
    • Install and Configure
    • Development Workflow
    • Production and Deploy
    • Static Props
    • Operation Modes
    • Type Generation
  • Framework Guides
    • React
    • Vue
    • Svelte
    • Angular
    • HTMX
    • Nuxt
    • SvelteKit
    • Astro
    • Inertia.js
      • Installation
      • Configuration
      • How It Works
      • Pages
      • Responses
      • Redirects
      • Routing & Navigation
      • Links
      • Forms
      • File Uploads
      • Validation
      • Shared Data
      • Flash Data
      • Partial Reloads
      • Deferred Props
      • Once Props
      • Merging Props
      • Load When Visible
      • Polling
      • Prefetching
      • Infinite Scroll
      • Remembering State
      • CSRF Protection
      • History Encryption
      • Precognition
      • Templates
      • Error Handling
      • Asset Versioning
      • TypeScript Integration
      • Type Generation
      • Typed Page Props
      • Shared Props Typing
      • Fullstack Example
  • API Reference
    • CLI
    • Commands
    • Config
    • CDN Deployment
    • Exceptions
    • HTML Transformation
    • InertiaJS Integration
      • Inertia Configuration
      • Inertia Exception Handler
      • Inertia Helpers
      • Inertia Middleware
      • Plugin
      • Inertia Request
      • Inertia Response
      • Inertia SSR (JS)
      • Inertia Types
    • Loader
    • Plugin
    • SPA Handler
    • Code Generation

Developers

  • Contribution guide
  • Changelog
  1. litestar-vite /
  2. Framework Guides /
  3. Inertia.js /
  4. Links

Links¶

Client-side navigation and route helpers.

See also

Official Inertia.js docs: Links

Tip

Plain URLs work everywhere! You’re not required to use the route() helper. See Routing & Navigation for details on how litestar-vite compares to Laravel/Ziggy.

Inertia Link Component¶

Use the Inertia Link component for SPA navigation. Both plain URLs and the route() helper work:

import { Link } from "@inertiajs/react";

<Link href="/users">Users</Link>
<Link href="/users" method="post">Create User</Link>
<Link href="/logout" method="post" as="button">Logout</Link>
<script setup>
import { Link } from "@inertiajs/vue3";
</script>

<template>
  <Link href="/users">Users</Link>
  <Link href="/users" method="post">Create User</Link>
  <Link href="/logout" method="post" as="button">Logout</Link>
</template>

Route Helper¶

Generate URLs for named routes using the route() helper:

// Import from your generated routes file (output is driven by TypeGenConfig.output)
import { route } from "./generated/routes";

// Simple route
const homeUrl = route("home");  // "/"

// Route with parameters
const userUrl = route("user-profile", { userId: 123 });  // "/users/123"
// Use with Link
<Link href={route("user-profile", { userId: 123 })}>View Profile</Link>

Setup¶

Routes are generated at build/dev time into TypeGenConfig.output. Import the generated module in application code where you need route helpers.

See Also¶

  • Routing & Navigation - Comparison with Laravel/Ziggy, plain URL support

  • Type Generation - Typed routes

  • Inertia.js Links - Official docs

  • Inertia.js Manual Visits - Programmatic navigation

Previous
Routing & Navigation
Next
Forms

2025, Litestar-Org

Made with Sphinx and Shibuya theme.