freedom

Icons

Gautham Chettiar Est. 1 Min ( 184 Words )

Add inline SVG icons using widgets/icon.html partial.

This is partial implementation of icons, if you are looking for the shortcode version, check Icons documentation.

Features#

Parameters#

name#
(required) Font Awesome icon filename (e.g. github, lightbulb, circle-info).
style#
(optional) solid | regular | brands (default: solid).
class#
(optional) Additional CSS classes to append to the SVG.
ariaLabel#
(optional) Accessible label for screen readers (defaults to the icon name).

Icons are fetched from Font Awesome free catalog. Check below links for supported icons in each style:

Syntax#

go-html-template
{{ 
    partial "widgets/icon.html" (dict 
        "name" "github" 
        "style" "brands" 
        "class" "my-icon" 
        "ariaLabel" "GitHub profile"
    )
}}

Examples#

Below is a quick reference table showing common icon partial calls and their rendered output.

codeicon
{{ partial "widgets/icon.html" (dict "name" "lightbulb") }}
{{ partial "widgets/icon.html" (dict "name" "heart" "class" "text-danger") }}
{{ partial "widgets/icon.html" (dict "name" "envelope" "style" "regular" "ariaLabel" "Email") }}
{{ partial "widgets/icon.html" (dict "name" "github" "style" "brands" "ariaLabel" "GitHub") }}
{{ partial "widgets/icon.html" (dict "name" "twitter" "style" "brands" "ariaLabel" "Twitter") }}