Class: PhlexKit::AvatarBadge
- Inherits:
-
BaseComponent
- Object
- Phlex::HTML
- BaseComponent
- PhlexKit::AvatarBadge
- Defined in:
- app/components/phlex_kit/avatar/avatar_badge.rb
Overview
Status dot pinned to a PhlexKit::Avatar's bottom-right corner, ported from shadcn/ui's AvatarBadge. Empty for a plain presence dot, or wrap a small svg glyph (hidden automatically on xs/sm avatars). Recolor via style/class — defaults to the brand fill. See avatar.rb.
Instance Method Summary collapse
-
#initialize(**attrs) ⇒ AvatarBadge
constructor
A new instance of AvatarBadge.
- #view_template(&block) ⇒ Object
Methods inherited from BaseComponent
Constructor Details
#initialize(**attrs) ⇒ AvatarBadge
Returns a new instance of AvatarBadge.
7 8 9 |
# File 'app/components/phlex_kit/avatar/avatar_badge.rb', line 7 def initialize(**attrs) @attrs = attrs end |
Instance Method Details
#view_template(&block) ⇒ Object
11 12 13 |
# File 'app/components/phlex_kit/avatar/avatar_badge.rb', line 11 def view_template(&block) span(**mix({ class: "pk-avatar-badge" }, @attrs), &block) end |