How do you use font icons (icon fonts) in MAUI?
Short answer
Register the icon font (e.g., FontAwesome/Material Icons), then set a Label or button ImageSource to a FontImageSource specifying the glyph unicode and FontFamily. This gives crisp, scalable, tintable icons without image assets.
Advertisement
AModel answer
Register the icon font (e.g., FontAwesome/Material Icons), then set a Label or button ImageSource to a FontImageSource specifying the glyph unicode and FontFamily. This gives crisp, scalable, tintable icons without image assets.
<Image>
<Image.Source>
<FontImageSource Glyph="" FontFamily="FA" Color="Purple" />
</Image.Source>
</Image>Real-world example
A tab bar uses FontAwesome glyphs as icons so they scale sharply and recolor with the theme.
Likely follow-ups
- Why use icon fonts over PNGs? | What is FontImageSource?
Related topics