Skip to main content
K
Last modified: 24/Jun/2024

Avatar

#Usage

import { Avatar } from '@kinsta/stratus' const MyComponent = () => ( <> <Avatar size="l" isRounded isKinstaStaff src="https://vignette.wikia.nocookie.net/shaniverse/images/7/71/Boba.jpg/revision/latest/scale-to-width-down/2000?cb=20200812025700" /> </> )

#Props

The Avatar components interface extends the HTMLDivElement interface. So you can use any props which documented there. Also, you can utilize all the React Synthetic events (on*), and props related to styling (className, style).

#src
string
Set the url of the image displayed as Avatar
#altText
string
Adds an alt-text to the image tag
#size
AvatarSize
Set the size of the Avatar
m
#isRounded
boolean
Set the border radius style of the input
true
#isKinstaStaff
boolean
Set whether to display a Kinsta icon at the bottom right side of the Avatar
false
#isLoading
boolean
Set whether to display a loading state
false

#Types

  • AvatarProps: props of the Avatar component processed by stratus
  • AvatarInterface: AvatarProps extended by HTMLAttributes<HTMLDivElement>

Read more about types here


#See also