Use Feather in client-side JavaScript
mainTo use Feather in a web project:
- Include the library: Load
feather.jsorfeather.min.jsvia a<script>tag from your localdistfolder or a CDN. - Declare icons: Add a
data-featherattribute with the icon name to an HTML element. - Replace elements: Call
feather.replace()to transform the elements into SVG markup.
<!-- 1. Include -->
<script src="https://unpkg.com/feather-icons"></script>
<!-- 2. Declare -->
<i data-feather="circle"></i>
<!-- 3. Replace -->
<script>
feather.replace();
</script>