npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@isorouter/vue

v1.2.1

Published

Vue 3 adapter for @isorouter/core.

Readme

@isorouter/vue

npm version minzip License: MIT

Vue 3 bindings for @isorouter/core — a lightweight SPA router built on the browser Navigation API.

<RouterView>, <Outlet>, <Link> and a handful of composables wrap the core router's immutable-snapshot external store with shallowRef, so navigation updates stay correct and reactive.

Install

npm install @isorouter/vue

@isorouter/core is a regular dependency and is installed automatically.

Requirements

  • Vue ≥ 3.4.
  • Everything in @isorouter/core's Requirements — notably the Navigation API. Load a polyfill if you need to support older engines, before <RouterView> mounts (it calls router.start() for you).

Quick start

import { createApp, defineComponent, h } from "vue";
import { createRouter, RouterView, Outlet } from "@isorouter/vue";

const router = createRouter([
  { path: "/", component: Home },
  { path: "about", component: About },
  {
    path: "dashboard",
    component: DashboardLayout,
    children: [
      { index: true, component: Overview },
      { path: "settings", component: Settings },
    ],
  },
] as const);

const DashboardLayout = defineComponent({
  render: () => h("div", [h("h1", "Dashboard"), h(Outlet)]),
});

const App = defineComponent({
  render: () =>
    h(RouterView, { router }, { notFound: () => h("p", "Not found") }),
});

createApp(App).mount("#app");

createRouter is createCoreRouter with the component type fixed to Vue's Component. <RouterView> calls router.start() on mount and router.stop() on unmount.

Components

<RouterView>

Root component. Mount once near the app root and pass the router instance via the router prop, with optional named slots:

h(
  RouterView,
  { router },
  {
    loading: () => h(Spinner),
    notFound: () => h(NotFound),
    error: ({ error }) => h(ErrorPage, { error }),
  },
);
  • router — a Router instance from createRouter.
  • notFound — rendered when snapshot.status === "not-found".
  • error — called with { error: snapshot.error } when snapshot.status === "error".
  • loading — rendered whenever there's no matched root component yet (e.g. before the first commit) and neither error nor notFound applies.

Otherwise renders the root matched component, snapshot.components[0].

<Outlet>

Renders the next component in the matched chain at the current nesting depth. Used inside a layout component to render its matched child route; renders nothing when there is no matching child.

<Link>

h(
  Link,
  { href: "/dashboard", activeClass: "active", exact: true },
  () => "Dashboard",
);

A plain <a> — the Navigation API intercepts the click, so modifier-clicks, target="_blank" and downloads behave natively.

  • href — the target path.
  • activeClass — applied as the element's class when router.isActive(href, { exact }) (default "active").
  • exact — passed through to isActive; when set, only an exact match is considered active.

When active, also sets aria-current="page". Slot content (the default slot) is rendered as the link's children.

Must be used within <RouterView>.

Composables

All composables must be used within <RouterView> (they inject the router instance provided there).

  • useRouter() — the Router instance.
  • useRouterState() — a ShallowRef<RouterSnapshot> holding the current snapshot; a fresh reference is assigned on every commit. The subscription is torn down automatically via onScopeDispose.
  • useParams() — a ComputedRef<Record<string, string>> of the current route params.
  • useLocation() — a ComputedRef<URL> of the current location.
  • useNavigate()(to, opts?: { replace?: boolean; state?: unknown }) => void delegating to router.navigate.

Type-safe navigation

Declare routes as const and router.navigate / useNavigate() only accept known paths — see @isorouter/core's Type-safe navigation.

License

MIT © Mykhailo Pidkhvatylin