Class: DaisyUI::AvatarGroup
- Inherits:
-
BaseComponent
- Object
- ViewComponent::Base
- BaseComponent
- DaisyUI::AvatarGroup
- Defined in:
- app/components/daisy_ui/data_display/avatar_group.rb
Overview
Avatar group component that displays a collection of avatars with customizable styling
Constant Summary collapse
- SIZES =
Avatar::SIZES
- SHAPES =
Avatar::SHAPES
- DEFAULT_SPACING =
1.5
Instance Method Summary collapse
-
#call ⇒ String
Rendered HTML for the avatar group.
-
#initialize(size: nil, shape: nil, spacing: DEFAULT_SPACING, max_display: nil, **system_arguments) ⇒ AvatarGroup
constructor
Initializes a new Avatar Group component.
Constructor Details
#initialize(size: nil, shape: nil, spacing: DEFAULT_SPACING, max_display: nil, **system_arguments) ⇒ AvatarGroup
Initializes a new Avatar Group component
39 40 41 42 43 44 45 46 |
# File 'app/components/daisy_ui/data_display/avatar_group.rb', line 39 def initialize(size: nil, shape: nil, spacing: DEFAULT_SPACING, max_display: nil, **system_arguments) @size = size @shape = shape @spacing = spacing.to_f @max_display = max_display&.to_i super(**system_arguments) end |
Instance Method Details
#call ⇒ String
49 50 51 52 53 54 55 56 |
# File 'app/components/daisy_ui/data_display/avatar_group.rb', line 49 def call tag.div(**html_attributes) do content = [] content.concat(displayed_avatars) content << render_counter if remaining_count safe_join(content) end end |