ICONYZ
English
Trash icon from Codicons

Trash icon

codicon:trash

The Trash icon (codicon:trash) is a free SVG icon from the Codicons set by Microsoft Corporation. It is drawn on a 24 × 24 grid. Codicons are released under the CC BY 4.0 license, which allows use in personal and commercial projects as long as you credit the author. Copy it as SVG, JSX, Vue or Svelte code, or download the SVG file.

Icon set
Codicons
Author
Microsoft Corporation
License
CC-BY-4.0
Size
24 × 24
Download SVG

SVG code

<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M14 2h-4c0-1.103-.897-2-2-2S6 .897 6 2H2a.5.5 0 0 0 0 1h.54l.809 9.708A2.513 2.513 0 0 0 5.84 15h4.319a2.514 2.514 0 0 0 2.491-2.292L13.459 3h.54a.5.5 0 0 0 0-1zM8 1c.551 0 1 .449 1 1H7c0-.551.449-1 1-1m3.655 11.625A1.51 1.51 0 0 1 10.16 14H5.841a1.51 1.51 0 0 1-1.495-1.375L3.544 3h8.914l-.802 9.625zM7 5.5v6a.5.5 0 0 1-1 0v-6a.5.5 0 0 1 1 0m3 0v6a.5.5 0 0 1-1 0v-6a.5.5 0 0 1 1 0"/></svg>

How to use the Trash icon

React

import { Icon } from "@iconify/react";

<Icon icon="codicon:trash" width="24" />

Vue

<script setup>
import { Icon } from "@iconify/vue";
</script>

<template>
  <Icon icon="codicon:trash" width="24" />
</template>

Svelte

<script>
  import Icon from "@iconify/svelte";
</script>

<Icon icon="codicon:trash" width="24" />

Tailwind CSS

<!-- @iconify/tailwind plugin -->
<span class="icon-[codicon--trash]"></span>

UnoCSS

<!-- @unocss/preset-icons + @iconify-json/codicon -->
<div class="i-codicon:trash"></div>

Web component

<script src="https://code.iconify.design/iconify-icon/2.1.0/iconify-icon.min.js"></script>

<iconify-icon icon="codicon:trash"></iconify-icon>

HTML image

<img src="https://iconyz.com/api/public/svg/codicon/trash.svg" alt="Trash icon" width="24" height="24">

Trash icon in other icon sets

Trash icon FAQ

Is the Trash icon free for commercial use?

Yes. Codicons are released under the CC BY 4.0 license, which allows use in personal and commercial projects as long as you credit the author.

How do I use the Trash icon in React?

Install @iconify/react and render <Icon icon="codicon:trash" />, or use “Copy code” on this page to get a standalone React component.

How do I add the Trash icon to a web page?

Link the SVG file in an image tag: <img src="https://iconyz.com/api/public/svg/codicon/trash.svg" alt="Trash icon">, or paste the SVG code inline to style it with CSS.

Browse all Codicons →