Class: LightningUiKit::AlertComponent
- Inherits:
-
BaseComponent
- Object
- ViewComponent::Base
- BaseComponent
- LightningUiKit::AlertComponent
- Defined in:
- app/components/lightning_ui_kit/alert_component.rb
Instance Method Summary collapse
- #classes ⇒ Object
- #default_classes ⇒ Object
-
#initialize(type: :info, **options) ⇒ AlertComponent
constructor
A new instance of AlertComponent.
Methods inherited from BaseComponent
Methods included from HeroiconHelper
Constructor Details
#initialize(type: :info, **options) ⇒ AlertComponent
Returns a new instance of AlertComponent.
4 5 6 7 |
# File 'app/components/lightning_ui_kit/alert_component.rb', line 4 def initialize(type: :info, **) @type = type @options = end |
Instance Method Details
#classes ⇒ Object
13 14 15 |
# File 'app/components/lightning_ui_kit/alert_component.rb', line 13 def classes [default_classes, @options[:class]].compact.join(" ") end |
#default_classes ⇒ Object
9 10 11 |
# File 'app/components/lightning_ui_kit/alert_component.rb', line 9 def default_classes "lui:flex lui:items-center lui:p-4 lui:text-sm lui:text-gray-800 lui:rounded-lg lui:bg-gray-50" end |