Simple.Toast 1.1.0

dotnet add package Simple.Toast --version 1.1.0
                    
NuGet\Install-Package Simple.Toast -Version 1.1.0
                    
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="Simple.Toast" Version="1.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Simple.Toast" Version="1.1.0" />
                    
Directory.Packages.props
<PackageReference Include="Simple.Toast" />
                    
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 Simple.Toast --version 1.1.0
                    
#r "nuget: Simple.Toast, 1.1.0"
                    
#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 Simple.Toast@1.1.0
                    
#: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=Simple.Toast&version=1.1.0
                    
Install as a Cake Addin
#tool nuget:?package=Simple.Toast&version=1.1.0
                    
Install as a Cake Tool

Table of contents

  1. Quick start
  2. Features and limitations
  3. Examples
  4. Changes

Quick start

  1. Download package NuGet Stable
  2. Register simple xml namespace in page:
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             ...
             xmlns:simple="clr-namespace:Simple.Toast;assembly=Simple.Toast"> 
  1. Add toast component to top-level page container:
    <Grid RowDefinitions="*"
          ColumnDefinitions="*">
                    
        <simple:Toast DismissDelay="2000" 
                      ToastBackgroundColor="#2E7D32" 
                      CornerRadius="12"
                      ToastPadding="16,12"
                      ProgressBarColor="#81C784"
                      Show="{Binding Show}" 
                      Dismiss="{Binding Dismiss}"
                      ToastDirection="LeftToRight"
                      VerticalOptions="Start"
                      HorizontalOptions="Center"
                      ProgressBarDirection="Center"
                      ZIndex="5">
            <simple:Toast.InnerContent> 
                <Label Text="✓ Operation completed successfully!"
                       TextColor="White"
                       FontSize="16"
                       FontAttributes="Bold"
                       HorizontalTextAlignment="Center"
                       VerticalTextAlignment="Center" />
            </simple:Toast.InnerContent>
        </simple:Toast>
    
    </Grid>
  1. Add observable properties and bind them to Show and Dismiss toast properties:
public partial class MainPageVM : ObservableObject
{  
    [ObservableProperty]
    private bool _show = false;

    [ObservableProperty]
    private bool _dismiss = false;

    //...
}
  1. Show configured toast or dismiss it in viewmodel:
public partial class MainPageVM : ObservableObject
{  
    //...observable properties definitions...
   
    [RelayCommand]
    public void ShowNotification()
    {
        Show = true;
    }

    [RelayCommand]
    public void CancelNotification()
    {
        Dismiss = true;
    }

    //...
}

Features and limitations

Properties

Show

Show property must be bound with TwoWay binding mode. This behavior is enabled by default. Any other binding modes would cause bugs. Consider not changing Show binding mode.

  • Show property automatically resets to false value when changed to true. Thus, one may use Show = true to show toast multiple times.
  • Setting Show = true multiple times resets running toast animations.

Dismiss

Dismiss property must be bound with TwoWay binding mode. This behavior is enabled by default. Any other binding modes would cause bugs. Consider not changing Dismiss binding mode.

  • Dismiss property is similar to Show: setting Dismiss = true hides toast; it automatically resets to false when set to true; one may use Dismiss = true multiple times.

ToastDirection

ToastDirection property supports 4 toast appearance directions:

  • TopToDown (default)
  • LeftToRight
  • DownToTop
  • RightToLeft

Important side-effect of setting ToastDirection value is that when TopToDown and DownToTop values are set, VerticalOptions property is ignored, as well as LeftToRight or RightToLeft cause HorizontalOptions value to be ignored.

IsProgressBarEnabled

Boolean property, that enables or disables toast dismiss progress bar visibility.

DismissDelay

Integer property, toast dismiss delay in milliseconds.

ProgressBarDirection

ProgressBarDirection is a enum property, supporting following 3 values:

  • Center (default)
  • Left
  • Right

