Class: KozenetUi::AvatarComponent
- Inherits:
-
BaseComponent
- Object
- ViewComponent::Base
- BaseComponent
- KozenetUi::AvatarComponent
- Defined in:
- app/components/kozenet_ui/avatar_component.rb
Overview
Avatar component for user profiles and images Supports images, initials, and icons with multiple sizes
Constant Summary
Constants inherited from BaseComponent
Instance Attribute Summary
Attributes inherited from BaseComponent
#html_options, #size, #variant
Instance Method Summary collapse
-
#call ⇒ Object
rubocop:enable Metrics/ParameterLists.
-
#initialize(src: nil, alt: "Avatar", initials: nil, variant: :primary, size: :md, html_options: {}) ⇒ AvatarComponent
constructor
rubocop:disable Metrics/ParameterLists.
Constructor Details
#initialize(src: nil, alt: "Avatar", initials: nil, variant: :primary, size: :md, html_options: {}) ⇒ AvatarComponent
rubocop:disable Metrics/ParameterLists
17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'app/components/kozenet_ui/avatar_component.rb', line 17 def initialize( src: nil, alt: "Avatar", initials: nil, variant: :primary, size: :md, html_options: {} ) super(variant: variant, size: size, **) @src = src @alt = alt @initials = initials end |
Instance Method Details
#call ⇒ Object
rubocop:enable Metrics/ParameterLists
32 33 34 35 36 |
# File 'app/components/kozenet_ui/avatar_component.rb', line 32 def call tag.div(**html_attrs) do avatar_content end end |