Skip to content

Notification Positioning #8

@joelhickok

Description

@joelhickok

Any plans to add positioning functionality to the component?

I know this involves a bit of work to setup containers for each corner of the window, but it would be nice to be able to use the notify function to add a position property.

Hopefully I can fork this when I wrap up a big project in the Spring, and maybe submit a pull request if "beyonk" hasn't had a chance to work on this.

// possible implementations

notifier({
  type: 'info',
  message: 'A top left positioned toast.',
  position: 'top-left',
})

notifier.success('A bottom left positioned toast.', {
  position: 'bottom-left',
  timeout: 3500,
})

With frameworks like Vue.js, you can put a CSS class directly on the component and it gets passed down to the component's outermost element. Svelte.js does not do this, however, so I cannot simply put the class to override positioning directly on the component, which is a hacky way to quickly add a class to the Toast container.

<!-- not possible with Svelte but works with Vue.js -->
<NotificationDisplay class="toast-top-left"/>

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions