Skip to content

Instantly share code, notes, and snippets.

@progrium
Last active December 10, 2020 05:23
Show Gist options
  • Save progrium/56db6fd22a0168d1a3e9642d0d70fecd to your computer and use it in GitHub Desktop.
Save progrium/56db6fd22a0168d1a3e9642d0d70fecd to your computer and use it in GitHub Desktop.
function ItemList(items: Item[]) {
return html`
<div class="flex flex-row">
<for each=${items} do=${(item) => html`
<if cond=${item.enabled} then=${() => html`
<div class="text-white mx-2">${item.label}</div>
`}>
`} else=${() => html`
<div class="text-gray font-bold">No items</div>
`}>
</div>`;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment