Skip to content

OverflowMenuItem with icon? #1386

Answered by metonym
dankobg asked this question in Q&A
Jul 8, 2022 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

https://svelte.dev/repl/979d3e0c1e8d4703b80cc33166cd6783?version=3.49.0

<script>
  import { OverflowMenu, OverflowMenuItem } from "carbon-components-svelte";
  import TrashCan from "carbon-icons-svelte/lib/TrashCan.svelte";
</script>

<OverflowMenu>
  <OverflowMenuItem>
    <div>
      <TrashCan /> Text
    </div>
  </OverflowMenuItem>
</OverflowMenu>

<style>
  div {
    display: flex;
    align-items: center;
  }
	
  :global(div *) {
    margin-right: 0.375rem;
  }
</style>

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@dankobg
Comment options

Answer selected by dankobg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants