https://github.com/nich2408/blazor.simplemodal
Blazor class library for modal display and interaction with simplicity in mind.
https://github.com/nich2408/blazor.simplemodal
blazor library modal nuget
Last synced: 11 months ago
JSON representation
Blazor class library for modal display and interaction with simplicity in mind.
- Host: GitHub
- URL: https://github.com/nich2408/blazor.simplemodal
- Owner: nich2408
- License: mit
- Created: 2024-05-16T15:49:11.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-05-24T14:29:51.000Z (about 2 years ago)
- Last Synced: 2025-01-25T09:26:49.794Z (over 1 year ago)
- Topics: blazor, library, modal, nuget
- Language: HTML
- Homepage:
- Size: 113 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

# 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`
```html
```
> :warning: If you are already using boostrap JS script in your project, you can skip adding ``
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
```razor
@using Blazor.SimpleModal
Place here the content!
@code {
// Use this field for holding a reference to the modal.
private SimpleModal mySimpleModal;
// code omitted for brevity
[...]
}
```
### Displaying the modal
```csharp
bool confirmed = await mySimpleModal.ShowAsync();
```
or
```csharp
await mySimpleModal.ShowAsync();
```
Screenshot:

## 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
- Bootstrap modals: https://getbootstrap.com/docs/5.3/components/modal/