nuxt / ui

A UI Library for Modern Web Apps, powered by Vue & Tailwind CSS.
https://ui.nuxt.com
MIT License
4.08k stars 529 forks source link

is it UNotification or UNotifications? #308

Closed CareTiger closed 1 year ago

CareTiger commented 1 year ago

document uses UNotification but only

<UNotifications />

works. I think the docs need to be updated.

benjamincanac commented 1 year ago

UNotifications is the wrapper component where the notifications display. A UNotification component is what is added when you do a toast.add. You can also simply use a UNotification as an alert for example.

CareTiger commented 1 year ago

am confused. if I have <UNotifications /> in app.vue and say I have <UNotification title="Notification" description="This is a notification." /> in /user/profile.vue which one of these is going to be triggered by toast.add()

benjamincanac commented 1 year ago

<UNotifications /> is the container for when you spawn a UNotification with useToast. You can also use the UNotification yourself anywhere in your app. You can read more about it here: https://ui.nuxtlabs.com/overlays/notification

CareTiger commented 1 year ago

documentation is not clear.

jaybharadia commented 1 year ago

I have checked the documentation and code.

There seems to be confusion regarding the following screenshot.

image

Here is my Perspective

Feedback

Disclaimer

Ending Note

Let me know @benjamincanac whether to update the docs for this or provide API for showing UNotification.vue via toast composable.

benjamincanac commented 1 year ago

I'm not sure to understand what's wrong with the documentation.

  1. <UNotifications /> iterates over useToast notifications and display them
  2. <UNotification /> is the component that you can use in your app that displays a card with a title, description, icon, etc.
  3. useToast() is the composable that will add a notification

Why do you want to remove the section of UNotification?

benjamincanac commented 1 year ago

I've just updated the documentation to be more precise: https://ui.nuxtlabs.com/overlays/notification. Feel free to reopen something is still missing.

jaybharadia commented 1 year ago

Thanks for updating the documentation 👍