Created
February 14, 2017 15:02
-
-
Save malte-wessel/ca06437ca6600900e7169f7be395f558 to your computer and use it in GitHub Desktop.
Type checking
This file contains hidden or 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
{% property 'expandable' with { type: 'boolean', required: true } %} | |
{% property 'expanded' with { type: 'boolean', required: true } %} | |
{% property 'toggle' with { type: 'function' } %} | |
{% property 'modifier' with { type: 'string' } %} | |
{% property 'children' with { type: 'node', required: true } %} | |
{% property 'title' with { type: 'node' } %} | |
<div | |
class={{ "box box--" + modifier }} | |
expandable={{ expandable }} | |
expanded={{ expanded }}> | |
{% if title %} | |
<div class="box__title"> | |
{{ title }} | |
</div> | |
{% endif %} | |
<div class="box__body"> | |
{{ children }} | |
</div> | |
{% if expandable %} | |
<div class="box__footer"> | |
<button onClick={{ toggle }}>{{ expanded ? 'less' : 'more' }}</button> | |
</div> | |
{% endif %} | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment