Class: Ui::Alert::Component

Inherits:
BaseComponent
  • Object
show all
Defined in:
lib/uikit_rails/templates/components/alert/component.rb

Overview

Informational message with optional title, description, and action.

Constant Summary collapse

VARIANTS =
%i[default destructive].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(variant: :default, **html_attrs) ⇒ Component

Returns a new instance of Component.



15
16
17
18
19
# File 'lib/uikit_rails/templates/components/alert/component.rb', line 15

def initialize(variant: :default, **html_attrs)
  @variant = variant.to_sym
  @html_attrs = html_attrs
  super()
end

Instance Attribute Details

#html_attrsObject (readonly)

Returns the value of attribute html_attrs.



13
14
15
# File 'lib/uikit_rails/templates/components/alert/component.rb', line 13

def html_attrs
  @html_attrs
end

#variantObject (readonly)

Returns the value of attribute variant.



13
14
15
# File 'lib/uikit_rails/templates/components/alert/component.rb', line 13

def variant
  @variant
end