mirror of
https://github.com/darksaid98/overextended.github.io.git
synced 2026-12-01 14:38:50 +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 TabItem from '@theme/TabItem';
|
||||
|
||||
## lib.notify
|
||||
### lib.notify
|
||||
|
||||
Custom notifications with a lot of styling options.
|
||||
|
||||
@@ -33,9 +33,10 @@ lib.notify(data)
|
||||
* title?: `string`
|
||||
* Must provide if there is no description
|
||||
* description?: `string`
|
||||
* Must provide if there is no title; has markdown support.
|
||||
* 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'`
|
||||
* 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'`
|
||||
* Default: `'inform'`
|
||||
@@ -45,6 +46,11 @@ lib.notify(data)
|
||||
* Font Awesome 6 icon name
|
||||
* iconColor: `string`
|
||||
|
||||
:::caution
|
||||
|
||||
Setting `iconColor` will get rid of the contrasted icon colour and it's circular background.
|
||||
:::
|
||||
|
||||
### Usage Example
|
||||
|
||||
#### Standard
|
||||
@@ -76,7 +82,7 @@ lib.notify({
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||

|
||||

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