mirror of
https://github.com/darksaid98/overextended.github.io.git
synced 2026-12-03 06:28:53 +00:00
update notification docs
This commit is contained in:
1 parent
a96e80e0df
commit
b87b3b6e92
1 file changed
+11
-69
@@ -5,7 +5,7 @@ title: Notifications
|
|||||||
import Tabs from '@theme/Tabs';
|
import Tabs from '@theme/Tabs';
|
||||||
import TabItem from '@theme/TabItem';
|
import TabItem from '@theme/TabItem';
|
||||||
|
|
||||||
## lib.notify
|
### lib.notify
|
||||||
|
|
||||||
Custom notifications with a lot of styling options.
|
Custom notifications with a lot of styling options.
|
||||||
|
|
||||||
@@ -33,9 +33,10 @@ lib.notify(data)
|
|||||||
* title?: `string`
|
* title?: `string`
|
||||||
* Must provide if there is no description
|
* Must provide if there is no description
|
||||||
* description?: `string`
|
* description?: `string`
|
||||||
* Must provide if there is no title; has markdown support.
|
* Must provide if there is no title
|
||||||
|
* Markdown support
|
||||||
* duration?: `number`
|
* duration?: `number`
|
||||||
* position?: `'top'` or `'top-right'` or `'top-left'` or `'bottom'` or `'bottom-right'` or `'bottom-left'`
|
* 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'`
|
* Default: `'top-right'`
|
||||||
* type?: `'inform'` or `'error'` or `'success'`
|
* type?: `'inform'` or `'error'` or `'success'`
|
||||||
* Default: `'inform'`
|
* Default: `'inform'`
|
||||||
@@ -45,6 +46,11 @@ lib.notify(data)
|
|||||||
* Font Awesome 6 icon name
|
* Font Awesome 6 icon name
|
||||||
* iconColor: `string`
|
* iconColor: `string`
|
||||||
|
|
||||||
|
:::caution
|
||||||
|
|
||||||
|
Setting `iconColor` will get rid of the contrasted icon colour and it's circular background.
|
||||||
|
:::
|
||||||
|
|
||||||
### Usage Example
|
### Usage Example
|
||||||
|
|
||||||
#### Standard
|
#### Standard
|
||||||
@@ -76,7 +82,7 @@ lib.notify({
|
|||||||
</TabItem>
|
</TabItem>
|
||||||
</Tabs>
|
</Tabs>
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
#### Custom
|
#### Custom
|
||||||
|
|
||||||
@@ -121,68 +127,4 @@ lib.notify({
|
|||||||
</TabItem>
|
</TabItem>
|
||||||
</Tabs>
|
</Tabs>
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
## lib.defaultNotify
|
|
||||||
|
|
||||||
Default notifications provided by Chakra UI.
|
|
||||||
|
|
||||||
<Tabs>
|
|
||||||
<TabItem value='Lua'>
|
|
||||||
|
|
||||||
```lua
|
|
||||||
lib.defaultNotify(data)
|
|
||||||
```
|
|
||||||
|
|
||||||
</TabItem>
|
|
||||||
<TabItem value='JS/TS'>
|
|
||||||
|
|
||||||
```ts
|
|
||||||
import lib from '@overextended/ox_lib/client'
|
|
||||||
|
|
||||||
lib.defaultNotify(data)
|
|
||||||
```
|
|
||||||
|
|
||||||
</TabItem>
|
|
||||||
</Tabs>
|
|
||||||
|
|
||||||
* 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'`
|
|
||||||
* variant?: `'solid'` or `'subtle'` or `'left-accent'` or `'top-accent'`
|
|
||||||
* status?: `'info'` or `'warning'` or `'success'` or `'error'`
|
|
||||||
|
|
||||||
### Usage Example
|
|
||||||
|
|
||||||
<Tabs>
|
|
||||||
<TabItem value='Lua'>
|
|
||||||
|
|
||||||
```lua
|
|
||||||
lib.defaultNotify({
|
|
||||||
title = 'Notification title',
|
|
||||||
description = 'Notification description',
|
|
||||||
variant = 'left-accent',
|
|
||||||
status = 'success'
|
|
||||||
})
|
|
||||||
```
|
|
||||||
|
|
||||||
</TabItem>
|
|
||||||
<TabItem value='JS/TS'>
|
|
||||||
|
|
||||||
```ts
|
|
||||||
import lib from '@overextended/ox_lib/client'
|
|
||||||
|
|
||||||
lib.defaultNotify({
|
|
||||||
title: 'Notification title',
|
|
||||||
description: 'Notification description',
|
|
||||||
status: 'success'
|
|
||||||
})
|
|
||||||
```
|
|
||||||
|
|
||||||
</TabItem>
|
|
||||||
</Tabs>
|
|
||||||
|
|
||||||

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