Blazored.Modal 1.0.3

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Blazored.Modal --version 1.0.3                
NuGet\Install-Package Blazored.Modal -Version 1.0.3                
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="Blazored.Modal" Version="1.0.3" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Blazored.Modal --version 1.0.3                
#r "nuget: Blazored.Modal, 1.0.3"                
#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.
// Install Blazored.Modal as a Cake Addin
#addin nuget:?package=Blazored.Modal&version=1.0.3

// Install Blazored.Modal as a Cake Tool
#tool nuget:?package=Blazored.Modal&version=1.0.3                

Blazored Modal

This is a JavaScript free modal implementation for Blazor and Razor Components applications.

Getting Setup

You can install the package via the nuget package manager just search for Blazored.Modal. You can also install via powershell using the following command.

Install-Package Blazored.Modal

Or via the dotnet CLI.

dotnet add package Blazored.Modal

1. Register Services

First, you will need to add the following line to your applications Startup.ConfigureServices method.

public void ConfigureServices(IServiceCollection services)
{
    services.AddBlazoredModal();
}

2. Add Imports

Second, add the following to your _ViewImports.cshtml

@using Blazored
@using Blazored.Modal.Services

@addTagHelper *, Blazored.Modal

3. Add Modal Component

Third and finally, you will need to add the <BlazoredModal /> component in your applications MainLayout.cshtml.

Usage

In order to show the modal, you have to inject the IModalService into the component or service you want to invoke the modal. You can then call the Show method passing in the title for the modal and the type of the component you want the modal to display.

For example, say I have a component called Movies which I want to display in the modal and I want to call it from the Index component on a button click.

@page "/"
@inject IModalService Modal

<h1>Hello, world!</h1>

Welcome to Blazored Modal.

<button onclick="@(() => Modal.Show("My Movies", typeof(Movies)))" class="btn btn-primary">View Movies</button>

If you need to know when the modal has closed, for example to trigger an update of data. The modal service exposes a OnClose event which you can attach to.

@page "/"
@inject IModalService Modal

<h1>Hello, world!</h1>

Welcome to Blazored Modal.

<button onclick="@ShowModal" class="btn btn-primary">View Movies</button>

@functions {

    void ShowModal()
    {
        Modal.OnClose += ModalClosed;
        Modal.Show("My Movies", typeof(Movies));
    }

    void ModalClosed()
    {
        Console.WriteLine("Modal has closed");
        Modal.OnClose -= ModalClosed;
    }

}
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (16)

Showing the top 5 NuGet packages that depend on Blazored.Modal:

Package Downloads
Lookif.UI.Component

Some predefined components. It contains: *Crud page *Form *Dropdown - Selective *Grid ---- Blazored.Modal and Blazored.Toast are used in this project.

chd.UI.Base.Contracts

Package Description

Cosmos.Common.AspNetCore.Blazor

Cosmos (Corporate Software Modular System) Blazor component library.

Jakar.Extensions.Blazor

Extensions to aid in development.

ElsaDashboard.Application

Elsa is a set of workflow libraries and tools that enable lean and mean workflowing capabilities in any .NET Core application. This package provides a dashboard application using Blazor.

GitHub repositories (5)

Showing the top 5 popular GitHub repositories that depend on Blazored.Modal:

Repository Stars
aws/aws-lambda-dotnet
Libraries, samples and tools to help .NET Core developers develop AWS Lambda functions.
MUnique/OpenMU
This project aims to create an easy to use, extendable and customizable server for a MMORPG called "MU Online".
hamed-shirbandi/TaskoMask
Task management system based on .NET 8 with Microservices, DDD, CQRS, Event Sourcing and Testing Concepts
Jcparkyn/nodexr
Graphical regular expression editor
melihercan/WebRTCme
A cross-platform framework for adding WebRTC support to .NET MAUI, Blazor, and Desktop applications by using a single unified .NET/C# API.
Version Downloads Last updated
7.3.1 164,612 2/20/2024
7.3.0 1,683 2/20/2024
7.2.0 42,395 1/18/2024
7.1.0 523,279 10/14/2022
7.0.0 46,097 9/17/2022
7.0.0-preiew.4 646 8/15/2022
7.0.0-preiew.3 853 7/14/2022
7.0.0-preiew.2 11,799 3/28/2022
7.0.0-preiew.1 938 3/9/2022
6.0.1 1,008,065 1/16/2021
6.0.0 16,784 1/4/2021
5.1.0 132,175 9/17/2020
5.0.3 29,774 8/5/2020
5.0.2 9,207 7/20/2020
5.0.1 4,488 7/13/2020
5.0.0 1,488 7/13/2020
4.1.0 106,454 4/6/2020
4.0.0 20,109 3/13/2020
3.1.2 22,343 2/13/2020
3.1.1 2,715 2/10/2020
3.1.0 19,166 1/19/2020
3.0.0 25,213 12/6/2019
2.3.0 13,696 10/11/2019
2.2.0 1,642 10/7/2019
2.1.1 7,732 9/25/2019
2.1.0 900 9/17/2019
2.0.7 941 9/5/2019
2.0.6 1,038 8/13/2019
2.0.5 671 7/25/2019
2.0.4 348 7/25/2019
2.0.3 367 7/24/2019
2.0.2 668 6/13/2019
2.0.1 1,270 6/1/2019
2.0.0 1,380 5/3/2019
1.1.3 1,340 3/9/2019
1.1.2 1,304 2/13/2019
1.1.1 1,292 2/9/2019
1.1.0 1,252 2/2/2019
1.0.3 1,290 2/1/2019
1.0.2 1,269 2/1/2019
1.0.1 1,255 2/1/2019
1.0.0 1,818 1/31/2019