menu

Blazor

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class TextBoxModel - Blazor API Reference | Syncfusion

    Show / Hide Table of Contents

    Class TextBoxModel

    Represents the configuration model for the TextBox component, containing all properties and settings that define the appearance, behavior, and functionality of the TextBox control.

    Inheritance
    System.Object
    TextBoxModel
    Namespace: Syncfusion.Blazor.Inputs
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public class TextBoxModel : Object

    Constructors

    TextBoxModel()

    Declaration
    public TextBoxModel()

    Properties

    Autocomplete

    Specifies whether the browser is allowed to automatically enter or select a value for the TextBox.

    By default, autocomplete is enabled for TextBox.

    Possible values are:

    • OnSpecifies that autocomplete is enabled
    • OffSpecifies that autocomplete is disabled.
    Declaration
    public AutoComplete Autocomplete { get; set; }
    Property Value
    Type
    AutoComplete

    CssClass

    Gets or sets the CSS class name that can be appended to the root element of the TextBox. One or more custom CSS classes can be added to a TextBox for styling purposes.

    Declaration
    public string CssClass { get; set; }
    Property Value
    Type Description
    System.String

    A System.String containing the CSS class names, or null if no custom classes are specified.

    Enabled

    Gets or sets a value indicating whether the TextBox allows user interaction. When disabled, the TextBox will not respond to user input and will appear in a disabled state.

    Declaration
    public bool Enabled { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if the TextBox is enabled for user interaction; otherwise, false. The default is true.

    EnablePersistence

    Gets or sets a value indicating whether to persist the TextBox state between page reloads. When enabled, the Value state will be persisted across browser sessions.

    Declaration
    public bool EnablePersistence { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if the TextBox state should be persisted; otherwise, false. The default is false.

    EnableRtl

    Gets or sets a value indicating whether to render the component in right-to-left direction.

    Declaration
    public bool EnableRtl { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if the component should be rendered in RTL direction; otherwise, false. The default is false.

    FloatLabelType

    Specifies the floating label behavior of the TextBox that the placeholder text floats above the TextBox based on the following values.

    Possible values are:

    • NeverNever floats the label in the TextBox when the placeholder is available.
    • AlwaysThe floating label always floats above the TextBox.
    • AutoThe floating label floats above the TextBox after focusing it or when enters the value in it.
    Declaration
    public FloatLabelType FloatLabelType { get; set; }
    Property Value
    Type
    FloatLabelType

    HtmlAttributes

    Gets or sets additional HTML attributes to be applied to the root element of the TextBox. This allows you to add custom attributes such as styles, classes, and other HTML attributes.

    Declaration
    public Dictionary<string, object> HtmlAttributes { get; set; }
    Property Value
    Type Description
    System.Collections.Generic.Dictionary<System.String, System.Object>

    A System.Collections.Generic.Dictionary<, > of string keys and object values representing HTML attributes, or null if no additional attributes are specified.

    Remarks

    If both a component property and an equivalent HTML attribute are configured, the component property value takes precedence.

    InputAttributes

    Gets or sets additional input attributes to be applied to the input element of the TextBox. This allows you to add custom input-specific attributes such as disabled, value, and more.

    Declaration
    public Dictionary<string, object> InputAttributes { get; set; }
    Property Value
    Type Description
    System.Collections.Generic.Dictionary<System.String, System.Object>

    A System.Collections.Generic.Dictionary<, > of string keys and object values representing input attributes, or null if no additional input attributes are specified.

    Remarks

    If both a component property and an equivalent input attribute are configured, the component property value takes precedence.

    Multiline

    Gets or sets a value indicating whether the TextBox supports multiline input. When enabled, the TextBox changes from a single line to a multiline text area.

    Declaration
    public bool Multiline { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if multiline input is enabled; otherwise, false. The default is false.

    Placeholder

    Gets or sets the placeholder text that is displayed as a hint until the user focuses or enters a value in the TextBox. The behavior of this property depends on the FloatLabelType property setting.

    Declaration
    public string Placeholder { get; set; }
    Property Value
    Type Description
    System.String

    A System.String containing the placeholder text, or null if no placeholder is specified.

    Readonly

    Gets or sets a value indicating whether the TextBox is read-only. When set to true, users cannot modify the text content.

    Declaration
    public bool Readonly { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if the TextBox is read-only; otherwise, false. The default is false.

    ShowClearButton

    Gets or sets a value indicating whether the clear button is displayed in the TextBox. When enabled, users can click the clear button to remove all text from the TextBox.

    Declaration
    public bool ShowClearButton { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if the clear button should be displayed; otherwise, false. The default is false.

    TabIndex

    Gets or sets the tab order of the TextBox component in the tab sequence.

    Declaration
    public int TabIndex { get; set; }
    Property Value
    Type Description
    System.Int32

    An System.Int32 representing the tab order. A value of 0 means the element participates in the default tab order.

    Type

    Gets or sets the input type of the TextBox, which determines the behavior and appearance of the input field.

    Declaration
    public InputType Type { get; set; }
    Property Value
    Type Description
    InputType

    An InputType value that specifies the type of input (text, password, email, etc.). The default is Text.

    Value

    Gets or sets the current value of the TextBox.

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

    A System.String representing the current text content, or null if the TextBox is empty.

    Width

    Gets or sets the width of the TextBox component.

    Declaration
    public string Width { get; set; }
    Property Value
    Type Description
    System.String

    A System.String representing the width in CSS units (px, %, em, etc.), or null for auto width.

    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved