Giter Site home page Giter Site logo

riot's Introduction

Riot logo

A React-like user interface micro-library

Build Status Riot Forum Join the chat at https://gitter.im/riot/riot

NPM version NPM downloads MIT License Coverage Status Code Quality

Sauce Test Status

Framework Size Comparison

Framework Version Minified Size
Ember 1.13.3 493.3kb
Angular 1.4.2 145.5kb
React 0.13.3 121.7kb
Web Components Polyfill 0.7.5 117.1kb
Polymer 1.0.6 101.2kb
Riot 2.3.0 18.3kb

Custom tags • Concise syntax • Virtual DOM • Full stack

Riot brings custom tags to all browsers, including IE8. Think React + Polymer but with enjoyable syntax and a small learning curve.

Tag definition

<timer>

  <p>Seconds Elapsed: { time }</p>

  this.time = opts.start || 0

  tick() {
    this.update({ time: ++this.time })
  }

  var timer = setInterval(this.tick, 1000)

  this.on('unmount', function() {
    clearInterval(timer)
  })

</timer>

Open this example on Plunker

Mounting

riot.mount('timer', { start: 0 })

Nesting

Custom tags lets you build complex views with HTML.

<timetable>
  <timer start="0"></timer>
  <timer start="10"></timer>
  <timer start="20"></timer>
</timetable>

HTML syntax is the de facto language on the web and it's designed for building user interfaces. The syntax is explicit, nesting is inherent to the language and attributes offer a clean way to provide options for custom tags.

Virtual DOM

  • Absolutely the smallest possible amount of DOM updates and reflows.
  • One way data flow: updates and unmounts are propagated downwards from parent to children.
  • Expressions are pre-compiled and cached for high performance.
  • Lifecycle events for more control.

Close to standards

  • No proprietary event system.
  • Event normalization for IE8.
  • The rendered DOM can be freely manipulated with other tools.
  • No extra HTML root elements or data- attributes.
  • Plays well with jQuery.

Use your dearest language and tools

Concise syntax

  • Power shortcuts: class={ enabled: is_enabled, hidden: hasErrors() }.
  • No extra brain load such as render, state, constructor or shouldComponentUpdate
  • Interpolation: Add #{ items.length + 1 } or class="item { selected: flag }"
  • Compact ES6 method syntax.

Demos

Tutorials

Video Tutorials

Libraries / Frameworks

Components

Resources

Performance

Miscellaneous

Credits

Riot is made with ❤️ by many smart people from all over the world. Thanks to all the contributors
It's actively maintained by:

http://riotjs.com/

riot's People

Contributors

3den avatar a-moses avatar amarcruz avatar andreasheintze avatar andynemzek avatar andyvanee avatar antonheryanto avatar ashbrener avatar aurri avatar avnerus avatar baer avatar cfenzo avatar cognitom avatar crisward avatar e-jigsaw avatar emehrkay avatar gianlucaguarini avatar gregorypratt avatar hemanth avatar marciojcoelho avatar midinastasurazz avatar pakastin avatar rsbondi avatar sethyuan avatar shime avatar speier avatar tipiirai avatar ttamminen avatar txchen avatar xieyu33333 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.