View Source Shino.Notification (shino v0.2.0-alpha.1)
A drop-in replacement for notification system in Phoenix.
Usage
Add following components to your app.html.heex:
<Shino.Notification.connection_group position={:top} />
<Shino.Notification.notification_group flash={@flash} connected={assigns[:socket] != nil} />Then, use following functions to send flash or toast:
put_flash/3Shino.Notification.put_toast/_Shino.Notification.send_toast/_
Summary
Functions
Renders a notification group for DeadView and LiveView.
Functions
Renders a notification group for DeadView and LiveView.
- For DeadView, it only renders flashes.
- For LiveView, it renders flashes and toasts.
Attributes
id(:string) - the DOM id of notification group. Defaults to"notification-group".position(:atom) - the location for showing notifications. Defaults to:bottom_right.flash(:map) (required) - the map of flash messages.connected(:boolean) - Defaults tofalse.