solid-router

Integrate Solid with TanStack Router for type-safe routing.

14.9k|1.8k|Updated Jan 14, 2019
One-click install
npx skills add https://github.com/TanStack/router --skill solid-router
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: solid-router
Source: https://github.com/TanStack/router/tree/main/packages/solid-router/skills/solid-router
Command: npx skills add https://github.com/TanStack/router --skill solid-router

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Provides Solid bindings for TanStack Router to enable strong, end-to-end type safety in routing, navigation, and data loading within Solid applications, reducing boilerplate and runtime errors.

Core Features & Use Cases

  • Solid bindings for common router features including RouterProvider, useRouter, useMatches, useParams, useLoaderData, useNavigate, and more, with full type inference and Solid primitives.
  • Integrates with Vite using the official tanstackRouter plugin, supports file-based routing, nested layouts, and data-driven navigation.
  • Use cases span client-side apps with SSR-ready patterns, route guards, and dynamic parameter matching.

Quick Start

Install @tanstack/solid-router and the Vite plugin, configure the router, then create a root route and mount RouterProvider to start routing.

Frequently Asked Questions about solid-router

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I get end-to-end type-safe routing in a Solid application?

End-to-end type-safe routing in a Solid application is achieved by using Solid bindings for TanStack Router, which provide full type inference for routes, navigation, and data loading. This integration reduces boilerplate and prevents runtime errors.

Can I use TanStack Router with Solid for file-based routing and nested layouts?

Yes, you can use TanStack Router with Solid for file-based routing and nested layouts. The integration supports a Vite-based development workflow using the official tanstackRouter plugin, enabling dynamic parameter matching and structured route management.

What is the best way to set up type-safe loaders and navigation in Solid?

The best way to set up type-safe loaders and navigation in Solid is by configuring the router via a Vite plugin and mounting the RouterProvider. This approach provides hooks like useLoaderData and useNavigate with full type inference and Solid primitives.

Does the Solid TanStack Router binding support client-side apps with SSR-ready patterns?

Yes, the Solid TanStack Router binding supports client-side apps with SSR-ready patterns. It enables typed route guards, data-driven navigation, and dynamic parameter matching across nested layouts within Solid applications.

Which Solid hooks are available for typed route matches and parameters?

Available Solid hooks for typed route matches and parameters include useRouter, useMatches, useParams, useLoaderData, and useNavigate. These hooks provide full type inference directly within your Solid application components.

Why should I use TanStack Router bindings instead of standard client-side routing in Solid?

You should use TanStack Router bindings to enable strong, end-to-end type safety across routing, navigation, and data loading, which standard client-side routing in Solid lacks. This significantly reduces boilerplate and prevents runtime errors.