Skip to content

Instantly share code, notes, and snippets.

@svierk
Created March 23, 2022 12:33
Show Gist options
  • Save svierk/f1140ca5d78bbc23b1da79606388a1f3 to your computer and use it in GitHub Desktop.
Save svierk/f1140ca5d78bbc23b1da79606388a1f3 to your computer and use it in GitHub Desktop.
HTML template for LWC that represents an item within the multi select combobox parent component
<template>
<li
role="presentation"
key={item.key}
class={itemClass}
data-id={item.key}
data-name={item.value}
onclick={handleClick}
>
<div class="slds-media slds-listbox__option slds-listbox__option_plain slds-media_small" role="option">
<span class="slds-media__figure">
<lightning-icon
icon-name="utility:check"
size="x-small"
alternative-text="Selected"
class="slds-icon slds-icon--selected slds-icon--x-small slds-icon-text-default slds-m-right--x-small"
>
</lightning-icon>
</span>
<span class="slds-media__body">
<span class="slds-truncate" title={item.value}>{item.label}</span>
</span>
</div>
</li>
</template>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment