ui icon indicating copy to clipboard operation
ui copied to clipboard

Allow multiple notifications containers

Open DarioRega opened this issue 1 year ago • 1 comments

Description

Hello!

I think it would be nice to allow multiple notifications containers, so that we could have different placements for toasts based on the container they are sent to.

After digging in the components i think this changes wouldn't be heavy and i could contribute for this if you agree with this feature request.

My idea would be to allow to pass a custom key for the the useToast and the notifications state and therefore they would have their own references:

Notifications.vue
const toast = useToast(aCustomKey)
const notifications = useState<Notification[]>(aCustomKey, () => [])

So now we could have:

App.vue
<UNotifications :ui="{position:'bottom-auto top-0' }"/>
<UNotifications state-key="aCustomKey" :ui="{position:'bottom-0 top-auto' }"/>

And then within your app we could call the toast handler we want:

Random.vue
const toast = useToast(aCustomKey)

Let me know what you think and if you'll be interested on this knowing that i could contribute fully to it.

Thanks!

Additional context

No response

DarioRega avatar Apr 23 '24 08:04 DarioRega

That could be interesting :)

noook avatar Apr 23 '24 09:04 noook