> ## Documentation Index
> Fetch the complete documentation index at: https://ugcore.urging.ch/llms.txt
> Use this file to discover all available pages before exploring further.

# UgLib.Notify

> Toasts, compact lines and banners.

<Badge color="green">Client</Badge> Through ug-lib.

```lua theme={"dark"}
UgLib.Notify.Show(options) -> id
UgLib.Notify.Update(id, options) -> boolean
UgLib.Notify.Dismiss(id) -> boolean
UgLib.Notify.DismissAll() -> integer
```

<ResponseField name="options.message" type="string" required>1 to 1024 characters. Takes the markup.</ResponseField>
<ResponseField name="options.title" type="string">Up to 128 characters.</ResponseField>

<ResponseField name="options.type" type="UgNotifyType" default="Info" />

<ResponseField name="options.style" type="UgNotifyStyle" default="Toast">`Compact` is one line, `Banner` is wide and defaults to the top of the screen.</ResponseField>
<ResponseField name="options.position" type="UgPosition">Defaults to `settings.notifyPosition`.</ResponseField>
<ResponseField name="options.duration" type="integer">ms, 0 to 600000. `0` stays until dismissed. Defaults to `settings.notifyDuration`.</ResponseField>
<ResponseField name="options.icon" type="UgIcon">Replaces the type icon.</ResponseField>
<ResponseField name="options.id" type="string">1 to 32 letters, digits or `_ - . :`, not starting with `#`. Showing an `id` that is on screen updates it and restarts its timer.</ResponseField>

* Without `id`, the returned id is generated, such as `#3`. Use it with `Update` and `Dismiss`.
* `Update` changes fields of a notification on screen and restarts its timer. It returns false when it is gone.
* `DismissAll` closes the notifications of your resource only.
* At most `settings.notifyMax` (default 5) per anchor. The oldest leave first.
* Notifications are client only. To notify from the server, see [Using ug-lib with UgCore](/ug-lib/with-ugcore).

## Markup

`**bold**`, `*italic*`, and `~token~` colors the rest of the text until `~reset~`. Tokens: `primary`, `success`, `warning`, `destructive`, `muted`. HTML is shown as text.

## Example

```lua client.lua theme={"dark"}
UgLib.Notify.Show({
    title = 'Bank',
    message = 'Received ~success~**$500**~reset~ from Bob.',
    type = UgLib.Enums.NotifyType.Success,
})

UgLib.Notify.Show({ id = 'fuel', message = 'Fuel low: 9%', style = UgLib.Enums.NotifyStyle.Compact })
```


## Related topics

- [UgLib.Enums](/ug-lib/enums.md)
- [UgLib.Version](/ug-lib/version.md)
- [UgLib.Locale](/ug-lib/locale.md)
- [UgLib.Menu](/ug-lib/menu.md)
- [UgLib.Context](/ug-lib/context.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.