Import
import {
Avatar ,
AvatarImage ,
AvatarFallback
} from '@strongtie/design-system/avatar' ;
Usage
< Avatar >
< AvatarImage src = "/images/avatar.png" alt = "Avatar" />
< AvatarFallback > S </ AvatarFallback >
</ Avatar >
<Avatar> PropsRender the avatar as a child of another element.
<AvatarImage> PropsAlternate text for the image. Required for accessibility.
Render the image as a child of another element.
<AvatarFallback> PropsChange the default rendered element for the one passed as a child
Delay (in milliseconds) before rendering the fallback. Useful to avoid flashes for users with slow connections.
Usage Examples Basic
With Fallback
Initials Only
Custom Class
< Avatar >
< AvatarImage src = "/images/avatar.png" alt = "Avatar" />
< AvatarFallback > S </ AvatarFallback >
</ Avatar >
Styling Classes The following CSS classes are applied by the components:
avatar – Root avatar container (Avatar)
avatar-image – Image element (AvatarImage)
avatar-fallback – Fallback element (AvatarFallback)
For more examples, visit the Storybook . < StudsAvatar Image = "https://images.unsplash.com/photo-1740252117070-7aa2955b25f8?&w=128&h=128&dpr=2&q=80" />
< StudsAvatar Text = "JD" />
<StudsAvatar> ParametersGets or sets the image source URL for the avatar.
Gets or sets the text to display when no image is provided. Typically initials or a short identifier.
Gets or sets the alternate text for the image, used for accessibility.
Attributes
Dictionary<string, object>
Specifies additional custom attributes that will be rendered by the component.
MouseEnter
EventCallback<ElementReference>
Gets or sets the callback that is invoked when the mouse enters an item.
MouseLeave
EventCallback<ElementReference>
Gets or sets the callback that is invoked when the mouse leaves an item.
A callback that will be invoked when the user right-clicks the component. Commonly used to display a context menu.
Culture
CultureInfo
default: "CultureInfo.CurrentCulture"
Gets or sets the culture used to display localizable data (numbers, dates). Set by default to “CultureInfo.CurrentCulture”.
Gets or sets the inline CSS style.
Gets or sets a value indicating whether this “T:Studs.StudsComponent” is visible. Invisible components are not rendered.
Usage Examples Image Only
Text Fallback
Image with AlternateText
< StudsAvatar Image = "https://images.unsplash.com/photo-1740252117070-7aa2955b25f8?&w=128&h=128&dpr=2&q=80" />
Styling Classes The following CSS class is applied by the component:
avatar – Root avatar container
For more examples, visit the Storybook .