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

# Notifications

> Toast feedback with Bridge.Notify — the one UI component callable from both the client and the server.

`Bridge.Notify` shows a toast — a small, auto-dismissing card with an icon, title, and optional description. Use it for quick feedback: an action succeeded, a purchase went through, an inventory was full.

It is the **only** UI component available on the server. From the server you target a specific player; from the client it shows on the local screen.

## Availability

| Side       | Signature                    |                                          |
| ---------- | ---------------------------- | ---------------------------------------- |
| **Client** | \`Bridge.Notify(payload      | text, type?)\`                           |
| **Server** | \`Bridge.Notify(src, payload | text, type?)\` — first arg is the player |

Both sides also expose four shorthands: `Notify.Info`, `Notify.Success`, `Notify.Warn`, `Notify.Error`.

## Signature

`Bridge.Notify` accepts either a plain string (with an optional type) or a payload table.

```lua theme={null}
Bridge.Notify('Saved.')                       -- string + default type (info)
Bridge.Notify('Out of bait', 'error')         -- string + type
Bridge.Notify({ title = 'Garage', description = 'Vehicle stored.', type = 'success' })
```

<ParamField path="title" type="string">
  The bold first line. Optional, but recommended — the shorthands put their first argument here.
</ParamField>

<ParamField path="description" type="string">
  The muted second line. Optional.
</ParamField>

<ParamField path="type" type="string" default="info">
  One of `info`, `success`, `warning`, `error`. Picks the accent color and default icon.
</ParamField>

<ParamField path="duration" type="number" default="4000">
  How long the toast stays, in milliseconds.
</ParamField>

<ParamField path="position" type="string" default="top-center">
  One of `top-left`, `top-center`, `top-right`, `bottom-left`, `bottom-center`, `bottom-right`.
</ParamField>

<ParamField path="icon" type="string">
  An icon name override. Defaults to a type-appropriate icon (`circle-check` for success, `circle-exclamation` for error, etc.).
</ParamField>

<Note>
  Up to 5 toasts stack at a time, newest first. A default icon is chosen from `type` when you omit `icon`.
</Note>

## Shorthands

Each shorthand sets the `type` for you. The signature is `(title, description?)` on the client and `(src, title, description?)` on the server.

```lua theme={null}
Bridge.Notify.Info('Heads up', 'A new update is available.')
Bridge.Notify.Success('Garage', 'Vehicle stored.')
Bridge.Notify.Warn('Low fuel', 'You are almost empty.')
Bridge.Notify.Error('Failed', 'Could not reach the server.')
```

## Examples

<CodeGroup>
  ```lua Client — basic theme={null}
  -- A one-off message after a local action
  Bridge.Notify('Door unlocked.')
  Bridge.Notify.Success('Crafted', 'You made a lockpick.')
  ```

  ```lua Client — full payload theme={null}
  Bridge.Notify({
      title       = 'Inventory full',
      description = 'No room for the fish.',
      type        = 'warning',
      duration    = 6000,
      position    = 'bottom-right',
      icon        = 'box',
  })
  ```

  ```lua Server — target a player theme={null}
  RegisterNetEvent('shop:bought', function()
      local src = source
      Bridge.Notify(src, { title = 'Bank', description = '+$500', type = 'success' })
  end)

  -- or the shorthand
  Bridge.Notify.Error(src, 'Bank', 'Insufficient funds.')
  ```
</CodeGroup>

<Tip>
  Notifications honor the player's theme accent automatically — the `info` type and any accent fills tint to the live `atlas:theme:color`. Set `atlas:ui "ox"` to render the same calls through ox\_lib instead.
</Tip>
