Skip to content
nav-router

Plugins

The core does one job. Each plugin wraps one moment in the router and calls through, so you ship only the ones you install. Select the ones you want and copy the setup.

app.js
import { Router } from 'nav-router';

// select plugins below to add them here
Selected
0 of 9
Plugin Size
0.0 kB min+br
Total Size
11.3 kB min+br
  • head

    Title, meta tags and canonical link for each page, merged down the active routes.

    1.1 kB min+br
  • view-transitions

    Crosses each page change inside a view transition, so what leaves animates out and what appears animates in.

    0.2 kB min+br
  • announcer

    Announces each new page through a live region, where Safari stays silent on intercepted navigations.

    0.8 kB min+br
  • confirm-leave

    Holds unsaved forms and edits across link clicks, back and forward, and closing the tab.

    1.5 kB min+br
  • preload-intent

    Warms a link’s view code on hover, focus or touch, and adds router.preload() for warming one by hand.

    0.4 kB min+br
  • chunk-reload

    Recovers once when a fresh deploy has removed the old code chunk a page needs.

    0.5 kB min+br
  • timeline

    Draws each navigation and its steps in the devtools performance panel.

    0.9 kB min+br
  • sitemap

    Lists every route as a page a crawler or a generator can read, and adds router.sitemap().

    0.2 kB min+br
  • dom

    Renders views as markup or elements into the page’s <slot>s, with no framework.

    1.1 kB min+br

Need something else?

A plugin is a function of the options, Router and Navigator that wraps one moment and calls through. Writing a plugin covers the moments you can wrap.