Icon

Provide consistent sizing and interaction for SVG or image icons.

Live preview
Interact with the component to see results here.
View code
HTML
<sy-icon size="xlarge" aria-label="Favorites"><svg
    xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"
  >
    <path fill="currentColor" d="m12 2 3 6 7 1-5 5 1 7-6-3-6 3 1-7-5-5 7-1z" />
  </svg></sy-icon>

Usage guide

#

Support meaning or represent actions. Provide an accessible name for icon-only actions.

Provide SVG directly

Pass the icon through the SVG slot or svgMarkup.

Provide a file

Set path to a file URL accessible to the browser.

Feature examples

#

Choose a feature from 6 topics. Explore property settings, method calls, event results, and slot layouts through live examples and code.

Usage examples · Overview

Change icon sizes and Regular/Solid styles, then click an icon to copy its SVG code.

View code
HTML
Loading the example.

Usage examples · Overview

Try the selected example. Topics with multiple configurations let you switch between detailed examples.

View code
HTML
Loading the example.

Property · Path

See how settings change appearance and behavior.

View code
HTML
Loading the example.

Property · Selectable

See how settings change appearance and behavior.

View code
HTML
Loading the example.

Property · Size

See how settings change appearance and behavior.

View code
HTML
Loading the example.

Events · Selected

Interact with the component to see event names and payloads in the live preview below.

View code
HTML
Loading the example.

API reference

#

Hover over a name or focus it with the keyboard to see the code. On touch screens, tap the name.

<sy-icon>

Properties

Attribute / PropertyTypeDefaultDescription
'xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge' | 'xxxlarge''medium'Component size.
stringundefinedIcon SVG or image URL.
stringundefinedSVG markup string to display.
booleanfalsePreserve the original SVG aspect ratio.
booleanfalseAllow selection events and keyboard interaction.

Events

EventDetailDescription
CustomEvent<{ value: string }>Emitted when the user selects an item.

Slots

SlotDescription
Component body or child items.