Font Customization in .NET MAUI Text Input Layout

18 Nov 201814 minutes to read

The .NET MAUI Text Input Layout control allows to customize the appearance (size, attributes, and family) of the font by setting the FontFamily, FontSize, and FontAttributes properties of the LabelStyle class.

Refer to this documentation to configure the custom fonts in the .NET MAUI.

Prerequisites

Before using the SfTextInputLayout, ensure the following NuGet package is installed in your .NET MAUI project:

  • Syncfusion.Maui.Core

For a step-by-step setup, refer to the Getting Started documentation.

Overview

The following LabelStyle properties are available on Text Input Layout:

Property Applies To Notes
HintLabelStyle Hint label (floating label). Always visible.
HelperLabelStyle Helper text below the input line. Replaced by error text when HasError is true.
ErrorLabelStyle Error text below the input line. Rendered only when HasError is true.

LabelStyle Properties

LabelStyle exposes the following font-related properties.

Property Type Default Description
FontFamily string Platform default Font family. For custom fonts, the value must match the font file name (without the TrueType or OpenType font extension).
FontSize double Platform default Font size in device-independent units.
FontAttributes FontAttributes None One or more of Bold and Italic.
TextColor Color Theme default Text color (useful alongside the font properties).
FontAutoScalingEnabled bool false Enables automatic font size adjustment based on device settings.

Customize the Hint Label

The floating hint label is customized using HintLabelStyle property. The hint label is always visible.