Previous MAUI-Label MAUI-Editor Next

.NET MAUI Entry Control

.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.

πŸ“„ What is an Entry?

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.

πŸ”‘ Key Features

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.

πŸ“˜ Example Code

Basic Entry

xml

<Entry Placeholder="Enter your name"
       Text="{Binding UserName}"
       FontSize="18"
       TextColor="Black"/>

Password Entry

xml

<Entry Placeholder="Password"
       IsPassword="True"
       Text="{Binding Password}"/>

Numeric Entry

xml

<Entry Placeholder="Enter age"
       Keyboard="Numeric"
       Text="{Binding Age}"/>

βœ… Why Choose Entry?

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.

πŸ“Œ Common Use Cases

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.

⚠️ Considerations

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.

Key Features and Properties

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.

Input Constraints

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.

Interactive Events

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).

2026 Platform Updates

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.

Here’s a quick comparison table of Label vs Entry vs Editor in .NET MAUI β€” a handy cheat sheet to decide which text control fits your scenario best:

βš–οΈ Label vs Entry vs Editor

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

βœ… Quick Decision Guide

Need to show text only? β†’ Use Label.

Need short, single-line input? β†’ Use Entry.

Need long, multi-line input? β†’ Use Editor.

✨ In short:

Label = display-only.

Entry = short input.

Editor = long input.

Back to Index
Previous MAUI-Label MAUI-Editor Next
*