Files
overextended.github.io/docs/ox_lib/Interface/Client/notify.md
T
2022-12-11 15:00:43 +11:00

3.1 KiB

title
title
Notifications

import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem';

lib.notify

Custom notifications with a lot of styling options.

lib.notify(data)
import lib from '@overextended/ox_lib/client'

lib.notify(data)
  • id?: string
    • When set the current notification will be unique and only shown once on screen when spammed.
  • title?: string
    • Must provide if there is no description
  • description?: string
    • Must provide if there is no title
  • duration?: number
  • position?: 'top' or 'top-right' or 'top-left' or 'bottom' or 'bottom-right' or 'bottom-left'
    • Default: 'top-right'
  • type?: 'inform' or 'error' or 'success'
    • Default: 'inform'
  • style?: table (object)
    • React CSS styling format
  • icon?: string
    • Font Awesome 6 icon name
  • iconColor: string

Usage Example

Standard

lib.notify({
    title = 'Notification title',
    description = 'Notification description',
    type = 'success'
})
import lib from '@overextended/ox_lib/client'

lib.notify({
  title: 'Notification title',
  description: 'Notification description',
  type: 'success'
})

notification

Custom

lib.notify({
    id = 'some_identifier',
    title = 'Notification title',
    description = 'Notification description',
    position = 'top',
    style = {
        backgroundColor = '#141517',
        color = '#909296'
    },
    icon = 'ban',
    iconColor = '#C53030'
})
import lib from '@overextended/ox_lib/client'

lib.notify({
  id: 'some_identifier',
  title: 'Notification title',
  description: 'Notification description',
  position: 'top',
  style: {
    backgroundColor: '#141517',
    color: '#909296'
  },
  icon: 'ban',
  iconColor: '#C53030'
})

custom_notification

lib.defaultNotify

Default notifications provided by Chakra UI.

lib.defaultNotify(data)
import lib from '@overextended/ox_lib/client'

lib.defaultNotify(data)
  • id?: number
    • Same as id in lib.notify
  • title?: string
  • description?: string
  • duration?: number
  • position?: 'top' or 'top-right' or 'top-left' or 'bottom' or 'bottom-right' or 'bottom-left'
  • status?: 'info' or 'warning' or 'success' or 'error'

Usage Example

lib.defaultNotify({
    title = 'Notification title',
    description = 'Notification description',
    status = 'success'
})
import lib from '@overextended/ox_lib/client'

lib.defaultNotify({
  title: 'Notification title',
  description: 'Notification description',
  status: 'success'
})

default_notification