A global component to display notifications.
You can display a notification using the Ui.Notifications.notifyDefault(content) function.
Ui.Notifications.notifyDefault(content)
<Ui.Button label="Show notification!" onClick={ (event : Html.Event) { Ui.Notifications.notifyDefault(<>"Notification!"</>) } }/>
If you need more control over the duration can use the Ui.Notifications.notify(content, duration) function.
Ui.Notifications.notify(content, duration)
<> <Ui.Button onClick={ (event : Html.Event) { Ui.Notifications.notify(<>"Notification!"</>, 2000) } } label="Show notification!" /></>
The content of the notification can be any Html
Html
<> <Ui.Button label="Show text with an icon!" onClick={ (event : Html.Event) { Ui.Notifications.notify( <Ui.Container gap={Ui.Size.Em(0.75)}> <Ui.Icon icon={Ui.Icons.CHECK}/> "It's done" </Ui.Container>, 2000) } } /></>
Mint UI is a design system and component library for building websites, web and desktop applications.