Skip to main content

Avatar

Rocket 2.0

The Avatar component shows a person's photo, or their initials when there is no photo. With several names it shows an overlapping stack, such as the members of a team.

Properties​

Property
Description
Expected Value
Names (one or many; or [{ name, src }])The people to show: one name, a comma-separated list, or a list of { name, src } objects where src is a photo URL.Text. Default: Ada Lovelace
Image URL (single avatar)Photo URL used when Names holds a single person without their own photo.Text
Size (px)Width and height of each avatar in pixels. The avatar never grows past the component's height.Text. Default: 32
Most avatars shown (rest as +N)How many avatars to show before the rest are grouped as +N.Number. Default: 5
Image URL (when Names is empty)Photo URL for the single person set in Name when Names is empty.Text
Name (when Names is empty)Name of a single person, used when Names is empty.Text
SubtitleSecond line shown under the name when Show name and subtitle is on, such as a job title.Text
Show name and subtitleShows the person's name and Subtitle next to the avatar. It applies only when one person is shown.On or off. Default: Off
ShapeShape of each avatar: round or square.Circle, Square. Default: Circle
Loading lookWhat shows while the component is loading: a Spinner or a Skeleton placeholder in the component's shape.Spinner, Skeleton. Default: Spinner

Additional Actions​

Each of these can be switched on or off, or set with a logical expression by clicking fx.

Property
Description
Expected Value
VisibilityShows or hides the component. Hidden components keep their space unless Collapse when hidden is on.On or off. Default: On
Collapse when hiddenRemoves the hidden component's space, so the components below it move up.On or off. Default: Off
Loading stateShows the component's loading look and blocks interaction, for example while a query runs.On or off. Default: Off
DisableStops the user from interacting with the component.On or off. Default: Off

Devices​

Property
Description
Expected Value
Show on desktopShows the component in the desktop layout.On or off. Default: On
Show on mobileShows the component in the mobile layout.On or off. Default: Off

Events​

Add a handler from the Events section of the properties panel. See Event Triggers for the steps.

Event
Description
On clickTriggers when the user clicks the avatar.

Component Specific Actions (CSA)​

Run these from an event handler with Control Component, or from a RunJS query. See Component Specific Actions.

Action
Description
How To Access
Set visibilityShows the component when true, hides it when false.components.avatar1.setVisibility(false)
Set disableDisables the component when true, enables it when false.components.avatar1.setDisable(false)
Set loadingTurns the loading state on with true, off with false.components.avatar1.setLoading(false)

Exposed Variables​

Variable
Description
How To Access
namesThe people to show: one name, a comma-separated list, or a list of { name, src } objects where src is a photo URL.{{components.avatar1.names}}
srcPhoto URL used when Names holds a single person without their own photo.{{components.avatar1.src}}
sizeWidth and height of each avatar in pixels. The avatar never grows past the component's height.{{components.avatar1.size}}
maxVisibleHow many avatars to show before the rest are grouped as +N.{{components.avatar1.maxVisible}}
imageUrlPhoto URL for the single person set in Name when Names is empty.{{components.avatar1.imageUrl}}
nameName of a single person, used when Names is empty.{{components.avatar1.name}}
subtitleSecond line shown under the name when Show name and subtitle is on, such as a job title.{{components.avatar1.subtitle}}
showDetailsShows the person's name and Subtitle next to the avatar. It applies only when one person is shown.{{components.avatar1.showDetails}}
shapeShape of each avatar: round or square.{{components.avatar1.shape}}
loadingIndicatorWhat shows while the component is loading: a Spinner or a Skeleton placeholder in the component's shape.{{components.avatar1.loadingIndicator}}
isVisibleWhether the component is visible.{{components.avatar1.isVisible}}
isLoadingWhether the component is in its loading state.{{components.avatar1.isLoading}}
isDisabledWhether the component is disabled.{{components.avatar1.isDisabled}}

Styles​

Style
Default
Initials backgroundTheme: Surface 3
Initials colorTheme: Primary text
Ring color (between stacked avatars)Theme: Surface 1
Initials background (old name)—
Box shadow0px 0px 0px 0px #00000040

A default that starts with Theme: follows the app's theme until the style is set to another value. See App Themes.