An open API service indexing awesome lists of open source software.

https://github.com/skordesign/Blazor.GuidePopup

Guidelines popup for Blazor
https://github.com/skordesign/Blazor.GuidePopup

asp-net-core blazor csharp dotnet microsoft netcore razor web-assembly webassembly

Last synced: 11 months ago
JSON representation

Guidelines popup for Blazor

Awesome Lists containing this project

README

          

# Polarizelab.Blazor.GuidePopup
Guidelines popup for Blazor
### Usage
#### 1.Installation
Nuget: [Blazor.GuidePopup](https://www.nuget.org/packages/Polarizelab.Blazor.GuidePopup)
#### 2.Add service
```csharp
builder.Services.AddGuider();
// also use with options
// builder.Services.AddGuider(options => {
// options.PopupClassName = "your-class";
///...
//})
```
and in index.html
```html
...

...

...

...
```

#### 3.Inject service and use it
```csharp
@page "/"
@inject Polarizelab.Blazor.GuidePopup.IGuider Guider


@functions{
ElementReference showPopupNearMe;
protected override void OnInitialized()
{
base.OnInitialized();

Guider.Show("elementId", "Content", GuidePosition.Right);
// you can use it with ElementRef or X,Y
// Guider.Show(showPopupNearMe, "Content", GuidePosition.Bottom);
// Guider.Show(200, 400, "Content", GuidePosition.TopLeft);
Guider.OnClosed += OnClosed;
}
private void OnClosed(object sender, System.EventArgs args)
{
Console.WriteLine("Closed");
}
}
```
#### Use GuideLines
```csharp
@inject Polarizelab.Blazor.GuidePopup.IGuider Guider


@code{
ElementReference showPopupNearMe;
private void ShowGuidline(){
Guider.Make("elementId", "Content", GuidePosition.Right)
.Make(showPopupNearMe, "Content", GuidePosition.Bottom)
.Make(300, 300, "Test 3")
.Start();
}
}
```

##### Note: The Guider will create new element and add it to inside of `body` tag, when close it will removed. If you have any idea for this package,feel free create new issue on this repository.
#### Demo
![Demo](Demo.gif)