Official website: router5.github.io
router5
router5 is a framework and view library agnostic router.
- view / state separation: router5 processes routing instructions and outputs state updates.
- universal: works client-side and server-side
- simple: define your routes, start to listen to route changes
- flexible: you have control over transitions and what happens on transitions
const routes = name: 'home' path: '/' name: 'profile' path: '/profile' const router = routerstart
With React (new context API)
{ if !route return null if routename === 'home' return <h1>Home</h1> if routename === 'profile' return <h1>Profile</h1> } ReactDOM
With observables
Your router instance is compatible with most observable libraries.
Guides
- Configuring routes
- Router options
- Path syntax
- Navigation
- Preventing navigation
- Custom errors and redirections
- Middleware functions
- Transition
- Using plugins
- Universal applications
- Async data