Class: Ui::Alert::Component
- Inherits:
-
BaseComponent
- Object
- BaseComponent
- Ui::Alert::Component
- 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
-
#html_attrs ⇒ Object
readonly
Returns the value of attribute html_attrs.
-
#variant ⇒ Object
readonly
Returns the value of attribute variant.
Instance Method Summary collapse
-
#initialize(variant: :default, **html_attrs) ⇒ Component
constructor
A new instance of Component.
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_attrs ⇒ Object (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 |
#variant ⇒ Object (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 |