LobeChatLobeHub
UI
Components
Chat
Mobile
Awesome
Brand
Mdx
Color
Changelog
Ctrl K
General
ActionIcon
ActionIconGroup
Icon
FileTypeIcon
MaterialFileTypeIcon
Data Display
Avatar
Collapse
EmptyCard
FluentEmoji
Highlighter
Image
List
Markdown
Mermaid
Snippet
SortableList
Tag
Tooltip
Video
Data Entry
CodeEditor
ContextMenu
CopyButton
EditableText
EmojiPicker
Form
FormModal
Input
SearchBar
SelectWithImg
SliderWithInput
Swatches
ThemeSwitch
Feedback
Alert
Modal
Layout
DraggablePanel
Footer
Grid
Header
Layout
Navigation
Burger
SideNav
TabsNav
Toc
Theme
ConfigProvider
FontLoader
ThemeProvider

Avatar

Avatar is a component that displays a user's profile picture or initials. It can be customized with props like size, shape, background color, and image source. If no image source is provided, it will display the user's initials. This component is typically used in user profile pages, comment sections, or messaging applications.

import { Avatar } from '@lobehub/ui';
NPM
UNPKG
BundlePhobia
PackagePhobia
Anvaka Graph
Source
Edit
Previous
MaterialFileTypeIcon
Next
Collapse

Resources

Lobe UI-AIGC Components
Lobe Icon-AI / LLM Icon Collection
Lobe Charts-Modern Charts
Lobe TTS-TTS / STT Library

Community

Report Bug
Request Feature

Help

GitHub
Changelog

More Products

🤯 Lobe Chat-AI / LLM Chat Framework
🧸 Lobe Vidol-Virtual Idols for EveryOne
🅰️ Lobe Theme-Stable Diffusion Extension
🌐 Lobe i18n-AI i18next CLI
Copyright © 2022-2025
Made with 🤯 by LobeHub
LobeHub

Default

ReactNode

Emoji

APIs

NameDescriptionTypeDefault
animation--boolean--
avatarThe URL or base64 data of the avatar imagestring|ReactNode--
backgroundThe background color of the avatarstring--
shapeThe shape of the avatar"circle"|"square""circle"
sizeThe size of the avatar in pixelsnumber40
titleThe title text to display if avatar is not providedstring--
unoptimized--boolean--
gap--number--
srcSrc of image avatarReactNode--
srcSetSrcset of image avatarstring--
draggable--boolean|true|false--
iconIcon to be used in avatarReactNode--
style--{}--
prefixCls--string--
className--string--
rootClassName--string--
children--ReactNode--
alt--string--
crossOrigin--""|"anonymous"|"use-credentials"--
onClick--(e?:React.MouseEvent<HTMLElement, MouseEvent>)=>void--
onError--()=>boolean--
refAllows getting a ref to the component instance. Once the component unmounts, React will set `ref.current` to `null` (or call the ref with `null` if you passed a callback ref).|bivarianceHack|RefObject--
key--Key|--
cm
📺