WlIcon

SVG icon from Legato UI. Without name, displays a custom slot icon.
Components / Miscellaneous v0.1.0

Change props to see the result: the example and code use the same settings. “Reset” restores the initial values.

Settings

name

Icon name from the set.

size

Size: number (px) or string (CSS), for example "1em". Enter the size in pixels here. Set a CSS value in the SFC.

title

Accessible title for a meaningful icon.

Example

Focus: outside the example · pointer: outside the example

Explore the live example and copy its Vue SFC into your application. Settings on the left can be combined.

Code for your application

Vue SFC · current settings
<script setup lang="ts">
import { WlIcon } from "legato-ui";
</script>

<template>
  <div class="wl-stack" data-space="md">
    <WlIcon
      name="folder"
      :size="24"
      role="img"
      aria-label="Materials folder"
      
    />
  </div>
</template>

Sizes, compatible names and SVG slot

Catalogue names, sizes 14/18/24/32 and 1em, pi pi-search alias and a safe custom SVG.

plussearchchecktrashfolderbell
14px18px24px32px 1em size
Compatible name pi pi-searchSVG in the default slot without name

Built-in SVGs are decorative. Label a meaningful icon on the button or on an outer role="img". The full catalog is in the Icons documentation section.

Vue SFC · additional example
<script setup lang="ts">
import { WlIcon, type WlIconName } from "legato-ui";
const names = ["plus", "search", "check", "trash", "folder", "bell"] as const satisfies readonly WlIconName[];
</script>

<template>
  <div class="wl-stack" data-space="lg">
    <div class="wl-inline" data-space="lg"><span
      v-for="name in names"
      :key="name"
      class="wl-stack"
      data-space="xs"
    ><WlIcon :name="name" :size="24" /><code class="wl-text-small">{{ name }}</code></span></div>
    <div class="wl-inline" data-space="md"><span
      v-for="size in [14, 18, 24, 32]"
      :key="size"
      class="wl-inline"
      data-space="xs"
    >
      <WlIcon name="search" :size="size" /><span class="wl-text-small">{{ size }}px</span>
    </span><span class="wl-text-body"><WlIcon name="check" size="1em" /> {{ "1em size" }}</span></div>
    <div class="wl-inline" data-space="md">
      <span class="wl-inline" data-space="xs">
        <WlIcon name="pi pi-search" />
        <span class="wl-text-small">{{ "Compatible name pi pi-search" }}</span>
      </span>
      <span role="img" aria-label="Custom confirmation symbol">
        <WlIcon :size="24">
          <svg
            viewBox="0 0 24 24"
            width="24"
            height="24"
            fill="none"
            stroke="currentColor"
            stroke-width="1.5"
            aria-hidden="true"
          ><circle cx="12" cy="12" r="9" /><path d="m7 12 3 3 7-7" /></svg>
        </WlIcon>
      </span>
      <span class="wl-text-small">{{ "SVG in the default slot without name" }}</span>
    </div>
    <p class="wl-text-small wl-text-muted">{{ "Built-in SVGs are decorative. Label a meaningful icon on the button or on an outer role=\"img\". The full catalog is in the Icons documentation section." }}</p>
  </div>
</template>