Sharpnado.Maui.Shadows 2.0.2

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

Sharpnado.Maui.Shadows

Add beautiful, customizable shadows to any .NET MAUI view across all platforms.

NuGet

Quick Start

1. Install

dotnet add package Sharpnado.Maui.Shadows

2. Initialize in MauiProgram.cs

using Sharpnado.Shades;

builder.UseSharpnadoShadows(loggerEnable: false);

3. Use in XAML

xmlns:sh="clr-namespace:Sharpnado.Shades;assembly=Sharpnado.Maui.Shadows"

<sh:Shadows CornerRadius="10"
            Shades="{sh:SingleShade BlurRadius=10, Opacity=0.5, Color=Black, Offset='0,5'}">
    <Button Text="Shadow Button" />
</sh:Shadows>

Features

✨ Multiple Shadows - Add as many shadows as needed per view
🎯 Full Control - Color, Opacity, BlurRadius, Offset, CornerRadius
âš¡ Hardware Accelerated - GPU rendering on all platforms
🔧 Android BlurType - Choose GPU or StackBlur rendering
🎨 Neumorphism - Built-in neumorphism support
💾 Memory Safe - Weak events, no memory leaks
📦 XAML Extensions - SingleShade, ImmutableShades, ShadeStack, NeumorphismShades

Platforms

Platform Min Version Implementation
Android API 21 RenderScript/RenderEffect + Caching
iOS 12.2 CALayer
MacCatalyst 15.0 CALayer
Windows 10.0.17763.0 WinUI 3 Composition API

Examples

Single Shadow

<sh:Shadows CornerRadius="20"
            Shades="{sh:SingleShade BlurRadius=15, Opacity=0.6, Color=Purple, Offset='0,10'}">
    <Image Source="photo.jpg" />
</sh:Shadows>

Multiple Shadows

<sh:Shadows CornerRadius="10">
    <sh:Shadows.Shades>
        <sh:ImmutableShades>
            <sh:Shade BlurRadius="10" Opacity="0.5" Offset="-10,-10" Color="White" />
            <sh:Shade BlurRadius="10" Opacity="0.5" Offset="10,10" Color="#19000000" />
        </sh:ImmutableShades>
    </sh:Shadows.Shades>
    <Frame BackgroundColor="#F0F0F3" CornerRadius="10">
        <Label Text="Neumorphism" />
    </Frame>
</sh:Shadows>

Neumorphism (Quick)

<sh:Shadows CornerRadius="20" Shades="{sh:NeumorphismShades}">
    <Button Text="Neumorphism" BackgroundColor="#F0F0F3" />
</sh:Shadows>

Android Blur Type

<sh:Shadows CornerRadius="10" 
            BlurType="Gpu"
            Shades="{sh:SingleShade BlurRadius=20, Opacity=0.7, Color=Black, Offset='0,8'}">
    <Image Source="background.jpg" />
</sh:Shadows>

BlurType options:

  • Gpu (default): Hardware-accelerated (RenderScript API<31, RenderEffect API≥31)
  • StackBlur: CPU-based fallback for compatibility

Performance Tips

Android

  • Use BlurType="Gpu" for best performance (default)
  • Shadows are globally cached by (color, size, blur)
  • Avoid animating BlurRadius, Color, or Opacity (creates new bitmaps)

iOS/MacCatalyst

  • Hardware-accelerated via CALayer
  • All properties are safely animatable

Windows

  • Hardware-accelerated via WinUI 3 Composition API
  • Lightweight SpriteVisual shadows

Migration from Xamarin.Forms

  1. Update package: Sharpnado.Shadows → Sharpnado.Maui.Shadows
  2. Update XAML assembly: assembly=Sharpnado.Shadows → assembly=Sharpnado.Maui.Shadows
  3. Update initialization: builder.UseSharpnadoShadows()
  4. Remove platform-specific initialization (no longer needed)

Migration time: ~10 minutes

Documentation

License

MIT License - © Jean-Marie Alfonsi

Support

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-android35.0 is compatible.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-ios18.0 is compatible.  net9.0-maccatalyst was computed.  net9.0-maccatalyst18.0 is compatible.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net9.0-windows10.0.19041 is compatible.  net10.0 was computed.  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
2.0.2 273 10/29/2025
2.0.1 137 10/25/2025
2.0.0 155 10/10/2025

Version 2.0.2 - Windows Content Margin Fix
     
     BUGFIX:
     * Fixed Windows (WinUI) platform: Content margin property is now properly applied
     * Handler now manually transfers MAUI margin to native platform view
     * Resolves issue where Border/Frame margins were ignored in WinUI Grid layout
     
     See documentation: https://github.com/roubachof/Sharpnado.Shadows