All Projects → ergo → polymer-ui-router

ergo / polymer-ui-router

Licence: Apache-2.0 license
UI-router wrapper for Web Components

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to polymer-ui-router

Webdash
🔥 Orchestrate your web project with Webdash the customizable web dashboard
Stars: ✭ 1,528 (+6266.67%)
Mutual labels:  polymer, webcomponents
Vaadin Date Picker
The Web Component providing a date selection field with scrollable month calendar. Part of the Vaadin components.
Stars: ✭ 158 (+558.33%)
Mutual labels:  polymer, webcomponents
The Grid
Grid layout custom element with drag and drop capabilities
Stars: ✭ 122 (+408.33%)
Mutual labels:  polymer, webcomponents
Frontend
🍭 Frontend for Home Assistant
Stars: ✭ 1,366 (+5591.67%)
Mutual labels:  polymer, webcomponents
polytimer
polytimer.rocks
Stars: ✭ 24 (+0%)
Mutual labels:  polymer, webcomponents
Wc Loader
🚽 Webcomponents webpack loader.
Stars: ✭ 101 (+320.83%)
Mutual labels:  polymer, webcomponents
Origami
Angular + Polymer
Stars: ✭ 158 (+558.33%)
Mutual labels:  polymer, webcomponents
Login Fire
An element that allows simple configuration of multiple provider login for firebase
Stars: ✭ 58 (+141.67%)
Mutual labels:  polymer, webcomponents
identicon-avatar
👾 GitHub style identicon avatar
Stars: ✭ 15 (-37.5%)
Mutual labels:  polymer, webcomponents
iron-swipeable-pages
[Polymer 1.x] Element that enables switching between different pages by swiping gesture.
Stars: ✭ 51 (+112.5%)
Mutual labels:  polymer, webcomponents
Highcharts Chart
Polymer Element wrapper for highcharts library. Seamlessly create various types of charts from one element.
Stars: ✭ 97 (+304.17%)
Mutual labels:  polymer, webcomponents
mapbox-gl
Polymer 2.0 custom element for mapbox-gl-js. Uses WebGL to render interactive maps from vector tiles and Mapbox styles - compatible with deck-gl.
Stars: ✭ 24 (+0%)
Mutual labels:  polymer, webcomponents
Vaadin Upload
The Web Component for uploading multiple files with progress indication. Part of the Vaadin components.
Stars: ✭ 87 (+262.5%)
Mutual labels:  polymer, webcomponents
Vaadin Combo Box
The Web Component for displaying a list of items with filtering. Part of the Vaadin components.
Stars: ✭ 113 (+370.83%)
Mutual labels:  polymer, webcomponents
Redux Store Element
A custom element allowing a more declarative use of Redux.
Stars: ✭ 83 (+245.83%)
Mutual labels:  polymer, webcomponents
App Datepicker
Datepicker element built with Google's lit-element and Material Design 2
Stars: ✭ 142 (+491.67%)
Mutual labels:  polymer, webcomponents
Vaadin Form Layout
The Web Component providing configurable responsive layout for form elements. Part of the Vaadin components.
Stars: ✭ 15 (-37.5%)
Mutual labels:  polymer, webcomponents
Gwt Api Generator
Generator for creating GWT JSInterop clients from Polymer Web Components
Stars: ✭ 49 (+104.17%)
Mutual labels:  polymer, webcomponents
Lrnwebcomponents
@lrnwebcomponents Monorepo for NPM based element definitions
Stars: ✭ 166 (+591.67%)
Mutual labels:  polymer, webcomponents
paper-chip
A chip web component made with Polymer 2 following Material Design guidelines
Stars: ✭ 30 (+25%)
Mutual labels:  polymer, webcomponents

<polymer-ui-router>

UI Router Web Component wrapper (using minimal bits from Polymer 3.x base element)

Use https://ui-router.github.io/core/docs/latest/ and https://ui-router.github.io/ For general UI-Router documentation.

Demo page: https://www.webcomponents.org/element/ergo/polymer-ui-router

UI-Router is one of most popular routing solutions, with ports for angular 1.x, 2.x+ and react - now also available for Web Components.

UI-Router provides state based routing. Each feature of an application is defined as a state. One state is active at any time, and UI-Router manages the transitions between the states.

Each state describes the URL, the UI (a view or views), data prerequisites, and other logical prerequisites (such as authentication) for a feature. Before activating a state, UI-Router first fetches any prerequisites (asynchronously), and then activates the view(s) and updates the URL.

UI-Router states are hierarchical; states can be nested inside other states, forming a tree. Child states may inherit data and behavior (such as authentication) from their parent states.

Some features of UI Router:

  • Hierarchical states both abstract and components based
  • States can be resolve (including async) and activate based on set prerequisites
  • Multiple views per state
  • Views can be nested inside other views
  • Transition and lifecycle API's

Example usage

let routerStates = [
   {name: "index_route", url: "/index", component: "index-comp"},
   {name: "foo", url: "/foo", component: "foo-comp"},
   {name: "arg", url: "/arg/:argumentId?:test", component: "arguments-comp"},
   {name: "user", url: "/bar", component: "bar-comp"},
   {name: "state_a", parent: 'bar.baz', url: "/a", component: "baz-a-comp"},
   {name: "state_b", parent: 'bar.baz', url: "/b", component: "baz-b-comp"}
   ]
// top-level
<uirouter-router id="ui-router" states="[[routerStates]]" auto-start>
</uirouter-router>

// view level, generates A tags
<uirouter-sref state="foo" reload>Foo (this restomps every click)</uirouter-sref>
<uirouter-sref state="arg" param-argument-id="99">
    With arguments directly
</uirouter-sref>

// this injects new views based on router state, /index path will 
// result in <index-comp/> being stomped
<uirouter-uiview></uirouter-uiview>

Install the Polymer-CLI

First, make sure you have the Polymer CLI installed.

Install bower and npm dependencies (quick way is yarn bower).

Then run yarn serve to serve your application locally.

TIPS

Set a <base href="$path"> tag in your index.html to let the router know the static/base part of your URL

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].