Alert

A alert displays an important, succinct message, and provides actions for users to address (or dismiss the alert).

Close

Display the close button.

TypeDefault Value
boolnull

A new package update is available.

See what’s new in version 0.3.

<NVAlert Close Permanent Color="primary">
  <NVText Size="sm" Medium MB="1">A new package update is available.</NVText>
  <NVText Size="sm">See what’s new in version 0.3.</NVText>
</NVAlert>

Icon

Change icon of the Alert.
By default an icon is linked to colors : neutral (flag), primary (speakerphone), secondary ( info-circle), success (circle-check) and error (alert-circle).

TypeDefault Value
stringnull
custom icon
neutral - flag
primary - speakerphone
secondary - info-circle
success - circle-check
error - alert-circle
<NVBlock ChildMargin=". . 2">
  <NVAlert Icon="search" Permanent Color="neutral"> custom icon </NVAlert>
  <NVAlert Permanent Color="neutral"> neutral - flag </NVAlert>
  <NVAlert Permanent Color="primary"> primary - speakerphone </NVAlert>
  <NVAlert Permanent Color="secondary"> secondary - info-circle </NVAlert>
  <NVAlert Permanent Color="success"> success - circle-check </NVAlert>
  <NVAlert Permanent Color="error-100"> error - alert-circle </NVAlert>
</NVBlock>

Permanent

By default an alert is hidden. To display it wee need to set Permanent to True.

TypeDefault Value
stringnull
Alert hidden
Alert Permanent
<NVAlert Color="primary"> Alert hidden </NVAlert>
<NVAlert Permanent Color="primary"> Alert Permanent </NVAlert>

Visible

Visible boolean let us to display or hide the alert with an animation.
The animation will be play when the value Visible change.
If on first rendering Visible is True, it act as Permanent boolean. The alert will be visible (no appearing animation is played).

TypeDefault Value
boolfalse
A new package update is available.
See what’s new in version 0.3.
<NVButton Margin=". . 3" OnClick="@(()" => _toggle = !_toggle)>Toggle </NVButton>
<NVAlert Color="primary" @bind-Visible="@_toggle">Info</NVAlert>

@code{
  private bool _toggle = true;
}

VisibleChanged

Used for the dual binding of Visible.
Cfr. Visible parameter above.

TypeDefault Value
EventCallback<bool>null