File tree Expand file tree Collapse file tree 2 files changed +41
-0
lines changed
Sources/ComponentsKit/Components/AvatarGroup/Models Expand file tree Collapse file tree 2 files changed +41
-0
lines changed Original file line number Diff line number Diff line change 1+ import UIKit
2+
3+ /// A model that defines the appearance properties for an avatar group component.
4+ public struct AvatarGroupVM : ComponentVM {
5+ /// The color of the placeholder.
6+ public var color : ComponentColor ?
7+
8+ /// The corner radius of the avatar.
9+ ///
10+ /// Defaults to `.full`.
11+ public var cornerRadius : ComponentRadius = . full
12+
13+ /// The array of avatars in the group.
14+ public var items : [ AvatarItemVM ] = [ ]
15+
16+ /// The maximum number of visible avatars
17+ ///
18+ /// Defaults to `5`.
19+ public var maxVisibleAvatars : Int = 5
20+
21+ /// The predefined size of the avatar.
22+ ///
23+ /// Defaults to `.medium`.
24+ public var size : ComponentSize = . medium
25+
26+ /// Initializes a new instance of `AvatarVM` with default values.
27+ public init ( ) { }
28+ }
Original file line number Diff line number Diff line change 1+ import UIKit
2+
3+ /// A model that defines the appearance properties for an avatar in the group.
4+ public struct AvatarItemVM : ComponentVM {
5+ /// The source of the image to be displayed.
6+ public var imageSrc : AvatarVM . ImageSource ?
7+
8+ /// The placeholder that is displayed if the image is not provided or fails to load.
9+ public var placeholder : AvatarVM . Placeholder = . icon( " avatar_placeholder " , Bundle . module)
10+
11+ /// Initializes a new instance of `AvatarItemVM` with default values.
12+ public init ( ) { }
13+ }
You can’t perform that action at this time.
0 commit comments