Contacts demo rendered with Lit custom elements, using @webstd-ui/router for navigation. It demonstrates how the router's outlet can drive renderers beyond Remix.
- Custom elements – routes return
render()responses that mount Lit components - Controller pattern – field validation and state live in
src/controllers - Scoped styles – shared styles exported from
src/styles.ts - URL-synchronized search – filters contacts via query parameters
- Router:
@webstd-ui/router - Renderer:
lit - Build: Vite
- Language: TypeScript
Inside examples/lit/contacts:
mise run :install
mise run :devVite logs the local dev URL (defaults to http://localhost:1612). Run mise install at the repo root first if the toolchain has not been provisioned yet.
src/
├── app.ts # Router wiring + top-level custom element
├── controllers/ # Lit controllers for form + navigation state
├── custom-elements/ # Web components used across routes
├── directives/ # Lit directives for templating helpers
├── lib/ # In-memory data utilities
├── mixins/ # Shared mixins for components
├── routes/ # Route handlers and definitions
├── styles.ts # Shared CSS-in-JS
└── main.ts # Entry point bootstrapping the router
- Router Documentation
- React Router Tutorial (original inspiration)
- Lit Documentation