{"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":"python","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,"search_vec":"'0.2.2':45 '6.2.0':36 'applic':21 'awesom':14,35,56,62 'current':42 'develop':24,67 'easili':26 'emb':27 'enabl':23 'faicon':1,2 'font':13,34,55,61 'font-awesom':12,60 'graphic':30 'icon':32,63 'improv':53 'infrequ':49 'interfac':10 'librari':6 'minor':52 'occur':48 'provid':8 'python':5,20 'releas':47 'scalabl':28 'shini':18,39,59 'svg':31,64 'typic':50 'ui':40 'updat':58 'use':16 'vector':29 'version':43,57 'web':66 'web-develop':65","created_at":"2026-04-15T18:35:51.814807+00:00","updated_at":"2026-04-16T14:54:54.565620+00:00","problems":[{"fix":"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)`).","cause":"The `height` or `width` parameter in `faicons.icon_svg()` was provided with a percentage value (e.g., '100%'), which is not directly supported; it expects a numerical value followed by a valid CSS length unit (e.g., '1em', '24px') or just a number for pixels.","error":"ValueError: Values provided to `height` and `width` must have a numerical value followed by a CSS length unit."},{"fix":"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')`.","cause":"The icon name used in `faicons.icon_svg()` is either misspelled, does not exist in Font Awesome 6.2.0 (the version `faicons` uses), or is a Font Awesome Pro icon being requested without a Pro setup. This often happens when using older Font Awesome 4 names (e.g., 'map-o' instead of 'map').","error":"The `name` provided ('<icon-name>') does not correspond to a known icon"},{"fix":"Install the library using pip: `pip install faicons`.","cause":"The `faicons` library is not installed in the current Python environment, or the environment where the code is being executed does not have access to the installed package.","error":"ModuleNotFoundError: No module named 'faicons'"},{"fix":"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.","cause":"Icons may not display correctly due to an incorrect icon name, referencing a Font Awesome Pro icon when only free icons are available, or a conflict with other CSS styles overriding Font Awesome.","error":"Font Awesome icons not displaying (showing as squares or blank in Shiny app)"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"0.2.2","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/rstudio/py-faicons","docs":null,"changelog":null,"pypi":"https://pypi.org/project/faicons/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["web-framework"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-28","last_verified":"2026-06-28","next_check":"2026-07-28","install_tag":null}}