menu

MAUI Toolkit

  • User Guide
  • Demos
  • Support
Class LabelStyle - MAUI-ToolKit API Reference | Syncfusion

    Show / Hide Table of Contents

    Class LabelStyle

    Represents the style for hint text, error text, and helper text label elements in the SfTextInputLayout control. Provides customizable properties for text appearance.

    Inheritance
    System.Object
    LabelStyle
    Namespace: Syncfusion.Maui.Toolkit.TextInputLayout
    Assembly: Syncfusion.Maui.Toolkit.dll
    Syntax
    public class LabelStyle : Element, ITextElement

    Constructors

    LabelStyle()

    Declaration
    public LabelStyle()

    Fields

    FontAttributesProperty

    Identifies the FontAttributes bindable property.

    Declaration
    public static readonly BindableProperty FontAttributesProperty
    Field Value
    Type
    Microsoft.Maui.Controls.BindableProperty
    Remarks

    The FontAttributes property specifies the font attributes for the text in the SfTextInputLayout.

    FontAutoScalingEnabledProperty

    Identifies the FontAutoScalingEnabled bindable property.

    Declaration
    public static readonly BindableProperty FontAutoScalingEnabledProperty
    Field Value
    Type
    Microsoft.Maui.Controls.BindableProperty
    Remarks

    The FontAutoScalingEnabled property determines whether automatic font scaling is enabled in the SfTextInputLayout.

    FontFamilyProperty

    Identifies the FontFamily bindable property.

    Declaration
    public static readonly BindableProperty FontFamilyProperty
    Field Value
    Type
    Microsoft.Maui.Controls.BindableProperty
    Remarks

    The FontFamily property specifies the font family for the text in the SfTextInputLayout.

    FontSizeProperty

    Identifies the FontSize bindable property.

    Declaration
    public static readonly BindableProperty FontSizeProperty
    Field Value
    Type
    Microsoft.Maui.Controls.BindableProperty
    Remarks

    The FontSize property determines the font size of the SfTextInputLayout.

    TextColorProperty

    Identifies the TextColor bindable property.

    Declaration
    public static readonly BindableProperty TextColorProperty
    Field Value
    Type
    Microsoft.Maui.Controls.BindableProperty
    Remarks

    The TextColor property determines the color of the text in SfTextInputLayout.

    Properties

    FontAttributes

    Gets or sets the font attributes for the label.

    Declaration
    public FontAttributes FontAttributes { get; set; }
    Property Value
    Type
    Microsoft.Maui.Controls.FontAttributes
    Examples

    The following code demonstrates how to use the FontAttributes property in the SfTextInputLayout.

    • XAML
    • C#
    <inputLayout:SfTextInputLayout x:Name="textInput"
                                   Hint="Name">
     <inputLayout:SfTextInputLayout.HintLabelStyle>
       <inputLayout:LabelStyle FontAttributes="Italic" />
    </inputLayout:SfTextInputLayout.HintLabelStyle>
        <Entry />
    </inputLayout:SfTextInputLayout>
    var inputLayout = new SfTextInputLayout();
    inputLayout.Hint = "Name";
    inputLayout.HintLabelStyle = new LabelStyle() { FontAttributes = "Italic" };
    inputLayout.Content = new Entry();

    FontAutoScalingEnabled

    Gets or sets whether automatic font scaling is enabled.

    Declaration
    public bool FontAutoScalingEnabled { get; set; }
    Property Value
    Type
    System.Boolean
    Examples

    The following code demonstrates how to use the FontAutoScalingEnabled property in the SfTextInputLayout.

    • XAML
    • C#
    <inputLayout:SfTextInputLayout x:Name="textInput"
                                   Hint="Name">
     <inputLayout:SfTextInputLayout.HintLabelStyle>
       <inputLayout:LabelStyle FontAutoScalingEnabled="True" />
    </inputLayout:SfTextInputLayout.HintLabelStyle>
        <Entry />
    </inputLayout:SfTextInputLayout>
    var inputLayout = new SfTextInputLayout();
    inputLayout.Hint = "Name";
    inputLayout.HintLabelStyle = new LabelStyle() { FontAutoScalingEnabled = true };
    inputLayout.Content = new Entry();

    FontFamily

    Gets or sets the font family for the label.

    Declaration
    public string FontFamily { get; set; }
    Property Value
    Type
    System.String
    Examples

    The following code demonstrates how to use the FontFamily property in the SfTextInputLayout.

    • XAML
    • C#
    <inputLayout:SfTextInputLayout x:Name="textInput"
                                   Hint="Name">
     <inputLayout:SfTextInputLayout.HintLabelStyle>
       <inputLayout:LabelStyle FontFamily="Lobster-Regular" />
    </inputLayout:SfTextInputLayout.HintLabelStyle>
        <Entry />
    </inputLayout:SfTextInputLayout>
    var inputLayout = new SfTextInputLayout();
    inputLayout.Hint = "Name";
    inputLayout.HintLabelStyle = new LabelStyle() { FontFamily = "Lobster-Regular" };
    inputLayout.Content = new Entry();

    FontSize

    Gets or sets the font size for the label.

    Declaration
    public double FontSize { get; set; }
    Property Value
    Type
    System.Double
    Examples

    The following code demonstrates how to use the FontSize property in the SfTextInputLayout.

    • XAML
    • C#
    <inputLayout:SfTextInputLayout x:Name="textInput"
                                   Hint="Name">
     <inputLayout:SfTextInputLayout.HintLabelStyle>
       <inputLayout:LabelStyle FontSize="25" />
    </inputLayout:SfTextInputLayout.HintLabelStyle>
        <Entry />
    </inputLayout:SfTextInputLayout>
    var inputLayout = new SfTextInputLayout();
    inputLayout.Hint = "Name";
    inputLayout.HintLabelStyle = new LabelStyle() { FontSize = 25 };
    inputLayout.Content = new Entry();

    TextColor

    Gets or sets the text color for the label. Used for helper, hint, and counter labels. For error label color, use the Stroke property in error state.

    Declaration
    public Color TextColor { get; set; }
    Property Value
    Type
    Microsoft.Maui.Graphics.Color
    Examples

    The following code demonstrates how to use the TextColor property in the SfTextInputLayout.

    • XAML
    • C#
    <inputLayout:SfTextInputLayout x:Name="textInput"
                                   Hint="Name">
     <inputLayout:SfTextInputLayout.HintLabelStyle>
       <inputLayout:LabelStyle TextColor = "Green" />
    </inputLayout:SfTextInputLayout.HintLabelStyle>
        <Entry />
    </inputLayout:SfTextInputLayout>
    var inputLayout = new SfTextInputLayout();
    inputLayout.Hint = "Name";
    inputLayout.HintLabelStyle = new LabelStyle() { TextColor = Color.Green };
    inputLayout.Content = new Entry();
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved