Class: UI::SonnerToasterComponent
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- UI::SonnerToasterComponent
- Includes:
- ToasterBehavior
- Defined in:
- app/view_components/ui/sonner_toaster_component.rb
Overview
Sonner Toaster component (ViewComponent) Container for toast notifications - render once in your layout
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(position: "bottom-right", theme: "system", rich_colors: false, expand: false, duration: 4000, close_button: false, visible_toasts: 3, classes: "", **attributes) ⇒ SonnerToasterComponent
constructor
A new instance of SonnerToasterComponent.
Constructor Details
#initialize(position: "bottom-right", theme: "system", rich_colors: false, expand: false, duration: 4000, close_button: false, visible_toasts: 3, classes: "", **attributes) ⇒ SonnerToasterComponent
Returns a new instance of SonnerToasterComponent.
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'app/view_components/ui/sonner_toaster_component.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
#call ⇒ Object
50 51 52 |
# File 'app/view_components/ui/sonner_toaster_component.rb', line 50 def call content_tag :ol, "", **toaster_html_attributes end |