===== Links ===== Client-side navigation and route helpers. .. seealso:: Official Inertia.js docs: `Links `_ .. tip:: **Plain URLs work everywhere!** You're not required to use the ``route()`` helper. See :doc:`routing` 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: .. tab-set:: .. tab-item:: React .. code-block:: tsx import { Link } from "@inertiajs/react"; Users Create User Logout .. tab-item:: Vue .. code-block:: vue Route Helper ------------ Generate URLs for named routes using the ``route()`` helper: .. code-block:: typescript // 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" .. code-block:: tsx // Use with Link View Profile 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 -------- - :doc:`routing` - Comparison with Laravel/Ziggy, plain URL support - :doc:`type-generation` - Typed routes - `Inertia.js Links `_ - Official docs - `Inertia.js Manual Visits `_ - Programmatic navigation