Class: NitroKit::AvatarStack
- Defined in:
- app/components/nitro_kit/avatar_stack.rb
Instance Attribute Summary collapse
-
#size ⇒ Object
readonly
Returns the value of attribute size.
Attributes inherited from Component
Instance Method Summary collapse
- #avatar(*args, **attrs, &block) ⇒ Object
-
#initialize(size: :md, **attrs) ⇒ AvatarStack
constructor
A new instance of AvatarStack.
- #view_template ⇒ Object
Methods inherited from Component
Constructor Details
#initialize(size: :md, **attrs) ⇒ AvatarStack
Returns a new instance of AvatarStack.
5 6 7 8 9 |
# File 'app/components/nitro_kit/avatar_stack.rb', line 5 def initialize(size: :md, **attrs) @size = size super(attrs) end |
Instance Attribute Details
#size ⇒ Object (readonly)
Returns the value of attribute size.
11 12 13 |
# File 'app/components/nitro_kit/avatar_stack.rb', line 11 def size @size end |
Instance Method Details
#avatar(*args, **attrs, &block) ⇒ Object
19 20 21 |
# File 'app/components/nitro_kit/avatar_stack.rb', line 19 def avatar(*args, **attrs, &block) render(Avatar.new(*args, size:, **attrs, &block)) end |
#view_template ⇒ Object
13 14 15 16 17 |
# File 'app/components/nitro_kit/avatar_stack.rb', line 13 def view_template div(**mattr(attrs, class: "flex items-center -space-x-3 [&>div]:ring-2 [&>div]:ring-background")) do yield end end |