{"id":6623,"library":"faicons","title":"faicons","description":"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.","status":"active","version":"0.2.2","language":"en","source_language":"en","source_url":"https://github.com/rstudio/py-faicons","tags":["shiny","font-awesome","icons","svg","web-development"],"install":[{"cmd":"pip install faicons","lang":"bash","label":"Install faicons"}],"dependencies":[{"reason":"Used for generating HTML elements, which icons are rendered as.","package":"htmltools","optional":false},{"reason":"Provides backported and experimental type hints.","package":"typing-extensions","optional":false},{"reason":"The primary framework faicons is designed to integrate with, though not a direct installation dependency.","package":"shiny","optional":true}],"imports":[{"symbol":"icon_svg","correct":"from faicons import icon_svg"}],"quickstart":{"code":"from shiny import App, ui\nfrom faicons import icon_svg\n\napp_ui = ui.page_fluid(\n    ui.h2(\"Shiny App with faicons\"),\n    ui.input_action_button(\"like_button\", \"Like\", icon=icon_svg(\"thumbs-up\")),\n    ui.input_action_button(\"share_button\", \"Share\", icon=icon_svg(\"share-alt\")),\n    ui.output_text(\"feedback\"),\n)\n\ndef server(input, output, session):\n    @ui.reactive.Effect\n    @ui.event(input.like_button)\n    def _():\n        ui.notification_show(\"You liked it!\")\n\n    @ui.reactive.Effect\n    @ui.event(input.share_button)\n    def _():\n        ui.notification_show(\"You shared it!\")\n\napp = App(app_ui, server)","lang":"python","description":"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."},"warnings":[{"fix":"Be aware that the API may not be fully stable. Review release notes for any breaking changes in future versions.","message":"The library is currently listed with a '2 - Pre-Alpha' development status on PyPI, indicating it is still in early development and APIs might be subject to change.","severity":"gotcha","affected_versions":"0.2.2 and earlier"},{"fix":"Use explicit CSS length units (e.g., `icon_svg(\"icon-name\", height=\"2em\")`) or manage sizing via parent CSS rules.","message":"The `icon_svg()` function's `height` and `width` parameters expect a numerical value followed by a CSS length unit (e.g., '100px', '2em'), not a percentage value like '100%'. Providing a percentage will raise a `ValueError`.","severity":"gotcha","affected_versions":"0.2.2 and earlier"},{"fix":"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.","message":"faicons currently uses Font Awesome 6.2.0. Font Awesome 7.0 introduced significant breaking changes (e.g., fixed-width icons by default, changes to SVG path classes, removal of legacy webfonts). Icons and styling expectations from FA7 might not apply or work as expected with faicons.","severity":"gotcha","affected_versions":"0.2.2 and earlier"},{"fix":"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.","message":"While faicons provides a Python interface for Font Awesome icons, it is specifically designed 'for use in Shiny for Python'. Directly generating standalone SVG strings with `icon_svg()` outside of a framework that renders HTML (like Shiny) may require additional handling to display them correctly in a web context.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-15T00:00:00.000Z","next_check":"2026-07-14T00:00:00.000Z","problems":[]}