Notification

1. Minimum notifications

Note
En este ejemplo se implementan botones, por lo que se recomienda ver la documentación del mismo.
@using Astrol.Entities.Basic.Static.Notification
@using Astrol.Component.Basic.Button
@using Astrol.Entities.Basic.UI
@using Astrol.JSInterop.Base
@inject AstrolJSInterop jsI
 
<AstrolButton OnClick="x=>ShowMinimalNotification()"
 Style="AstrolStyle.Blue"
 Text="Click me" />
@code {
 private async Task ShowMinimalNotification() {
 await Task.Delay(400);
 await jsI.Notification("Minimum notification <h1>Base</h1>".NotificationBase());
 await Task.Delay(400);
 await jsI.Notification("Minimum notification <h1>None</h1>".NotificationNone());
 await Task.Delay(400);
 await jsI.Notification("Minimum notification <h1>Info</h1>".NotificationInfo());
 await Task.Delay(400);
 await jsI.Notification("Minimum notification <h1>Error</h1>".NotificationError());
 await Task.Delay(400);
 await jsI.Notification("Minimum notification <h1>Warning</h1>".NotificationWarning());
 await Task.Delay(400);
 await jsI.Notification("Minimum notification <h1>Aucces</h1>".NotificationSuccess());
 }
}

2. Custom notifications


@using Astrol.Component.Basic.Button
@using Astrol.Entities.Basic.UI
@using Astrol.JSInterop.Base
@inject AstrolJSInterop jsI
 
<AstrolButton OnClick='x => ShowNotification("Hello World!", "astrol-ok", AstrolStyle.Blue)'
 Style='AstrolStyle.Blue'
 Text='Click me' />
@code {
 private async Task ShowNotification(string message,string icon, AstrolStyle type, bool outline = false) {
 await jsI.Notification(new Notification
 {
 Type = type,
 Icon = icon,
 Message = message,
 Outline = outline,
 });
 }
}

Supported parameters

  • Message (string), text to display.
  • Icon (string), icon to display (default is astrol-warning).
  • ShowLoad (bool), whether to display the lifespan (default is true).
  • Outline (bool), whether to have no fill (default is false).
  • Time (int), lifespan of the notification in seconds (default is 5).
  • Type (AstrolStyle), defines the style of the button (default is ButtonStyle.Base).
    • Base (enum)
    • White (enum)
    • Black (enum)
    • Red (enum)
    • Orange (enum)
    • Green (enum)
    • Blue (enum)
    • Yellow (enum)
© 2026 AstrolUI v10.0.8
Se ha producido un error no controlado. Recargar 🗙