GHSoftware.Avalonia.SpellChecker.Avalonia11 0.3.3

dotnet add package GHSoftware.Avalonia.SpellChecker.Avalonia11 --version 0.3.3
                    
NuGet\Install-Package GHSoftware.Avalonia.SpellChecker.Avalonia11 -Version 0.3.3
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="GHSoftware.Avalonia.SpellChecker.Avalonia11" Version="0.3.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="GHSoftware.Avalonia.SpellChecker.Avalonia11" Version="0.3.3" />
                    
Directory.Packages.props
<PackageReference Include="GHSoftware.Avalonia.SpellChecker.Avalonia11" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add GHSoftware.Avalonia.SpellChecker.Avalonia11 --version 0.3.3
                    
#r "nuget: GHSoftware.Avalonia.SpellChecker.Avalonia11, 0.3.3"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package GHSoftware.Avalonia.SpellChecker.Avalonia11@0.3.3
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=GHSoftware.Avalonia.SpellChecker.Avalonia11&version=0.3.3
                    
Install as a Cake Addin
#tool nuget:?package=GHSoftware.Avalonia.SpellChecker.Avalonia11&version=0.3.3
                    
Install as a Cake Tool

Avalonia Spell Checker

NuGet NuGet Avalonia 11

Avalonia Spell Checker adds Hunspell-based spell checking to Avalonia TextBox controls. It highlights misspelled words while the user types and adds spelling suggestions to the existing context menu without requiring a custom text input control.

<p float="left">

Spell checker demonstration Ignore word demonstration macOS screenshot

</p>

Features

  • Real-time spell checking for Avalonia TextBox.
  • Hunspell .aff and .dic dictionary support through WeCantSpell.Hunspell.
  • Multiple enabled languages at the same time.
  • Context menu suggestions for misspelled words.
  • Custom ignored words.
  • Automatic style registration when TextBoxSpellChecker.Initialize is called.
  • Included dictionaries for en_GB, es_MX, and pt_BR.

NuGet Packages

Use the package that matches your Avalonia major version:

Avalonia version Package Target frameworks
Avalonia 12.x GHSoftware.Avalonia.SpellChecker net8.0, net10.0
Avalonia 11.1+ GHSoftware.Avalonia.SpellChecker.Avalonia11 net6.0, net8.0, net10.0

Install the current Avalonia package:

dotnet add package GHSoftware.Avalonia.SpellChecker

Install the Avalonia 11 package:

dotnet add package GHSoftware.Avalonia.SpellChecker.Avalonia11

The two packages expose the same Avalonia.SpellChecker namespace and API. The separate package IDs keep NuGet dependency resolution explicit and avoid mixing Avalonia 11 and Avalonia 12 assets in the same package.

Usage

Create a TextBoxSpellChecker and initialize each TextBox that should be checked:

using Avalonia.Controls;
using Avalonia.SpellChecker;

public partial class MainWindow : Window
{
    private readonly TextBoxSpellChecker _spellChecker;

    public MainWindow()
    {
        InitializeComponent();

        _spellChecker = new TextBoxSpellChecker(
            SpellCheckerConfig.Create("pt_BR", "en_GB"));

        var textBox = this.FindControl<TextBox>("DescriptionTextBox");
        if (textBox is not null)
        {
            _spellChecker.Initialize(textBox);
        }
    }
}

By default, SpellCheckerConfig.Create(...) looks for dictionaries in:

<application output directory>/Dictionaries

The NuGet packages include the bundled dictionaries as content files and copy them to the output directory automatically.

After Initialize is called, the TextBoxSpellChecker starts checking the target TextBox as soon as its template is applied. Misspelled words are underlined, and suggestions are added to the context menu when the user right-clicks a misspelled word.

When the TextBox is detached from the logical tree, the spell checker removes its event handlers and clears its reference to that control.

Dictionaries

Hunspell dictionaries use a pair of files per language:

<language>.aff
<language>.dic

For example:

Dictionaries/pt_BR.aff
Dictionaries/pt_BR.dic

The bundled dictionaries are enough to start using the library. To add or replace dictionaries, use Hunspell-compatible files from maintained dictionary projects such as:

Then configure the folder explicitly if needed:

var config = SpellCheckerConfig.Create("en_GB");
config.DictionariesFolder = @"C:\path\to\Dictionaries";

Building Packages

The repository builds two NuGet packages: one for Avalonia 12 and one for Avalonia 11.

.\scripts\pack-all.ps1 -Configuration Release -Clean

To override the package version:

.\scripts\pack-all.ps1 -Configuration Release -Version 0.3.1 -Clean

Packages are written to:

artifacts/nuget

Current Limitations

  • Keyboard-triggered context menus do not currently show spelling suggestions because suggestions are resolved from a pointer position.
  • The included dictionaries are limited to en_GB, es_MX, and pt_BR.

Contributing

Issues and pull requests are welcome.

License

This project is licensed under the MIT License.

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.3.3 194 7/6/2026
0.3.2 111 7/6/2026
0.3.1 106 7/6/2026