Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions docs/content/3.components/toast.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,26 @@ name: 'toast-orientation-example'

## Examples

::note{to="/components/app"}
Nuxt UI provides an **App** component that wraps your app to provide global configurations.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the should be used instead of an before App, makes it more consistent with the sentence bellow which uses the as well.

::

### Change global position

Change the `toaster.position` prop on the [App](/components/app#props) component to change the position of the toasts.

```vue [app.vue]
<script setup lang="ts">
const toaster = { position: 'bottom-right' }
</script>

<template>
<UApp :toaster="toaster">
<NuxtPage />
</UApp>
</template>
```

::component-example
---
prettier: true
Expand All @@ -210,6 +226,18 @@ In this example, we use the `AppConfig` to configure the `position` prop of the

Change the `toaster.duration` prop on the [App](/components/app#props) component to change the duration of the toasts.

```vue [app.vue]
<script setup lang="ts">
const toaster = { duration: 5000 }
</script>

<template>
<UApp :toaster="toaster">
<NuxtPage />
</UApp>
</template>
```

::component-example
---
prettier: true
Expand All @@ -232,6 +260,18 @@ Set the `toaster.expand` prop to `false` on the [App](/components/app#props) com
You can hover over the toasts to expand them. This will also pause the timer of the toasts.
::

```vue [app.vue]
<script setup lang="ts">
const toaster = { expand: true }
</script>

<template>
<UApp :toaster="toaster">
<NuxtPage />
</UApp>
</template>
```

::component-example
---
prettier: true
Expand Down