menu

Blazor

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

    Show / Hide Table of Contents

    Class InputType

    Specifies the input type for TextBox components, determining the data format, validation behavior, and browser-specific features.

    Inheritance
    System.Object
    InputType
    Namespace: Syncfusion.Blazor.Inputs
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public sealed class InputType : Enum
    Remarks

    Different input types provide specialized functionality including:

    • Format validation (email, URL patterns)
    • Virtual keyboard optimization on mobile devices
    • Browser-specific UI enhancements (password masking, number steppers)
    • Accessibility improvements for screen readers
    • Built-in validation messages and constraints
    Choose the appropriate input type to ensure optimal user experience and data integrity.
    Examples

    Setting different input types:

    <SfTextBox Type="InputType.Email" Placeholder="Enter email address"></SfTextBox>
    <SfTextBox Type="InputType.Password" Placeholder="Enter password"></SfTextBox>

    Fields

    Email

    Email address input with built-in validation for proper email format and optimized virtual keyboard on mobile devices.

    Declaration
    public const InputType Email
    Field Value
    Type Description
    InputType

    Represents the "email" input type for email address entry.

    Remarks

    This input type provides built-in email format validation and displays an optimized virtual keyboard on mobile devices with easy access to the @ symbol and common email domains.

    Number

    Numeric input with built-in number validation and spinner controls for incrementing/decrementing values.

    Declaration
    public const InputType Number
    Field Value
    Type Description
    InputType

    Represents the "number" input type for numeric entry.

    Remarks

    This input type restricts input to numeric values and may provide spinner controls (up/down arrows) for incrementing and decrementing values. Mobile devices will display a numeric keypad for easier number entry.

    Password

    Password input where characters are visually masked for security, preventing shoulder surfing and maintaining privacy.

    Declaration
    public const InputType Password
    Field Value
    Type Description
    InputType

    Represents the "password" input type for secure text entry.

    Remarks

    Characters entered in password fields are masked with dots or asterisks to prevent visual eavesdropping. This input type also typically disables browser autocomplete and copy functionality for enhanced security.

    Search

    Search input optimized for search queries with enhanced styling and potential search-specific browser features.

    Declaration
    public const InputType Search
    Field Value
    Type Description
    InputType

    Represents the "search" input type for search functionality.

    Remarks

    Search inputs may have special styling such as rounded corners and a search icon. Some browsers provide additional features like a clear button (X) to quickly empty the search field.

    Tel

    Telephone number input with specialized virtual keyboard layout and potential format validation for phone numbers.

    Declaration
    public const InputType Tel
    Field Value
    Type Description
    InputType

    Represents the "tel" input type for telephone number entry.

    Remarks

    This input type optimizes the virtual keyboard on mobile devices for phone number entry, typically displaying a numeric keypad with additional characters like + and * that are commonly used in phone numbers.

    Text

    Standard single-line text input accepting any alphanumeric characters and symbols without format restrictions.

    Declaration
    public const InputType Text
    Field Value
    Type Description
    InputType

    Represents the "text" input type for general text entry.

    Remarks

    This is the default input type that allows users to enter any combination of letters, numbers, and special characters. No specific format validation or input restrictions are applied.

    URL

    URL input with validation for proper web address format and optimized virtual keyboard for URL entry.

    Declaration
    public const InputType URL
    Field Value
    Type Description
    InputType

    Represents the "url" input type for web address entry.

    Remarks

    URL inputs provide format validation for web addresses and display an optimized virtual keyboard on mobile devices with easy access to common URL characters like forward slashes, dots, and the .com key.

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