mirror of
https://github.com/darksaid98/overextended.github.io.git
synced 2026-12-02 06:28:54 +00:00
new docs
This commit is contained in:
1 parent
3cebaf7fa5
commit
b5eba8423f
229 files changed
+6238
-10690
No files matched your search
@@ -0,0 +1,150 @@
|
||||
---
|
||||
title: Notifications
|
||||
---
|
||||
|
||||
import { Tabs, Tab } from 'nextra-theme-docs';
|
||||
import { Callout } from 'nextra/components';
|
||||
|
||||
### lib.notify
|
||||
|
||||
Custom notifications with a lot of styling options.
|
||||
|
||||
<Tabs items={["Lua", "JS"]}>
|
||||
<Tab>
|
||||
|
||||
<Tabs items={["Client", "Server"]}>
|
||||
<Tab>
|
||||
|
||||
```lua
|
||||
lib.notify(data)
|
||||
```
|
||||
|
||||
</Tab>
|
||||
<Tab>
|
||||
|
||||
```lua
|
||||
TriggerClientEvent('ox_lib:notify', source, data)
|
||||
```
|
||||
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
</Tab>
|
||||
<Tab>
|
||||
|
||||
```ts
|
||||
import lib from '@overextended/ox_lib/client';
|
||||
|
||||
lib.notify(data);
|
||||
```
|
||||
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
- 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
|
||||
- Markdown support
|
||||
- duration?: `number`
|
||||
- position?: `'top'` or `'top-right'` or `'top-left'` or `'bottom'` or `'bottom-right'` or `'bottom-left'` or `'center-right'` or `'center-left'`
|
||||
- Default: `'top-right'`
|
||||
- type?: `'inform'` or `'error'` or `'success'`or `'warning'`
|
||||
- Default: `'inform'`
|
||||
- style?: `table` (`object`)
|
||||
- React CSS styling format
|
||||
- icon?: `string`
|
||||
- Font Awesome 6 icon name
|
||||
- iconColor: `string`
|
||||
|
||||
<Callout>
|
||||
|
||||
Setting `iconColor` will get rid of the contrasted icon colour and it's circular background.
|
||||
|
||||
</Callout>
|
||||
|
||||
### Usage Example
|
||||
|
||||
#### Standard
|
||||
|
||||
<Tabs items={["Lua", "JS"]}>
|
||||
<Tab>
|
||||
|
||||
```lua
|
||||
lib.notify({
|
||||
title = 'Notification title',
|
||||
description = 'Notification description',
|
||||
type = 'success'
|
||||
})
|
||||
```
|
||||
|
||||
</Tab>
|
||||
<Tab>
|
||||
|
||||
```ts
|
||||
import lib from '@overextended/ox_lib/client';
|
||||
|
||||
lib.notify({
|
||||
title: 'Notification title',
|
||||
description: 'Notification description',
|
||||
type: 'success',
|
||||
});
|
||||
```
|
||||
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||

|
||||
|
||||
#### Custom
|
||||
|
||||
<Tabs items={["Lua", "JS"]}>
|
||||
<Tab>
|
||||
|
||||
```lua
|
||||
lib.notify({
|
||||
id = 'some_identifier',
|
||||
title = 'Notification title',
|
||||
description = 'Notification description',
|
||||
position = 'top',
|
||||
style = {
|
||||
backgroundColor = '#141517',
|
||||
color = '#C1C2C5',
|
||||
['.description'] = {
|
||||
color = '#909296'
|
||||
}
|
||||
},
|
||||
icon = 'ban',
|
||||
iconColor = '#C53030'
|
||||
})
|
||||
```
|
||||
|
||||
</Tab>
|
||||
<Tab>
|
||||
|
||||
```ts
|
||||
import lib from '@overextended/ox_lib/client';
|
||||
|
||||
lib.notify({
|
||||
id: 'some_identifier',
|
||||
title: 'Notification title',
|
||||
description: 'Notification description',
|
||||
position: 'top',
|
||||
style: {
|
||||
backgroundColor: '#141517',
|
||||
color: '#C1C2C5',
|
||||
'.decription': {
|
||||
color: '#909296',
|
||||
},
|
||||
},
|
||||
icon: 'ban',
|
||||
iconColor: '#C53030',
|
||||
});
|
||||
```
|
||||
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||

|
||||
Reference in new issue
Block a user