Skip to content
This repository has been archived by the owner on Sep 24, 2024. It is now read-only.

Commit

Permalink
Merge pull request #137 from selemondev/update-readme
Browse files Browse the repository at this point in the history
docs: update readme
  • Loading branch information
selemondev authored Sep 13, 2023
2 parents 49b3879 + 87a11fc commit ad2d3bc
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions packages/nuxt-ui-vue/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,49 @@ For any component that uses the `variant` prop such as the `UButton`, `UBadge`,
</template>
```

- The `Notifications` component comes with a position prop to enable you to specify the position of the `Notifications` component. To get started with it, you need to do to import the `injectToast()` function and the `UNotifications` component in your `App.vue` file as shown below:

```vue
<!-- app.vue file -->
<script setup lang="ts">
import { injectToast } from 'nuxt-ui-vue'
import { onMounted } from 'vue'
onMounted(() => {
injectToast()
})
</script>
<template>
<div>
<UNotifications position="top-right" />
</div>
</template>
```

- By default, the position of the component is set to `bottom-right`.

- Then in your other component, for example, Hello component, you can do the following:

```vue
<!-- Hello.vue component -->
<script setup lang="ts">
import { useToast } from 'nuxt-ui-vue'
const toast = useToast()
</script>
<template>
<UButton
label="Show toast" @click="toast.add({
title: 'Update downloaded.',
description: 'It will be installed on restart. Restart now?',
})"
/>
</template>
```


🥳 Well done, you can now go ahead and build your web application with ease.

Expand Down

0 comments on commit ad2d3bc

Please sign in to comment.