nich2408.Blazor.SimpleModal 1.0.0

dotnet add package nich2408.Blazor.SimpleModal --version 1.0.0
NuGet\Install-Package nich2408.Blazor.SimpleModal -Version 1.0.0
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="nich2408.Blazor.SimpleModal" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add nich2408.Blazor.SimpleModal --version 1.0.0
#r "nuget: nich2408.Blazor.SimpleModal, 1.0.0"
#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 nich2408.Blazor.SimpleModal as a Cake Addin
#addin nuget:?package=nich2408.Blazor.SimpleModal&version=1.0.0

// Install nich2408.Blazor.SimpleModal as a Cake Tool
#tool nuget:?package=nich2408.Blazor.SimpleModal&version=1.0.0

image

Blazor.SimpleModal

Blazor class library for modal display and interaction with simplicity in mind.

Getting started

Add the package

Install the package in your project with the dotnet CLI:

dotnet add package nich2408.Blazor.SimpleModal

or with the Package Manager Console: Install-Package nich2408.Blazor.SimpleModal

Add script tags

Add these script tags in your App.razor or index.html

<script src="_content/nich2408.Blazor.SimpleModal/modals.js" type="module"></script>
<script src="_content/nich2408.Blazor.SimpleModal/bootstrap-5.1.3.min.js"></script>

⚠️ If you are already using boostrap JS script in your project, you can skip adding <script src="_content/nich2408.Blazor.SimpleModal/bootstrap-5.1.3.min.js"></script>

Be sure to clean and rebuild the project if you are using Visual Studio and also clean the browser cache if the files are not appearing as sources.

Usage

Declaring a modal

Example.razor

@using Blazor.SimpleModal

<SimpleModal
  @ref="mySimpleModal"
  Title="This is the title"
  EnableConfirmButton="true"
  EnableDismissButton="true"
  DismissOnOutsideClick="true"
  DismissOnEscapeKey="true">
    Place here the content!
</SimpleModal>

@code {
  // Use this field for holding a reference to the modal.
  private SimpleModal mySimpleModal;

  // code omitted for brevity
  [...]
}

Displaying the modal

bool confirmed = await mySimpleModal.ShowAsync();

or

await mySimpleModal.ShowAsync();

Screenshot:

image

Additional documentation

You can change the style of modal including custom buttons CSS classes and texts by changing the related properties of the SimpleModal component.

Feedback

If you want to leave feedback (bugs or discussion) you can open an issue.

Contributing

Currently the project is not planned to be opened to contribution inside this repository.

Credits

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.0 82 5/24/2024