Skip to content

Instantly share code, notes, and snippets.

@pzuraq
Created July 22, 2019 15:12
Show Gist options
  • Save pzuraq/0c16d7baef7237b62dfd7529d1969344 to your computer and use it in GitHub Desktop.
Save pzuraq/0c16d7baef7237b62dfd7529d1969344 to your computer and use it in GitHub Desktop.
{{! calling side }}
<Tabs>
<:tab name="index.js">
<Snippet name="2-mirage-index" />
<:/tab>
<:tab name="App.js">
<Snippet name="2-mirage-app" />
<:/tab>
</Tabs>
{{! Tabs template }}
<div>
{{#each this.blocks.tab as |tab|}}
<button
{{on "click" this.setActiveTab tab}}
class="
{{if (eq this.activeTab tab)
"text-gray-900 text-border-gray-900"
"text-gray-400 border-gray-200"
}}
"
/>
{{tab.args.name}}
</button>
{{/each}}
<div class="mt-6">
{{yield to=this.activeTab}}
</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment