Overview
The AI-powered .NET MAUI Text Editor is a multiline editor enhanced with AI-assisted sentence autocompletion. It can display suggestions inline over the text or in an unintrusive pop-up, reducing typing effort and improving productivity.

.NET MAUI Smart Text Editor code example
Easily get started with the .NET MAUI Smart Text Editor by using a few lines of XAML and C# code. Register an AI inference service to enable intelligent suggestions or provide user phrases for offline fallback.
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:smarttexteditor="clr-namespace:Syncfusion.Maui.SmartComponents;assembly=Syncfusion.Maui.SmartComponents"
x:Class="YourApp.MainPage">
<Grid Padding="16">
<smarttexteditor:SfSmartTextEditor
x:Name="SmartEditor"
Placeholder="Type your message..."
UserRole="Employee communicating with internal team"
MaxLength="500"
SuggestionDisplayMode="Popup"
SuggestionTextColor="#611c1b1f"
PlaceholderColor="#49454F">
<smarttexteditor:SfSmartTextEditor.TextStyle>
<smarttexteditor:SmartTextEditorStyle
FontSize="14"
TextColor="#1C1B1F"
FontFamily="OpenSansRegular"
FontAttributes="None"
FontAutoScalingEnabled="False" />
</smarttexteditor:SfSmartTextEditor.TextStyle>
</smarttexteditor:SfSmartTextEditor>
</Grid>
</ContentPage>public partial class MainPage : ContentPage
{
public MainPage()
{
InitializeComponent();
SmartEditor.UserPhrases = new List<string>
{
"Please find the attached report.",
"Let's schedule a meeting to discuss this further.",
"Can you provide an update on this task?",
"I appreciate your prompt response.",
"Let's collaborate to ensure timely delivery."
};
SmartEditor.TextChanged += (s, e) =>
{
// React to text changes if needed
};
}
}Intelligent autocomplete
The AI-powered Text Editor goes beyond simple word suggestions by predicting full sentences based on user input. This AI-driven autocomplete reduces typing time with precise, context-aware suggestions. Suggestions are generated for the active line and appear only when a caret is at the end of the text and the maximum length limit has not been exceeded. When no AI suggestion is available, it gracefully falls back to set user phrases to maintain a smooth input experience.
User role
Guide the tone and context of AI suggestions by setting the user role. Examples:
- Customer service agent responding to client inquiries.
- Project manager writing a status update.
- Developer replying to GitHub issues.
User phrases
User phrases let you seed the editor with predefined expressions that reflect frequently used content. These are used as a fallback when the AI has no suggestion, and to provide quick completions for frequently used sentences.
For example:
- “Thank you for contacting us.”
- “Please let me know if you have any further questions.”
Suggestion display modes
The AI-powered Text Editor supports two display modes for showing completions as you type:

Inline suggestion mode
Display suggestions inline.

Pop-up suggestion mode
Display suggestions in the pop-up window.
Keyboard and touch interactions
To accept a suggestion, you can use the Tab key or the right arrow key. On touch devices, simply tap the suggestion to insert it. Note that on Android and iOS, accepting inline suggestions using Tab or the right arrow key is not supported when using platform keyboards.
Customization
You can enhance the appearance of the AI-powered Text Editor by allowing customization of its visual elements. This includes options to adjust text styling such as font size, font family, and attributes, along with autoscaling for better readability. Users can also personalize text color for both inline and pop-up suggestions, modify placeholder text color, and style the background of suggestion pop-ups to match their preferred theme or branding.
