View Source Shino.Notification (shino v0.1.0-alpha.0)
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/3
Shino.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
.