Class: Protos::Alert

Inherits:
Component show all
Defined in:
lib/protos/alert.rb,
lib/protos/alert/icon.rb,
lib/protos/alert/actions.rb

Defined Under Namespace

Classes: Actions, Icon

Constant Summary collapse

Styles =

DOCS: A component that displays messages (usually from flashes). These can be used in combination with Protos::Toast to have popup notifications. daisyui.com/components/alert/

Types::Coercible::Symbol.enum(
  :info,
  :success,
  :warning,
  :error
)
STYLES =
{
  info: "alert-info",
  error: "alert-error",
  warning: "alert-warning",
  success: "alert-success"
}.freeze

Instance Method Summary collapse

Methods inherited from Component

#initialize

Constructor Details

This class inherits a constructor from Protos::Component

Instance Method Details

#actionsObject



31
# File 'lib/protos/alert.rb', line 31

def actions(...) = render Actions.new(...)

#iconObject



29
# File 'lib/protos/alert.rb', line 29

def icon(...) = render Icon.new(...)

#view_templateObject



25
26
27
# File 'lib/protos/alert.rb', line 25

def view_template(&)
  div(**attrs, &)
end