RazorKit.SweetAlert2¶
RazorKit.SweetAlert2 is a lightweight and intuitive library that allows developers to create and configure beautiful SweetAlert2 alerts directly in Razor views using a fluent builder style. Simplify the process of creating highly customizable and interactive alerts in your ASP.NET MVC projects!
Features¶
- Fluent Builder API: Easily chain methods to configure alerts with minimal code.
- SweetAlert2 Integration: Supports the full range of SweetAlert2 features, including icons, animations, input fields, and more.
- HTML Helper Support: Seamlessly integrate with Razor views using the Html helper.
- Dynamic Attributes: Add custom input attributes, animations, and styling effortlessly.
- Clean and Readable Code: Focus on functionality without sacrificing code readability.
Setup¶
Install the NuGet package:
Or via the NuGet Package Manager:Add needed script and style links to layout: Reference:
Usage¶
It is easy to implement with html helper: