Class: Anchor::ToastComponent

Inherits:
Component
  • Object
show all
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

ViewHelper::ANCHOR_HELPERS

Instance Method Summary collapse

Methods inherited from Component

generate_id

Methods included from ViewHelper

#anchor_form_with, #anchor_svg, #deep_blank?, #merge_options, #popover_trigger_attributes

Methods included from FetchOrFallbackHelper

#fetch_or_fallback

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