lit-ui-router
v1.2.5
Published
State-based routing for Lit
Readme
lit-ui-router
A UI-Router implementation for Lit.
Quick Start
import { UIRouterLit } from 'lit-ui-router';
import { hashLocationPlugin } from '@uirouter/core';
import { html } from 'lit';
const router = new UIRouterLit();
router.plugin(hashLocationPlugin);
router.stateRegistry.register([
{ name: 'home', url: '/', component: () => html`<h1>Home</h1>` },
{ name: 'about', url: '/about', component: () => html`<h1>About</h1>` },
]);
router.start();Component Styles
| Style | Best For | Example |
| ------------------- | ----------------------------- | -------------------------- |
| Template function | Simple views, prototyping | () => html`...` |
| Template with props | Views needing params/resolves | (props) => html`...` |
| LitElement class | Complex views with lifecycle | MyComponent |
Documentation
Visit lit-ui-router.dev for full documentation, tutorials, and API reference.
