Class: PhlexKit::EmptyMedia
- Inherits:
-
BaseComponent
- Object
- Phlex::HTML
- BaseComponent
- PhlexKit::EmptyMedia
- Defined in:
- app/components/phlex_kit/empty/empty_media.rb
Overview
The icon/avatar slot inside an Empty state. variant: :icon gives the tinted rounded chip; :default is bare. Ported from ruby_ui's RubyUI::EmptyMedia.
Constant Summary collapse
- VARIANTS =
{ default: nil, icon: "icon" }.freeze
Instance Method Summary collapse
-
#initialize(variant: :default, **attrs) ⇒ EmptyMedia
constructor
A new instance of EmptyMedia.
- #view_template ⇒ Object
Methods inherited from BaseComponent
Constructor Details
#initialize(variant: :default, **attrs) ⇒ EmptyMedia
Returns a new instance of EmptyMedia.
6 7 8 9 |
# File 'app/components/phlex_kit/empty/empty_media.rb', line 6 def initialize(variant: :default, **attrs) @variant = variant.to_sym @attrs = attrs end |
Instance Method Details
#view_template ⇒ Object
10 11 12 |
# File 'app/components/phlex_kit/empty/empty_media.rb', line 10 def view_template(&) div(**mix({ class: [ "pk-empty-media", fetch_option(VARIANTS, @variant, :variant) ].compact.join(" ") }, @attrs), &) end |