# Lit UI Router > These are the 1.x docs, kept as they were at their last release. The latest docs are at https://lit-ui-router.dev/llms.txt. > State-based routing for Lit lit-ui-router is a client-side routing framework for Lit web components. It is an implementation of UI-Router built on the framework-agnostic `@uirouter/core`. Install it with its peers, `lit` and `@uirouter/core`: ```bash npm install lit-ui-router lit @uirouter/core ``` The Hello World starter is a Vite + TypeScript app. Copy it, then run `npm install` and `npm run dev` in `my-app`: ```bash npx tiged simshanith/lit-ui-router/examples/helloworld my-app ``` [`helloworld-buildless`](https://github.com/simshanith/lit-ui-router/tree/main/examples/helloworld-buildless) is the same app in plain JavaScript, served as static files: it runs with an import map and no bundler, fetching `lit`, `@uirouter/core` and `lit-ui-router` from a CDN, and `checkJs` still typechecks it against the published types. For a new SPA, the [Location Plugins](https://lit-ui-router.dev/v1/guides/location-plugins.md) guide recommends `navigationLocationPlugin` where the browser has the Navigation API and `pushStateLocationPlugin` where it doesn't; the tutorial uses hash URLs, which need no host configuration. ## Table of Contents ### Introduction - [What is Lit UI Router?](https://lit-ui-router.dev/v1/introduction.md): What is Lit UI Router? State-based routing for Lit web components ### Tutorial - [Hello World](https://lit-ui-router.dev/v1/tutorial/helloworld.md): Getting started with lit-ui-router - [Hello Solar System](https://lit-ui-router.dev/v1/tutorial/hellosolarsystem.md): Learn about resolves and state parameters - [Hello Galaxy](https://lit-ui-router.dev/v1/tutorial/hellogalaxy.md): Learn about nested states and views - [Examples](https://lit-ui-router.dev/v1/examples.md): Every lit-ui-router example app and live sample-app mount, with its language, location plugin, bindings, render mode, registry and lint facets, and links to run it, open it in StackBlitz and read its source - [Live examples](https://lit-ui-router.dev/v1/examples/live.md): The lit-ui-router example apps no tutorial or guide page embeds, each running live ### Guides - [Guides](https://lit-ui-router.dev/v1/guides.md): Task-oriented guides for lit-ui-router, grouped by topic - [Server-Side Overview](https://lit-ui-router.dev/v1/guides/server.md): Where to start with server-side routing - what the router decides for a request, whether the server renders the page, and which host serves it #### URLs & Location - [Location Plugins](https://lit-ui-router.dev/v1/guides/location-plugins.md): Choosing a URL strategy - hash, pushState, or the Navigation API - [Unmatched URLs (404)](https://lit-ui-router.dev/v1/guides/unmatched-urls.md): Route unmatched URLs to a 404 state with urlService.rules.otherwise #### Server-side - [Server-Side Routing](https://lit-ui-router.dev/v1/guides/server-route-matching.md): Serve routing verdicts at the edge with ui-router-server - the spectrum from zero server requirements to a shared router, every level live on this site - [Prerender with Vite](https://lit-ui-router.dev/v1/guides/prerender-with-vite.md): Emit one HTML page per route, a 404.html and a _redirects file from vite build, decided by the route table the app runs - [Prerender with Eleventy](https://lit-ui-router.dev/v1/guides/prerender-with-eleventy.md): Let Eleventy write the pages and the layout while lit-ui-router-ssr's prerender decides what each path is and renders it #### Transitions & Guards - [Route Guards](https://lit-ui-router.dev/v1/guides/route-guards.md): Protect states with transition hooks - the requiresAuth pattern - [Loading and Error Views](https://lit-ui-router.dev/v1/guides/loading-and-error-views.md): Show a pending indicator while a transition runs, render NOWAIT resolves behind a skeleton, and route failed transitions to an error view - [Component Lifecycle Hooks](https://lit-ui-router.dev/v1/guides/component-lifecycle.md): React to routing events from inside routed components with uiCanExit and uiOnParamsChanged - [Routed Components](https://lit-ui-router.dev/v1/guides/routed-components.md): Read a state's params in its routed component, type its resolves, code-split the component's element module with a resolve or a lazyLoad future state, and reach the element a view rendered #### Links & Markup - [Named Views](https://lit-ui-router.dev/v1/guides/named-views.md): Fill several viewports from one state with views, and target a view another state created with name@state, relative ^ anchors and absolute ! paths - [View Fallback Content](https://lit-ui-router.dev/v1/guides/view-fallback-content.md): What renders when no routed component is active — the capture rules, the master/detail idiom, and prerendered shells - [Design System Links](https://lit-ui-router.dev/v1/guides/design-system-links.md): Driving a design system's link component with uiSref, and why assignHref: true is the option for it #### Builds & Diagnostics - [Development and Production Builds](https://lit-ui-router.dev/v1/guides/development-builds.md): How lit-ui-router ships a separate development build, what warnings it carries, and why production bundles never contain them #### Reactivity - [Reactive Components](https://lit-ui-router.dev/v1/guides/reactive-components.md): Keep any component in sync with the router using TransitionController ### Packages - [Packages](https://lit-ui-router.dev/v1/packages.md): Every package in the lit-ui-router family, grouped by role — the renderer, Effect, MobX and Signals bindings, the Navigation API location plugin, server-side routing verdicts and static prerendering, typed state names and params, and directive-aware ESLint rules — with each package's facets, entry points, API reference and releases #### Renderer - [lit-ui-router](https://lit-ui-router.dev/v1/packages/lit-ui-router.md): The Lit renderer for UI-Router — the router class, the and elements, link directives and controllers, and their entry points #### Reactivity - [Effect](https://lit-ui-router.dev/v1/packages/effect.md): The Effect packages for UI-Router — ui-router-effect holds the router's state in a SubscriptionRef, and lit-ui-router-effect provides ref-following Lit controllers - [MobX](https://lit-ui-router.dev/v1/packages/mobx.md): The MobX packages for UI-Router — ui-router-mobx holds the router's state in an observable store, and lit-ui-router-mobx provides reaction-based Lit controllers - [Signals](https://lit-ui-router.dev/v1/packages/signals.md): The TC39 Signals packages for UI-Router — ui-router-signals mirrors the router's state into signals, and lit-ui-router-signals builds Lit controllers on that mirror ##### Effect - [ui-router-effect](https://lit-ui-router.dev/v1/packages/ui-router-effect.md): A framework-agnostic Effect SubscriptionRef of the router's current state with ui-router-effect - [lit-ui-router-effect](https://lit-ui-router.dev/v1/packages/lit-ui-router-effect.md): A SubscriptionRef of the route and ref-following Lit controllers with lit-ui-router-effect ##### MobX - [ui-router-mobx](https://lit-ui-router.dev/v1/packages/ui-router-mobx.md): A framework-agnostic MobX observable store of the router's current state with ui-router-mobx - [lit-ui-router-mobx](https://lit-ui-router.dev/v1/packages/lit-ui-router-mobx.md): Observable router state and reaction-based controllers with lit-ui-router-mobx ##### Signals - [ui-router-signals](https://lit-ui-router.dev/v1/packages/ui-router-signals.md): A framework-agnostic TC39 Signals mirror of the router's current state with ui-router-signals - [lit-ui-router-signals](https://lit-ui-router.dev/v1/packages/lit-ui-router-signals.md): Watcher-based Lit controllers over TC39 Signals of the route with lit-ui-router-signals #### Location - [Navigation API Plugin](https://lit-ui-router.dev/v1/packages/ui-router-navigation-location-plugin.md): Manage URLs with the modern browser Navigation API using ui-router-navigation-location-plugin #### Server - [Server](https://lit-ui-router.dev/v1/packages/ui-router-server.md): Honest HTTP verdicts for a static SPA with ui-router-server — the client's route table, running on the server or the edge - [Server-Side Rendering (SSR)](https://lit-ui-router.dev/v1/packages/lit-ui-router-ssr.md): A ui-router-server mount table in, an emitted static site out, with lit-ui-router-ssr #### DX - [Registry](https://lit-ui-router.dev/v1/packages/ui-router-registry.md): Typed state names and params for a @uirouter/core router with ui-router-registry, a types-only registry - [ESLint Plugin](https://lit-ui-router.dev/v1/packages/eslint-plugin-lit-ui-router.md): Directive-aware linting with eslint-plugin-lit-ui-router — rules covering hrefless anchors, inert hrefs, aria-current conflicts and misplaced directives ### Sample App - [Sample App](https://lit-ui-router.dev/v1/sample-app.md): The lit-ui-router sample app — a webmail + contacts client — and every live mount it runs behind on lit-ui-router.dev, one per point on the server-support spectrum ### API - [API](https://lit-ui-router.dev/v1/reference.md) #### Renderer - [lit-ui-router](https://lit-ui-router.dev/v1/reference/lit-ui-router.md) #### Reactivity - [ui-router-effect](https://lit-ui-router.dev/v1/reference/ui-router-effect.md) - [lit-ui-router-effect](https://lit-ui-router.dev/v1/reference/lit-ui-router-effect.md) - [ui-router-mobx](https://lit-ui-router.dev/v1/reference/ui-router-mobx.md) - [lit-ui-router-mobx](https://lit-ui-router.dev/v1/reference/lit-ui-router-mobx.md) - [ui-router-signals](https://lit-ui-router.dev/v1/reference/ui-router-signals.md) - [lit-ui-router-signals](https://lit-ui-router.dev/v1/reference/lit-ui-router-signals.md) #### Location - [ui-router-navigation-location-plugin](https://lit-ui-router.dev/v1/reference/ui-router-navigation-location-plugin.md) #### Server - [ui-router-server](https://lit-ui-router.dev/v1/reference/ui-router-server.md) - [lit-ui-router-ssr](https://lit-ui-router.dev/v1/reference/lit-ui-router-ssr.md) #### DX - [ui-router-registry](https://lit-ui-router.dev/v1/reference/ui-router-registry.md) ## Releases - [Releases](https://lit-ui-router.dev/releases/): The latest stable release of every package. Each package's page, at `https://lit-ui-router.dev/releases//`, lists every version it has released, with release notes and version diffs.