Learn Performing Animation in .NET MAUI: Part 1 | Syncfusion Blogs
Live Chat Icon For mobile
Live Chat Icon
Popular Categories.NET  (180).NET Core  (28).NET MAUI  (226)Angular  (113)ASP.NET  (49)ASP.NET Core  (81)ASP.NET MVC  (87)Azure  (41)Black Friday Deal  (1)Blazor  (235)BoldSign  (14)DocIO  (24)Essential JS 2  (110)Essential Studio  (199)File Formats  (72)Flutter  (136)JavaScript  (226)Microsoft  (121)PDF  (83)Python  (1)React  (105)Streamlit  (1)Succinctly series  (131)Syncfusion  (963)TypeScript  (33)Uno Platform  (3)UWP  (3)Vue  (46)Webinar  (53)Windows Forms  (59)WinUI  (72)WPF  (163)Xamarin  (159)XlsIO  (38)Other CategoriesBarcode  (5)BI  (29)Bold BI  (8)Bold Reports  (2)Build conference  (10)Business intelligence  (55)Button  (4)C#  (164)Chart  (146)Chart of the week  (58)Cloud  (15)Company  (440)Dashboard  (8)Data Science  (3)Data Validation  (8)DataGrid  (73)Development  (678)Doc  (7)DockingManager  (1)eBook  (99)Enterprise  (22)Entity Framework  (7)Essential Tools  (13)Excel  (43)Extensions  (23)File Manager  (7)Gantt  (21)Gauge  (12)Git  (5)Grid  (31)HTML  (13)Installer  (2)Knockout  (2)Language  (1)LINQPad  (1)Linux  (2)M-Commerce  (1)Metro Studio  (11)Mobile  (522)Mobile MVC  (9)OLAP server  (2)Open source  (1)Orubase  (12)Partners  (21)PDF viewer  (45)Performance  (13)PHP  (2)PivotGrid  (5)Predictive Analytics  (6)Report Server  (3)Reporting  (8)Reporting / Back Office  (9)Rich Text Editor  (12)Road Map  (12)Scheduler  (54)Security  (5)SfDataGrid  (9)Silverlight  (21)Sneak Peek  (32)Solution Services  (4)Spreadsheet  (11)SQL  (15)Stock Chart  (1)Surface  (4)Tablets  (5)Theme  (12)Tips and Tricks  (113)UI  (404)Uncategorized  (68)Unix  (2)User interface  (68)Visual State Manager  (2)Visual Studio  (31)Visual Studio Code  (19)Web  (626)What's new  (339)Windows 8  (19)Windows App  (2)Windows Phone  (15)Windows Phone 7  (9)WinRT  (26)
Learn Performing Animation in .NET MAUI Part 1

Learn Performing Animation in .NET MAUI: Part 1

According to Wikipedia, “Animation is a method in which figures are manipulated to appear as moving objects.” Animation in an app is essential to provide an appealing UI and better responsiveness. A cross-platform application like a .NET Multi-platform App UI (.NET MAUI) app also needs animation to make it more attractive.

Two kinds of animation can be applied in .NET MAUI:

  • Basic animations
  • Lottie animations

In this blog, let’s take a quick look at these animation methods.

.NET MAUI basic animation

As stated in the Microsoft documentation, “The .NET Multi-platform App UI (.NET MAUI) animation classes target different properties of visual elements, with a typical basic animation progressively changing a property from one value to another over a period of time.”

Built-in animations

There are four basic built-in animations available in .NET MAUI:

  • Fade
  • Rotation
  • Scale
  • Translate


Fade animation can fade in and fade out a view by changing the opacity. Refer to the following code example.

this.fadeInImage.Opacity = 0;

//Fade in
await this.fadeInImage.FadeTo(1, 2000);

//Fade out
await this.fadeInImage.FadeTo(0, 2000);


Rotate a view using the Rotate support. You can use general, vertical, horizontal, or relative rotation.

Refer to the following code example.

this.rotateImage.Rotation = 0;

// General rotation
await this.rotateImage.RotateTo(360, 2000);

// Vertical rotation
await this.rotateImage.RotateXTo(360 , 2000);

// Horizontal rotation
await this.rotateImage.RotateYTo(360, 2000);

Note: We can also rotate horizontally, vertically, and relatively using the RotateXTo, RotateYTo, and RelRotateTo APIs, respectively.


We can scale a view using the Scale property. There are four types of scaling: vertical, horizontal, aspect, and relative.

Refer to the following code example.

// Zoom in
await this.scaleImage.ScaleTo(1, 2000);

// Zoom out
await this.scaleImage.ScaleTo(0, 2000);

// Horizontal scaling
await this.scaleImage.ScaleXTo(1, 2000);
await this.scaleImage.ScaleXTo(0, 2000);

// Vertical scaling
await this.scaleImage.ScaleYTo(1, 2000);
await this.scaleImage.ScaleYTo(0, 2000);

Note: We can also scale horizontally, vertically, and relatively using the ScaleXTo, SacleYTo, and RelScaleTo APIs, respectively.


We can translate a view to another location with an animation. Refer to the following code example.

// Translate to right
await this.translateImage.TranslateTo(50, 0, 1000);

// Translate to bottom
await this.translateImage.TranslateTo(0, 50, 1000);

// Translate to left
await this.translateImage.TranslateTo(-50, 0, 1000);

// Translate to top
await this.translateImage.TranslateTo(0, -50, 1000);

// Diagonal translation
await this.translateImage.TranslateTo(50, 50, 1000);

Note: You can also create these animations with easing functions.

Lottie animation

Lottie animations are free, open-source packages that can be used in your .NET MAUI apps. They animate elements using a JSON file that contains the content for the animation. There are a lot of options available in Lottie animation.

Follow these steps to add Lottie animation to a .NET MAUI application.

Step 1: First, create a .NET MAUI application.

Step 2: Right-click on the project and select Manage NuGet Packages. Browse for SkiaSharp.Extended.UI.Maui and install the package.

Step 3: Then, open the MauiProgram.cs file and configure the SkiaShap like in the following code.

using SkiaSharp.Views.Maui.Controls.Hosting;

Step 4: Go to the MainPage.xaml and add the SkiaSharp namespace. Refer to the following code.

<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"

Step 5: Finally, add SkLottieView with the options RepeatCount, Repeat Mode, and Source.

Note: Refer to the LottieFiles for a list of JSON files that can be used to add animation to your app. After preparing the JSON file, add it to Resource-> Raw Folder.

Refer to the following code example.

<skia:SKLottieView RepeatCount="-1"
.NET MAUI Animations
.NET MAUI Animations


Thanks for reading! I hope you are now aware of how to add animations to your .NET MAUI application. In part two of this blog, we’ll look at custom animation in .NET MAUI!

Syncfusion .NET MAUI controls were built from scratch using .NET MAUI, so they feel like framework controls. They are fine-tuned to work with a huge volume of data. Use them to build your cross-platform mobile and desktop apps!

For current customers, the new Essential Studio version is available for download from the License and Downloads page. If you are not yet a Syncfusion customer, you can always download our free evaluation to see all our controls in action.

For questions, you can contact us through our support forumsupport portal, or feedback portal. We are always happy to assist you!

Test Flight
App Center Badge
Google Play Store Badge
Microsoft Badge
Github Store Badge

Related blogs


Share this post:

Popular Now

Be the first to get updates

Subscribe RSS feed

Be the first to get updates

Subscribe RSS feed