Class: Anchor::ToastComponent
- Defined in:
- app/components/anchor/toast_component.rb
Constant Summary collapse
- VARIANT_DEFAULT =
:notice
- VARIANT_MAPPINGS =
{ VARIANT_DEFAULT => "bg-gray-900 text-white", error: "bg-critical text-white", success: "bg-success text-white", }.freeze
- VARIANT_OPTIONS =
VARIANT_MAPPINGS.keys
Constants included from ViewHelper
Instance Method Summary collapse
-
#initialize(id: self.class.generate_id, **kwargs) ⇒ ToastComponent
constructor
A new instance of ToastComponent.
Methods inherited from Component
Methods included from ViewHelper
#anchor_form_with, #anchor_svg, #deep_blank?, #merge_options, #popover_trigger_attributes
Methods included from FetchOrFallbackHelper
Constructor Details
#initialize(id: self.class.generate_id, **kwargs) ⇒ ToastComponent
Returns a new instance of ToastComponent.
15 16 17 18 |
# File 'app/components/anchor/toast_component.rb', line 15 def initialize(id: self.class.generate_id, **kwargs) @id = id super(**kwargs, id:) end |