Class: PhlexKit::AvatarFallback
- Inherits:
-
BaseComponent
- Object
- Phlex::HTML
- BaseComponent
- PhlexKit::AvatarFallback
- Defined in:
- app/components/phlex_kit/avatar/avatar_fallback.rb
Overview
The fallback shown when a PhlexKit::Avatar has no image (or it fails to load) — typically the user's initials. See avatar.rb.
Instance Method Summary collapse
-
#initialize(**attrs) ⇒ AvatarFallback
constructor
A new instance of AvatarFallback.
- #view_template(&block) ⇒ Object
Methods inherited from BaseComponent
Constructor Details
#initialize(**attrs) ⇒ AvatarFallback
Returns a new instance of AvatarFallback.
5 6 7 |
# File 'app/components/phlex_kit/avatar/avatar_fallback.rb', line 5 def initialize(**attrs) @attrs = attrs end |
Instance Method Details
#view_template(&block) ⇒ Object
9 10 11 |
# File 'app/components/phlex_kit/avatar/avatar_fallback.rb', line 9 def view_template(&block) span(**mix({ class: "pk-avatar-fallback", data: { phlex_kit__avatar_target: "fallback" } }, @attrs), &block) end |