Skip to content

Lit UI RouterState-based routing for Lit

A UI-Router implementation for Lit web components

Lit UI Router

Start minimal with simple, plain Lit templates and scale cleanly to non-trivial apps without switching routers. Built on @uirouter/core, the same engine behind UI-Router for Angular and React.

See it run

The feature cards above run here as a small lit-ui-router app. Each card re-enters one state with a new parameter, and the diagram follows each transition.

The app shares this page's URL fragment with the page's own anchors, so a link can open a card directly, as the links on the cards above do. For example, #see-it-run/views opens Views.

The app

Its state and view

statesviewsresolves

entered cardcardId: 'states'

The app registers one state, card, under the router's root state, at the URL /:cardId. It renders into the <ui-view> in <app-root>. Each card is a value of its cardId parameter: states, views, resolves.

The active value is states.

Start the tutorialRead the introduction