Blazor Host binding workaround

Suraj Yadav 1 Reputation point

Have a great day too all of you.
Blazor is been considered as replacement for JavaScript but when I looked into it, it doesn't have access to DOM elements. Biggest blocker in considering C# as front end language. I want my website to have smooth animations on it and if I use blazor to create cool websites, I end up using lots of calls between C# and JavaScript, making it too slow and unnecessarily complex and it feels like plain mvc on the server side outputting json and only plain JavaScript on a client side would be simple.
Do we have some library or project examples somewhere which will teach me how to create simple websites with cool animations using blazor? (Just using blazor and plain JavaScript without any library would be my ideal choice.)
It would be of great help to me and other less experienced newbies.
Approach for animations of individual tag elements in a web page and still keep sanity of blazor lifecycle.

A set of technologies in the .NET Framework for building web applications and XML web services.
4,146 questions
A free and open-source web framework that enables developers to create web apps using C# and HTML being developed by Microsoft.
1,380 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Rena Ni - MSFT 2,061 Reputation points

    Hi @Suraj Yadav ,

    I think you could use Blazor.Animate library.

    1.Add NuGet

    Install-Package BlazorAnimate -Version 3.0.0


    2.Configure _Imports.razor

    @using BlazorAnimate  

    3.Add JS interop into _Host.cshtml


    4.Use the Animate-component,here I use ZoomIn animation,for other animations you could read the docs

    <Animate Animation="Animations.ZoomIn" Duration="TimeSpan.FromSeconds(1)">  

    For more details,please read the following docs:

    If the answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Best Regards,


    0 comments No comments