Bootstrap icons helper
This demonstration shows the result of Samizdat's SVG template helper. Samizdat uses the Bootstrap icons from https://github.com/twbs/icons/. Calling the helper adds the svg code to the symbol table in the beginning of the document, plus an inline reference to it.
Usage
<%== icon $iconname, \%options %>
Examples
- <%== icon 'info-circle-fill', {extraclass => 'mx-2 text-primary', title => 'Information'} %>
-
HTML result:
<svg class="bi bi-info-circle-fill mx-2 text-primary" title="Information"><use xlink:href="#bi-info-circle-fill"></use></svg>Shown as:
Options
- prefix (bi)
- Used to make class names. The default is used for the Bootstrap icons set.
- class
- Value for the class attribute. Use this if you don't need the prefixed default classes.
- extraclass
- Space separated list of extra classes to append the prefixed default classes.
- id
- Set the id attribute.
- width
- Set the width attribute.
- height
- Set the height attribute.
- title
- Set the title attribute.
- what (bi)
-
Determines what subdirectory to load svg files from. The default is Bootstrap icons.
Use
flags
for flag-icons oranysvg
for the application's home.