Skip to content

Free MIT template · Day 6 of 365

You're looking at a demo. Download the built static files (drop on any host) or grab the full source to customize.

↓ Download static ↓ Source (Astro) All 365 →Hire me →
v1.0.0 · MIT licensed

# routekit

Type-safe client-side routing for TypeScript.
Zero dependencies. ~3 KB minified. Fits in your head.

$`npm install routekit`
TS

### Type-safe by default

Route definitions are inferred from a single source. Misspelled paths are compile errors, not 404s.

↯

### 3 KB minified

One file. No virtual DOM coupling. Tree-shakable. Loads instantly even on slow networks.

⌥

### Framework agnostic

Works with React, Preact, Solid, vanilla. Bring your own renderer; routekit handles the routing.

✶

### Zero dependencies

Audit one package, not seventeen. No transitive surface area, no surprise breaking-change days.

## Why routekit

If you’ve reached for `react-router`, `vue-router`, or `@tanstack/router` and felt like you were getting a cathedral when you wanted a hut, routekit is for you. It does one thing — match URLs to handlers in a type-safe way — and gets out of your way.

Getting Started Install in under a minute.
API Reference Every export, every option.
Examples Working SPAs you can copy.
Changelog What changed and when.

## Five-line example

    import { createRouter } from 'routekit';
    const router = createRouter([  { path: '/',           handler: () => import('./pages/home') },  { path: '/posts/:id',  handler: () => import('./pages/post') },]);
    router.start();

That’s the whole API surface for 80% of apps. No providers to mount, no context to thread, no compile-time codegen step.

## What routekit is not

It is not a framework. It is not a data-loading library. It is not a server. It does not ship with a CSS reset, a state manager, or an opinion about your folder structure. It is ~3 KB of TypeScript that turns `window.location` into typed events.

If your app needs more than that — server rendering, file-system routing, layout nesting — reach for a framework. routekit shines when the rest of the app is already opinionated and the routing layer needs to stay quiet.