Renders a customizable icon using a slot for SVG content.
This component does not bind you to a specific set of icons. Instead, it provides a slot for inserting SVG content from any icon library you choose.
Render an icon with visually hidden text using the heroicons
library:
<.icon text="report bug"><Heroicons.bug_ant /></.icon>
To display the text visibly:
<.icon text="report bug" text_position="after">
<Heroicons.bug_ant />
</.icon>
aria-hidden
Not all icon libraries set the
aria-hidden
attribute by default. Always make sure that it is set on the<svg>
element that the library renders.