Skip to content

Commit

Permalink
Extended Readme and server sample for custom close button
Browse files Browse the repository at this point in the history
  • Loading branch information
linkdotnet committed Jul 23, 2021
1 parent 211a23f commit a469700
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ Toasts are configured using parameters on the `<BlazoredToasts />` component. Th
- IconType (Default: IconType.FontAwesome)
- Position (Default: ToastPosition.TopRight)
- Timeout (Default: 5)
- ShowProgressBar (Default: false)
- ShowCloseButton (Default: true)
- CloseButtonContent (provide custom close button)

By default, you don't need to provide any settings everything will just work. But if you want to add icons to toasts or override the default styling then you can use the options above to do that.

Expand Down Expand Up @@ -99,6 +102,18 @@ The example above is from the [client side samples](https://github.com/Blazored/
The example above is from the [server side samples](https://github.com/Blazored/Toast/tree/master/samples) and demonstrates the use of Material Design icons.


If you want to have your own custom close button:
```html
<BlazoredToasts Position="ToastPosition.BottomRight"
Timeout="10">
<CloseButtonContent>
<div>
<span>&times;</span>
</div>
</CloseButtonContent>
</BlazoredToasts>
```

### 4. Add reference to style sheet(s)
Add the following line to the `head` tag of your `_Host.cshtml` (Blazor Server app) or `index.html` (Blazor WebAssembly).
The blazored-toast.css includes the open-iconic-bootstrap.min.css.
Expand Down
9 changes: 8 additions & 1 deletion samples/BlazorServer/Shared/MainLayout.razor
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,14 @@
InfoIcon="school"
SuccessIcon="done_outline"
WarningIcon="warning"
ShowProgressBar="@true"/>
ShowProgressBar="@true"
ShowCloseButton="@true">
<CloseButtonContent>
<div>
<span class="myCloseButtonStyleClass">&times;</span>
</div>
</CloseButtonContent>
</BlazoredToasts>

<div class="sidebar">
<NavMenu />
Expand Down

0 comments on commit a469700

Please sign in to comment.