Skip to content

UI-Router

A routing library for AngularJS apps that maps URLs to nested app states and views.

Stars
13.4k
Forks
2.9k
Licence
MIT
Language
TypeScript
Last update
10 months ago
Type
Library

What it is

UI-Router is a client-side routing framework for AngularJS, the older 1.x version of Angular. It keeps the browser URL in sync with what the app is showing, so a user can bookmark a deep page inside a single-page app. Apps are organized as a tree of named states, and the library manages moving between them as a state machine.

  • Map URLs such as product pages to nested app states with their own views
  • Let a browser back or forward action move through application states
  • Create bookmarkable links to specific screens deep inside a single-page app

Great for

  • Teams maintaining an existing AngularJS 1.x application
  • Developers who need nested views that follow URL structure
  • Apps where deep-linkable, bookmarkable pages matter

Not ideal for

  • New projects: the README points newer work to separate UI-Router versions for Angular 2 and React, so this 1.x package targets AngularJS specifically
  • Projects still on UI-Router 0.x, which the README says lives on a separate legacy branch
  • Non-developers, since it is a code library with no standalone interface
Step-by-step guide: how to use UI-RouterInstall, first run, examples, tips and FAQs

How to get it

  1. 1

    Install with a package manager

    You'll need: AngularJS 1.x application

    Clone the repository

    git clone https://github.com/angular-ui/ui-router
  2. 2

    Run it

    • Read the Get Started tutorial for UI-Router for Angular 1 linked in the README
    • Include the library in your AngularJS page or build, as described in the guide
    • Define your first state with a URL and a view
    • Navigate to that URL in the browser to confirm the view loads
  3. 3

    Get the most out of it

    • Use the in-depth guide on the project wiki for advanced state configuration
    • Consult the API docs for the full list of state and transition options
    • Check the FAQ on the wiki when you hit common questions
    • Look at the linked sample app to see a working example of nested states

Downloads

Strengths

  • Built around a hierarchical state tree that maps cleanly to nested views
  • URL and app state stay in sync, which supports bookmarks and shareable links
  • Includes tutorials, API docs, and a sample app linked from the README

Trade-offs

  • Targets AngularJS 1.x, an older framework; the README does not describe a migration path within this package
  • The README is truncated and gives little detail on installation or configuration here
  • Learning the state-machine model takes time for developers new to it

How it compares

ProjectStarsTypeLevelUpdatedBest for
ui-router (this)13.4kLibraryintermediate10 months agoTeams maintaining an existing AngularJS 1.x application
router15.3kLibraryintermediate4 days agoReact developers who want type-checked routes and URL parameters
xstate30.4kLibraryintermediate4 days agoFrontend developers managing complex UI flows with many interacting states
immer29kLibrarybeginner6 days agoJavaScript developers who find hand-written immutable updates verbose or error-prone
vue-router18.9kLibraryintermediate7 months agoMaintainers of existing Vue 2 apps that already use vue-router 3
barba13kLibraryintermediate1.9 years agoDevelopers adding animated transitions to an existing multi-page website

Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.