Class: FoxTail::ToastComponent

Inherits:
DismissibleComponent show all
Defined in:
app/components/fox_tail/toast_component.rb

Instance Attribute Summary

Attributes inherited from BaseComponent

#html_attributes

Instance Method Summary collapse

Methods inherited from DismissibleComponent

#call, stimulus_controller_name, #stimulus_controller_options

Methods inherited from BaseComponent

classname_merger, #initialize, stimulus_merger, use_stimulus?, #with_html_attributes, #with_html_class

Methods inherited from Base

fox_tail_config

Constructor Details

This class inherits a constructor from FoxTail::BaseComponent

Instance Method Details

#before_renderObject



60
61
62
63
64
65
66
67
# File 'app/components/fox_tail/toast_component.rb', line 60

def before_render
  super

  with_dismiss_icon if dismissible? && !dismiss_icon

  html_attributes[:class] = classnames theme.apply(:root, self), html_class
  html_attributes[:role] = :alert
end

#use_stimulus?Boolean

Returns:

  • (Boolean)


69
70
71
# File 'app/components/fox_tail/toast_component.rb', line 69

def use_stimulus?
  super && (dismissible? || auto_close?)
end