Previous MAUI-Entry MAUI-SearchBar Next

.NET MAUI Editor Control

.NET MAUI Editor Control

In .NET MAUI, the Editor control is used to accept and edit multiple lines of text. It is distinct from the Entry control, which is limited to a single line.

πŸ“„ What is an Editor?

An Editor is a text input control that allows users to enter and edit multiple lines of text. It’s ideal for comments, descriptions, notes, or any scenario where longer text input is required.

πŸ”‘ Key Features

Multi-line Input: Unlike Entry, it supports line breaks and scrolling.

Text Wrapping: Automatically wraps text to fit within its bounds.

Keyboard Customization: Choose keyboard type (text, numeric, email, etc.).

Placeholder: Show hint text when empty.

Events: TextChanged, Completed, Focused, Unfocused for handling user actions.

Styling: Customize font, color, alignment, and background.

Data Binding: Bind Text property to ViewModel for MVVM patterns.

Scrolling Support: Built-in scrolling when text exceeds the visible area.

πŸ“˜ Example Code

Basic Editor

xml

<Editor Placeholder="Enter your comments here"
        AutoSize="TextChanges"
        Text="{Binding UserComments}"
        FontSize="16"
        TextColor="Black"/>

Styled Editor

xml

<Editor Placeholder="Write a description..."
        BackgroundColor="LightYellow"
        HeightRequest="150"
        TextColor="DarkGreen"
        FontAttributes="Italic"/>

βœ… Why Choose Editor?

Multi-line Support: Perfect for longer text input like notes or feedback.

Built-in Scrolling: Handles overflow text automatically.

Flexible Styling: Easily customized for different contexts.

MVVM Friendly: Works seamlessly with data binding.

πŸ“Œ Common Use Cases

Comments & Feedback Forms: Collect detailed user input.

Notes Apps: Allow users to write and edit notes.

Descriptions: Product descriptions, bio fields, or multi-line addresses.

Messaging Apps: Compose longer messages.

⚠️ Considerations

Not for Single-Line Input: Use Entry instead for short fields like username or password.

Validation Needed: Combine with validation logic for secure and correct input.

Performance: Efficient, but very large text blocks may need optimization.

✨ In short: The MAUI Editor is your go-to control for multi-line text input β€” perfect for comments, notes, and descriptions. It complements Entry by handling longer, scrollable text fields.

Key Features and Properties

Multi-line Support: Designed specifically for longer text input like notes or descriptions.

Auto-Sizing: The AutoSize property (EditorAutoSizeOption.TextChanges) allows the control to dynamically expand or shrink its height as the user types.

Text Constraints: Use MaxLength to limit character input and IsReadOnly to prevent editing while still allowing text selection.

Placeholder: Displays hint text via Placeholder and PlaceholderColor when the control is empty.

Keyboard & Prediction: Customize the soft keyboard type (Chat, Email, Numeric) and enable or disable spell checking and text prediction.

2026 Platform Updates (.NET 10)

As of .NET 10 (released late 2025), the Editor control includes several modern enhancements:

Selection Tracking (Android): The native view now uses MauiAppCompatEditText, fully supporting the SelectionChanged event.

New Bindable Properties: Developers can track selection changes using CursorPosition and SelectionLength.

Improved Quality: Focus on stability, bug reduction, and improved runtime performance through new XAML source generators.

Interactive Events

TextChanged: Fires on every keystroke, providing old and new text values.

Completed: Fires when the user finishes editing (typically when focus is lost, since the Return key inserts a new line).

For advanced text editing needs such as bold text, links, or rich formatting, developers typically rely on third-party Rich Text Editor controls (e.g., Telerik or Syncfusion), as the standard MAUI Editor does not support HTML or RTF formatting directly.

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-Entry MAUI-SearchBar Next
*