Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@Rich-Harris
Created March 20, 2015 20:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Rich-Harris/610bdc80be7d39eaa9cf to your computer and use it in GitHub Desktop.
Save Rich-Harris/610bdc80be7d39eaa9cf to your computer and use it in GitHub Desktop.
Gist-powered example

You can make examples from a gist. This text comes from the README.md file, while any *.html files will be turned into components. Any code in the (required) main.js file is evaluated.

Component dependencies are pulled in from npm via https://wzrd.in/.

<button on-tap='activate()'>click me!</button>
<style>
button {
background-color: #d00;
color: white;
font-size: 2em;
padding: 1em;
border-radius: 0.2em;
}
</style>
<script>
component.exports = {
activate: function () {
alert( 'activating!' );
},
events: {
tap: require( 'ractive-events-tap' )
}
}
</script>
var ractive = new BigButton({
el: demo
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment