# Notifications (/docs/orbit-studios-resources/orbit-dynamichud/interface/notifications)



# Notifications [#notifications]

`notify` and `Notify` are equivalent client exports. Notifications may also be triggered through the client event.

```lua title="Client export"
exports['orbit-dynamichud-v2']:notify({
    title = 'Garage',
    description = 'Vehicle stored successfully.',
    type = 'success',
    duration = 3500
})
```

```lua title="Client event"
TriggerEvent('orbit-dynamichud:notify', {
    description = 'You do not have the required item.',
    type = 'error',
    duration = 4000
})
```

A server script targets a client:

```lua title="Server event"
TriggerClientEvent('orbit-dynamichud:notify', source, {
    title = 'Server',
    description = 'Welcome back.',
    type = 'info',
    duration = 3000
})
```

## Payload [#payload]

| Field         | Type      | Default           | Description                                                      |
| ------------- | --------- | ----------------- | ---------------------------------------------------------------- |
| `id`          | `string?` | generated         | Unique ID. A notification with an ID already visible is ignored. |
| `title`       | `string?` | localized by type | Heading. Omit it to use the localized type label.                |
| `description` | `string?` | `""`              | Notification body.                                               |
| `type`        | `string?` | `"info"`          | `primary`, `inform`, `info`, `warning`, `error`, or `success`.   |
| `duration`    | `number?` | `3000`            | Display duration in milliseconds.                                |
| `icon`        | `string?` | type icon         | Free Font Awesome icon name or classes.                          |
| `color`       | `string?` | type color        | CSS color for the accent and duration bar.                       |
| `iconColor`   | `string?` | `color`           | CSS color for the notification icon.                             |

When `title` is omitted, the resource uses `notification_info`, `notification_warning`, `notification_err`, or `notification_success` from the active locale.

```lua title="Custom notification"
exports['orbit-dynamichud-v2']:Notify({
    id = 'vehicle_locked',
    description = 'Vehicle locked.',
    type = 'inform',
    icon = 'fas fa-lock',
    color = '#71B6F7',
    iconColor = '#FFFFFF',
    duration = 2500
})
```

## ox\_lib drop-in replacement [#ox_lib-drop-in-replacement]

Add this after `@ox_lib/init.lua` in the resource. Existing `lib.notify(data)` calls require no changes.

```lua title="client/orbit_notify.lua"
lib = lib or {}

lib.notify = function(data)
    return exports['orbit-dynamichud-v2']:notify(data)
end
```

Core ox\_lib fields (`id`, `title`, `description`, `duration`, `type`, `icon`, and `iconColor`) map directly. DynamicHUD owns placement and styling, so ox\_lib-only fields such as `position`, nested `style`, `showDuration`, and `sound` do not change the DynamicHUD notification presentation.

See the [complete compatibility bridge](/docs/orbit-studios-resources/orbit-dynamichud/interface#complete-ox-lib-compatibility-bridge) when replacing all four interfaces.
