Class: LightningUiKit::AvatarComponent
- Inherits:
-
BaseComponent
- Object
- ViewComponent::Base
- BaseComponent
- LightningUiKit::AvatarComponent
- Defined in:
- app/components/lightning_ui_kit/avatar_component.rb
Constant Summary collapse
- SIZE_CLASSES =
{ sm: "lui:size-6", md: "lui:size-8", lg: "lui:size-10" }
Instance Method Summary collapse
-
#initialize(url: nil, size: :md, initials: nil, square: false, alt: nil, **options) ⇒ AvatarComponent
constructor
A new instance of AvatarComponent.
Methods inherited from BaseComponent
Methods included from HeroiconHelper
Constructor Details
#initialize(url: nil, size: :md, initials: nil, square: false, alt: nil, **options) ⇒ AvatarComponent
Returns a new instance of AvatarComponent.
10 11 12 13 14 15 16 17 18 19 |
# File 'app/components/lightning_ui_kit/avatar_component.rb', line 10 def initialize(url: nil, size: :md, initials: nil, square: false, alt: nil, **) raise ArgumentError, "url or initials must be provided" if url.nil? && initials.nil? @url = url @size = size @initials = initials @square = square @alt = alt @options = end |