faicons is a Python library that provides an interface to Font-Awesome for use in Shiny for Python applications. It enables developers to easily embed scalable vector graphic (SVG) icons from Font Awesome 6.2.0 into their Shiny UI. The current version is 0.2.2, with releases occurring infrequently, typically for minor improvements or Font Awesome version updates.
pip install faiconsVerified import paths — ran on the pinned version, not inferred.
This example demonstrates how to integrate `faicons.icon_svg` into a basic Shiny for Python application to add Font Awesome icons to UI elements like action buttons.
Be aware that the API may not be fully stable. Review release notes for any breaking changes in future versions.
Use explicit CSS length units (e.g., `icon_svg("icon-name", height="2em")`) or manage sizing via parent CSS rules.Refer to the Font Awesome 6.2.0 documentation for available icons and their exact names. Be aware that newer FA7 features or icons might not be present or compatible. Consider external CSS for FA7 compatibility if needed.
Ensure `faicons` is used within a compatible web framework like Shiny for proper rendering. If used independently, embed the output of `icon_svg()` into HTML content that supports SVG rendering.
Provide a numerical value with an explicit CSS unit like 'px', 'em', 'rem', or simply a number for pixel values (e.g., `icon_svg('gear', height='24px')` or `icon_svg('gear', height=24)`).Consult the Font Awesome 6.2.0 documentation for the correct icon name and ensure you are using a free icon if you do not have a Font Awesome Pro license. For example, change `icon_svg('map-o')` to `icon_svg('map')`.Install the library using pip: `pip install faicons`.
Verify that the icon name is correct and corresponds to a free icon available in Font Awesome 6.2.0. Check for any conflicting CSS rules in your Shiny application that might be preventing Font Awesome styles from rendering properly.