Created
August 18, 2017 11:59
Star
You must be signed in to star a gist
Custom elements with bel (via https://github.com/shama/bel/compare/master...timwis:custom-elements?expand=1)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const html = require('bel') | |
window.CustomButton = function (props) { | |
console.log('Called CustomButton', props) | |
return html` | |
<button style="background-color: ${props.color}"> | |
${props.label} | |
</button> | |
` | |
} | |
const tree = html` | |
<div> | |
<CustomButton color="red" label="Add" /> | |
</div> | |
` | |
document.body.appendChild(tree) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment