Skip to main content
Light Dark System

Icon

<zn-icon> | ZnIcon
Since 1.0 experimental

Short summary of the component’s intended use.


<zn-icon src="Add"></zn-icon>

Examples

Avatar


<zn-icon src="BG" library="avatar" color="primary"></zn-icon>
<zn-icon src="BG" library="avatar" color="accent" round></zn-icon>

Icon Colors


<zn-icon src="Check" color="accent" size="32"></zn-icon>
<zn-icon src="check" color="warning" size="32"></zn-icon>
<zn-icon src="check" color="primary" size="32"></zn-icon>
<zn-icon src="check" color="info" size="32"></zn-icon>
<zn-icon src="check" color="error" size="32"></zn-icon>
<zn-icon src="check" color="disabled" size="32"></zn-icon>
<zn-icon src="check" color="success" size="32"></zn-icon>
<zn-icon src="check" color="white" size="32"></zn-icon>

Gravatar


<zn-icon src="test1@example.com" size="32"></zn-icon>

Default icons

Our icons are taken directly from Material Icons. Click or tap on any icon to copy its name, then you can use it in your HTML like this:


<zn-icon src="check"></zn-icon>

Importing

If you’re using the autoloader or the traditional loader, you can ignore this section. Otherwise, feel free to use any of the following snippets to cherry pick this component.

To import this component from the CDN using a script tag:

<script type="module" src="https://cdn.jsdelivr.net/npm/@kubex/zinc@1.0.0/dist/components/icon/icon.js"></script>

To import this component from the CDN using a JavaScript import:

import 'https://cdn.jsdelivr.net/npm/@kubex/zinc@1.0.0/dist/components/icon/icon.js';

To import this component using a bundler:

import '@kubex/zinc/dist/components/icon/icon.js';

Slots

Name Description
(default) The default slot.
example An example slot.

Learn more about using slots.

Events

Name React Event Description Event Detail
zn-event-name Emitted as an example. -

Learn more about events.

Custom Properties

Name Description Default
--example An example CSS custom property.

Learn more about customizing CSS custom properties.

Parts

Name Description
base The component’s base wrapper.

Learn more about customizing CSS parts.

Dependencies

This component automatically imports the following dependencies.

  • <zn-example>