Skip to main content

Icon Component

FigmaHeroicons

The glu-icon component is a versatile element that renders SVG icons from Heroicons v2.0. It supports multiple visual variants, customizable sizes, and color adjustments. This makes it easy to integrate scalable icons into your projects with a consistent style.

Basic Usage

Example 1: Simple Icon

Display a basic icon by specifying the name property.

Result
Loading...
Live Editor
<glu-icon name="arrow-up"></glu-icon>

Icon Variants

Customize the icon appearance using the variant property. Choose between outline (default) and solid to suit your design.

Result
Loading...
Live Editor
<div style={{ display: 'flex', gap: '1rem' }}>
  <glu-icon name="arrow-up" variant="outline"></glu-icon>
  <glu-icon name="arrow-up" variant="solid"></glu-icon>
</div>

Icon Sizes

Adjust the dimensions of the icon using the size property, which overrides both the width and height. Alternatively, you can set custom values for width and height.

Result
Loading...
Live Editor
<div style={{ display: 'flex', gap: '1rem' }}>
  <div style={{ display: 'flex', gap: '1rem', alignItems: 'center' }}>
    <glu-icon name="arrow-up" size="16"></glu-icon>
    <glu-icon name="arrow-up" size="24"></glu-icon>
    <glu-icon name="arrow-up" size="32"></glu-icon>
  </div>
  <div style={{ display: 'flex', gap: '1rem', alignItems: 'center' }}>
    <glu-icon name="arrow-up" width="16" height="16"></glu-icon>
    <glu-icon name="arrow-up" width="24" height="24"></glu-icon>
    <glu-icon name="arrow-up" width="32" height="32"></glu-icon>
  </div>
</div>

Customizing Icon Color

Apply a custom color using the color property. Ensure that your SVG uses currentColor so that the color change is effective.

Result
Loading...
Live Editor
<glu-icon name="arrow-up" color="#ff0000"></glu-icon>

Properties

PropertyAttributeDescriptionTypeDefault
colorcolorCustom color for the SVG icon. Para que este cambio tenga efecto, asegúrate de que el SVG use currentColor en sus atributos.stringundefined
heightheightCustom height of the icon in pixelsnumber | string24
name (required)nameThe name of the icon to displaystringundefined
sizesizeUniform size of the icon in pixels (takes precedence over width and height)number | stringundefined
variantvariantThe visual variant style of the icon"outline" | "solid"'outline'
widthwidthCustom width of the icon in pixelsnumber | string24

Dependencies

Used by

Graph


Built with StencilJS