I’d like to use FontAwesome icons in labels of widgets to produce, for example, a button with a trash icon.
The script below;
import streamlit as st
st.write('<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.0/css/all.min.css"/>', unsafe_allow_html=True)
st.write('<i class="fa-solid fa-trash"/>', unsafe_allow_html=True)
st.button('<i class="fa-solid fa-trash"/>')
produces the following:
Inspecting the produced HTML page, I see that < and > are replaced by < and > respectively. If I change these back (in the browser inspection tool), I end up with this