| MAUI-Label | MAUI-Editor | |
.NET MAUI Entry Control |
In .NET MAUI, the Entry control is used for entering and editing a single line of text. It is the standard control for collecting discrete pieces of information such as usernames, passwords, or search queries.
An Entry is a text input control that lets users type and edit a single line of text. Itβs commonly used for forms, login fields, and search boxes.
Text Input: Accepts single-line text.
Keyboard Customization: Choose keyboard type (numeric, email, text, etc.).
Placeholder: Show hint text when empty.
Password Mode: Hide characters for secure input.
Text Prediction & Spell Check: Enable/disable depending on context.
Events: Completed, TextChanged, Focused, Unfocused for handling user actions.
Styling: Customize font, color, alignment, borders.
Data Binding: Bind Text property to ViewModel for MVVM patterns.
xml
<Entry Placeholder="Enter your name"
Text="{Binding UserName}"
FontSize="18"
TextColor="Black"/>
xml
<Entry Placeholder="Password"
IsPassword="True"
Text="{Binding Password}"/>
xml
<Entry Placeholder="Enter age"
Keyboard="Numeric"
Text="{Binding Age}"/>
Essential for Forms: Perfect for login, registration, and input fields.
Customizable: Keyboard types, password mode, and styling make it versatile.
Lightweight: Simple and efficient for single-line input.
MVVM Friendly: Works seamlessly with data binding.
Login Forms: Username and password fields.
Search Bars: Quick text input for queries.
Numeric Input: Age, quantity, or phone number.
Data Entry Forms: Collect user information like email, address, etc.
Single-Line Only: For multi-line input, use Editor.
Validation Needed: Combine with validation logic for secure and correct input.
Accessibility: Ensure placeholder text is clear and semantic properties are set.
β¨ In short: The MAUI Entry is your standard single-line text input control β lightweight, customizable, and perfect for forms, login fields, and quick user input.
Password Support: Setting the IsPassword property to true visually obscures typed text for security.
Keyboard Customization: The Keyboard property allows you to specify which soft keyboard appears (e.g., Numeric, Email, Telephone, or Url) to match the expected input type.
Placeholder Text: Use the Placeholder and PlaceholderColor properties to display hint text when the control is empty.
Clear Button: The ClearButtonVisibility property can show a button (typically an "X") that allows users to clear all text with a single tap.
MaxLength: Restricts the number of characters a user can enter.
IsReadOnly: Prevents the user from modifying the text while still allowing them to select and copy it.
Text Transformation: The TextTransform property can automatically force text to Uppercase or Lowercase.
TextChanged: Raised every time the text in the entry changes, providing both the old and new values.
Completed: Raised when the user finishes entering text (e.g., by pressing the "Return" or "Done" key on the keyboard).
As of .NET 10 (released late 2025), the Entry control on Android has been updated to use MauiAppCompatEditText, which enables improved tracking for selection changes through the CursorPosition and SelectionLength properties.
For more advanced scenarios, such as entering multi-line text, developers should use the Editor control instead. For specialized input like phone numbers or formatted codes, third-party libraries like Syncfusion offer Masked Entry controls.
| Control | Purpose | Input Type | Key Features | Best Use Cases |
|---|---|---|---|---|
| Label | Display text only | β No input |
- Read-only text - Supports FormattedString for rich text - Lightweight and fast |
Titles, headings, instructions, dynamic data display |
| Entry | Single-line text input | β Yes (single line) |
- Placeholder support - Password mode - Keyboard customization - Events (Completed, TextChanged) |
Login forms, search bars, short fields (username, email, phone) |
| Editor | Multi-line text input | β Yes (multi-line) |
- Text wrapping - Built-in scrolling - Placeholder support - Events (TextChanged, Focused) |
Comments, feedback forms, notes, descriptions, messaging apps |
Need to show text only? β Use Label.
Need short, single-line input? β Use Entry.
Need long, multi-line input? β Use Editor.
Label = display-only.
Entry = short input.
Editor = long input.
| MAUI-Label | MAUI-Editor | |