Git Product home page Git Product logo

blazordialog's Introduction

Blazor Dialog

Build status Nuget (with prereleases) Nuget Donate

Dialog component as a service for Blazor!

demo-img

Features

  • Call a dialog procedurally as a service and await for the result !
  • Can use dialogs as normal components (if you don't want to use as a service).
  • Build-in modal dialog with optional helper components (Header, Body, Footer).
  • Option to use completely custom markup/css (without using the build-in opinionated css and html).

Samples / Demo

You can find code samples and demos here.

Installation

1. Add the nuget package in your Blazor project

> dotnet add package BlazorDialog

OR

PM> Install-Package BlazorDialog

Nuget package page can be found here.

2. Add the following line in your Blazor project in either Startup.cs (blazor server-side) or Program.cs (blazor wasm)

- Blazor server-side: Startup.cs

public class Startup
{
    public void ConfigureServices(IServiceCollection services)
    {
        // other code
        services.AddBlazorDialog();
        // other code
    }
}

- Blazor wasm: Program.cs

public class Program
{
    public static async Task Main(string[] args)
    {
       // other code
        builder.Services.AddBlazorDialog();
        // other code
    }
}

3. Add the following line in your _Imports.razor

@using BlazorDialog

4. Reference the css file

Add the following static file reference in your _Host.cshtml (server-side blazor) or in your index.html (client-side blazor). Make sure that there is a call to app.UseStaticFiles(); in your server project's Startup.cs.

<link href="_content/BlazorDialog/styles.min.css" rel="stylesheet" />

⚠️ Breaking changes ⚠️

Upgrading from 0.3 to 1.0
  • Removed PreventShow and PreventHide from OnBeforeShow and OnBeforeHide respectively. Too many cases where infinite loops could happen.

Release Notes

1.5
  • Added css class parameter to all helper components (header/body/footer).
1.4
  • Added css class parameter to dialog component.
1.3
  • Added base z-index parameter to dialog component.
1.2
  • Added fullscreen mode.
1.1
  • Added support for dialog-in-dialog.
1.0
  • Fixed an infinite loop bug with OnBeforeShow event.
  • Fixed css bugs.
  • Removed PreventShow and PreventHide from OnBeforeShow and OnBeforeHide respectively. Too many cases where infinite loops could happen.
0.3
  • Upgrated to 3.1.
  • Added new helper components: DialogHeader, DialogBody, DialogFooter
0.1
  • Initial release.

blazordialog's People

Contributors

stavroskasidis avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.