Class: UI::SonnerToaster
- Inherits:
-
Phlex::HTML
- Object
- Phlex::HTML
- UI::SonnerToaster
- Includes:
- SonnerToasterBehavior
- Defined in:
- app/components/ui/sonner_toaster.rb
Overview
Sonner Toaster component (Phlex) Container for toast notifications - render once in your layout
Constant Summary
Constants included from SonnerToasterBehavior
UI::SonnerToasterBehavior::POSITIONS, UI::SonnerToasterBehavior::THEMES
Instance Method Summary collapse
-
#initialize(position: "bottom-right", theme: "system", rich_colors: false, expand: false, duration: 4000, close_button: false, visible_toasts: 3, classes: "", **attributes) ⇒ SonnerToaster
constructor
A new instance of SonnerToaster.
- #view_template ⇒ Object
Methods included from SonnerToasterBehavior
#toaster_classes, #toaster_data_attributes, #toaster_html_attributes
Constructor Details
#initialize(position: "bottom-right", theme: "system", rich_colors: false, expand: false, duration: 4000, close_button: false, visible_toasts: 3, classes: "", **attributes) ⇒ SonnerToaster
Returns a new instance of SonnerToaster.
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'app/components/ui/sonner_toaster.rb', line 28 def initialize( position: "bottom-right", theme: "system", rich_colors: false, expand: false, duration: 4000, close_button: false, visible_toasts: 3, classes: "", **attributes ) @position = position @theme = theme @rich_colors = rich_colors @expand = @duration = duration @close_button = @visible_toasts = visible_toasts @classes = classes @attributes = attributes end |
Instance Method Details
#view_template ⇒ Object
50 51 52 |
# File 'app/components/ui/sonner_toaster.rb', line 50 def view_template ol(**toaster_html_attributes) end |