Shirasagi0012.MaterialShapes
0.1.4
dotnet add package Shirasagi0012.MaterialShapes --version 0.1.4
NuGet\Install-Package Shirasagi0012.MaterialShapes -Version 0.1.4
<PackageReference Include="Shirasagi0012.MaterialShapes" Version="0.1.4" />
<PackageVersion Include="Shirasagi0012.MaterialShapes" Version="0.1.4" />
<PackageReference Include="Shirasagi0012.MaterialShapes" />
paket add Shirasagi0012.MaterialShapes --version 0.1.4
#r "nuget: Shirasagi0012.MaterialShapes, 0.1.4"
#:package Shirasagi0012.MaterialShapes@0.1.4
#addin nuget:?package=Shirasagi0012.MaterialShapes&version=0.1.4
#tool nuget:?package=Shirasagi0012.MaterialShapes&version=0.1.4
Material Shape for Avalonia
androidx\graphics\graphics-shapes ported to Avalonia.
This module is maintained in the Material3Expressive repository and referenced directly by its projects. Package versions and publishing are described in the root README.
Features
- Material 3 Expressive Shapes Access the complete set of predefined Material 3 shapes, or customize your own shapes.
- Shape Morphing Create smooth, high-performance animations that morph between any two arbitrary shapes.
- Avalonia Integration:
- Generate standard Avalonia Geometry objects for custom use.
- Use MaterialShapeView to render static shapes.
- Use MorphShapeView to implement morphing animations between two shapes.
Geometry conversion
RoundedPolygon.ToGeometry() and Morph.ToGeometry(progress) mirror androidx's
compose/material3/internal/ShapeUtil.kt, including its startAngle, repeatPath and
closePath parameters.
Two deviations, both deliberate:
startAngledefaults to0here, not270. Upstream'stoPathis internal and every caller re-centres the result, so its default is harmless there. On a public API a non-zero default would silently rotate — and, since the rotation is about the origin rather than the shape's centre, translate — every shape drawn through it. PassAvaloniaExtensions.StartAngleTopwhen porting material3 drawing code.- The rotation is applied about the origin, exactly as upstream does; the pivot only decides where the first anchor's angle is measured from.
Known limitations
MorphShapeViewbuilds a freshStreamGeometryfor everyProgresschange, i.e. once per frame while morphing. This is not an oversight: Avalonia 12'sStreamGeometryhas no rewind —_strokePathis readonly and re-Open()ing appends — so a geometry cannot be rebuilt in place. Avoiding the per-frame allocation means dropping to a custom draw operation with a reusedSKPath, which trades away the non-Skia backends.
Gallery
You can explore the capabilities and play with different Material Shapes by building and running the included Gallery App.
<img width="656" height="1035" alt="MaterialShape.Gallery Demo" src="https://github.com/user-attachments/assets/ea687ad3-3101-4d48-8ed7-ae572550dafd" />
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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. |
-
net10.0
- Avalonia (>= 12.1.5)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Shirasagi0012.MaterialShapes:
| Package | Downloads |
|---|---|
|
Shirasagi0012.Material3Expressive.Avalonia
Material 3 Expressive theme and controls for Avalonia, ported from Compose Material3. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.4 | 115 | 11/7/2026 |
| 0.1.3-alpha | 98 | 11/3/2026 |