This property is used to specify progress bar move direction.

Examples

<figure> <img src="Assets/defaultToast.jpg" alt="Default toast image"> <figcaption>Default toast</figcaption> </figure>

<simple:Toast DismissDelay="2000" 
              ToastBackgroundColor="#2E7D32" 
              CornerRadius="12"
              ToastPadding="16,12"
              ProgressBarColor="#81C784"
              Show="{Binding Show}" 
              Dismiss="{Binding Dismiss}"
              ToastDirection="LeftToRight"
              VerticalOptions="Start"
              HorizontalOptions="Center"
              ZIndex="5">
    <simple:Toast.InnerContent> 
        <Label Text="✓ Operation completed successfully!"
                TextColor="White"
                FontSize="16"
                FontAttributes="Bold"
                HorizontalTextAlignment="Center"
                VerticalTextAlignment="Center" />
    </simple:Toast.InnerContent>
</simple:Toast>

<figure> <img src="Assets/progressBarHidden.jpg" alt="Progress bar hidden"> <figcaption>Progress bar hidden</figcaption> </figure>

<simple:Toast DismissDelay="15000" 
              ToastBackgroundColor="#2E7D32" 
              CornerRadius="12"
              ToastPadding="16,12"
              ProgressBarColor="#81C784"
              Show="{Binding Show}" 
              Dismiss="{Binding Dismiss}"
              ToastDirection="DownToTop"
              VerticalOptions="Start"
              HorizontalOptions="Center"
              IsProgressBarEnabled="False"
              ZIndex="5">
    <simple:Toast.InnerContent> 
        <Label Text="✓ Operation completed successfully!"
               TextColor="White"
               FontSize="16"
               FontAttributes="Bold"
               HorizontalTextAlignment="Center"
               VerticalTextAlignment="Center" />
    </simple:Toast.InnerContent>
</simple:Toast>

<figure> <img src="Assets/complexToastDesign.jpg" alt="Complex toast design"> <figcaption>Complex toast design</figcaption> </figure>

<simple:Toast DismissDelay="8000" 
              ToastBackgroundColor="#C62828" 
              CornerRadius="12"
              ToastPadding="16,12"
              ProgressBarColor="#FFAB91"
              Show="{Binding Show}" 
              Dismiss="{Binding Dismiss}"
              ToastDirection="DownToTop"
              VerticalOptions="Start"
              HorizontalOptions="Center"
              IsProgressBarEnabled="True"
              ZIndex="5">
    <simple:Toast.InnerContent>
        <StackLayout Spacing="10">
            <BoxView BackgroundColor="#FFCCBC" 
                     HeightRequest="2" 
                     WidthRequest="40" 
                     HorizontalOptions="Center" />
            <Label Text="⚠️ Operation failed"
                   TextColor="#FFCCBC"
                   FontSize="16"
                   FontAttributes="Bold"
                   HorizontalTextAlignment="Center"
                   VerticalTextAlignment="Center" />
            <Label Text="Please check your internet connection and try again later"
                   TextColor="White"
                   FontSize="14"
                   HorizontalTextAlignment="Center"
                   LineBreakMode="WordWrap" />
            <BoxView BackgroundColor="#FFCCBC" 
                     HeightRequest="1" 
                     WidthRequest="60" 
                     HorizontalOptions="Center" />
        </StackLayout>
    </simple:Toast.InnerContent>
</simple:Toast>

Changes

version 1.1.0

  • ProgressBarDirection property was added.
  • Updated documentation.
Product Compatible and additional computed target framework versions.
.NET net9.0-android35.0 is compatible.  net9.0-ios18.0 is compatible.  net9.0-maccatalyst18.0 is compatible.  net9.0-windows10.0.19041 is compatible.  net10.0-android was computed.  net10.0-ios was computed.  net10.0-maccatalyst 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
1.1.0 81 4/30/2026
1.0.0 88 4/26/2026