Browse Docs

Usages

Learn how to use icons by using templates and shortcodes.

Use Icons via Templates

1{{ $ctx := dict
2  "vendor" "bootstrap"
3  "name" "house"
4}}
5{{ partial "icons/icon" $ctx }}

Parameters

vendor

NameContextTypeRequiredDefaultSinceExample
vendor-string---

The vendor name of icons.

name

NameContextTypeRequiredDefaultSinceExample
name-string---

The icon name.

size

NameContextTypeRequiredDefaultSinceExample
size-string-1em--

The square icon size.

height

NameContextTypeRequiredDefaultSinceExample
height-string-1em--

The height of icon.

width

NameContextTypeRequiredDefaultSinceExample
width-string-1em--

The width of icon.

className

NameContextTypeRequiredDefaultSinceExample
className-string----

The additional CSS class names of <svg> element.

color

NameContextTypeRequiredDefaultSinceExample
color-string----

The color of icon, e.g. blue, red, #FF438A.

Use Icons via Shortcode

Both of ico and icons/icon are valid.

Parameters

vendor

PositionNameTypeRequiredDefaultSinceExample
#0vendorstring---

The vendor name of icons.

name

PositionNameTypeRequiredDefaultSinceExample
#1namestring---

The icon name.

size

PositionNameTypeRequiredDefaultSinceExample
#2sizestring-1em--

The square icon size.

height

PositionNameTypeRequiredDefaultSinceExample
-heightstring-1em--

The height of icon.

width

PositionNameTypeRequiredDefaultSinceExample
-widthstring-1em--

The width of icon.

className

PositionNameTypeRequiredDefaultSinceExample
-classNamestring----

The additional CSS class names of <svg> element.

color

PositionNameTypeRequiredDefaultSinceExample
-colorstring----

The color of icon, e.g. blue, red, #FF438A.

Icons Shortcode Examples

Icon With Default Settings

Source
1{{< ico bootstrap house >}}
Result

Icon With Custom Color

Source
1{{< icons/icon vendor=bootstrap name=exclamation-circle color=red >}}
Result

Icon With Custom Class Name

Source
1{{< icons/icon vendor=bootstrap name=check-circle className="text-success" >}}
Result

Icon With Custom Size

Source
1{{< icons/icon vendor=bootstrap name=plus-circle size=3em >}}
Result