.NET Standard 1.0
There is a newer version of this package available.
See the version list below for details.
dotnet add package Xam.Plugin.HtmlLabel --version
NuGet\Install-Package Xam.Plugin.HtmlLabel -Version
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Xam.Plugin.HtmlLabel" Version="" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Xam.Plugin.HtmlLabel --version
#r "nuget: Xam.Plugin.HtmlLabel,"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install Xam.Plugin.HtmlLabel as a Cake Addin
#addin nuget:?package=Xam.Plugin.HtmlLabel&version=

// Install Xam.Plugin.HtmlLabel as a Cake Tool
#tool nuget:?package=Xam.Plugin.HtmlLabel&version=

HTML Label Plugin for Xamarin.Forms

Use this Xamarin.Forms plugin to display HTML content into a label.


  • Xamarin.Forms 3.0
  • IsHtml and RemoveHtmlTags properties removed
  • HtmlAgilityPack dependency removed
  • Navigating and Navitated events added when users tap on links
  • Namespace and assembly name changed


  • Available on NuGet: https://www.nuget.org/packages/Xam.Plugin.HtmlLabel
  • Install it in every Xamarin.Forms project.
  • iOS: AppDelegate.cs
  • Android: MainActivity.cs
    global::Xamarin.Forms.Forms.Init(this, bundle);
  • UWP: App.xaml.cs
    var rendererAssemblies = new[] { typeof(HtmlLabelRenderer).GetTypeInfo().Assembly };
    Xamarin.Forms.Forms.Init(e, rendererAssemblies);

How it works

On iOS and Android it uses the native HTML rendering capabilities of iOS's UILabel and Android's TextView.

UWP's TextBlock cannot renders HTML so the library parses the HTML and uses Inlines to display: <a>, <b>, <br>, <em>, <i>, <p>, <strong>, <u>, <ul> <li>, <div>.

FontAttributes, FontFamily, FontSize, TextColor, HorizontalTextAlignment are converted into inline CSS in a wrapping <div> for iOS and Android. UWP supports them natively.

Custom styling

If you need to customize something in Android or iOS you can use inline CSS, for example:

<span style="color: green">...</span>

For underlined text use the <u> tag: <u>Some underlined text</u>

For links: remember to add the schema (http:// https:// // mailto:// ext...)

Supported Properties

  • Text
  • FontAttributes
  • FontFamily
  • FontSize
  • TextColor
  • HorizontalTextAlignment


Navigating Navigated

Custom Properties

  • MaxLines (int)

Usage XAML

<htmlLabel:HtmlLabel Text="{Binding HtmlString}"/>
<htmlLabel:HtmlLabel Text="{Binding HtmlString}" htmlLabel:HtmlLabel.MaxLines="2"/>

Usage C#

var label = new HtmlLabel();
label.Text = "..htmlstring.."
HtmlLabel.SetMaxLines(label, 3);


  • SetMaxLines and LineBreakMode.TailTruncation do not work properly;
  • Using Links and custom fonts together could not work properly on iOS.
  • Images won't be displayed on Android (TextView limitation).


Contributions are welcome!


Under MIT, see LICENSE file.

Product Versions
.NET net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows
.NET Core netcoreapp1.0 netcoreapp1.1 netcoreapp2.0 netcoreapp2.1 netcoreapp2.2 netcoreapp3.0 netcoreapp3.1
.NET Standard netstandard1.0 netstandard1.1 netstandard1.2 netstandard1.3 netstandard1.4 netstandard1.5 netstandard1.6 netstandard2.0 netstandard2.1
.NET Framework net45 net451 net452 net46 net461 net462 net463 net47 net471 net472 net48
MonoAndroid monoandroid monoandroid71
MonoMac monomac
MonoTouch monotouch
Tizen tizen30 tizen40 tizen60
Universal Windows Platform uap uap10.0 uap10.0.17134
Windows Phone wp8 wp81 wpa81
Windows Store netcore netcore45 netcore451
Xamarin.iOS xamarinios xamarinios10
Xamarin.Mac xamarinmac
Xamarin.TVOS xamarintvos
Xamarin.WatchOS xamarinwatchos
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Xam.Plugin.HtmlLabel:

Package Downloads

InterfaceBuilder is an hepful api to write Xamarin.Forms user interfaces directly in sourcecode. It's heavly relying on the builder pattern. So you can write: var ui = new UI(); MainPage = ui.Page("MainPage", ui.Stack().With( ui.Label("A"), ui.Label("B"), ui.Label("C")) );

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on Xam.Plugin.HtmlLabel:

Repository Stars
Xamarin.Forms Custom Control
Version Downloads Last updated
5.1.0 10,084 6/18/2022
5.0.2 211 6/18/2022
5.0.0 79,976 11/7/2020
5.0.0-alpha4 294 9/30/2020
5.0.0-alpha3 736 9/10/2020
5.0.0-alpha1 536 6/10/2020
4.1.3 109,841 6/23/2020
4.1.2 40,121 4/18/2020
4.1.1 2,796 4/5/2020
4.1.0 4,211 3/25/2020
4.0.1 3,219 3/15/2020
4.0.0 665 3/14/2020
4.0.0-preview.1 268 3/8/2020 104,499 3/18/2019 65,981 11/25/2018 21,283 8/26/2018 1,960 6/13/2018
2.2.0 22,691 3/24/2018
2.1.5 1,134 3/7/2018
2.1.4 2,307 2/5/2018
2.1.3 855 2/3/2018
2.1.2 1,287 1/29/2018
2.1.1 985 1/28/2018
2.1.0 1,281 1/15/2018
1.0.4 6,366 7/11/2017