Grapes homepage1.57.0
  • Guide
  • Tokens
  • Components
    Grapes on GithubGrapes on Figma
    Interaction
    • Button
    • IconButton
    • FloatingActionBar
    • Link
    Icons
    • Icon
    • HighlightIcon
    Form
    • AmountInput
    • Autocomplete
    • AutocompleteMultiple
    • AutocompletePlace
    • CheckboxBox
    • CheckboxField
    • DatePicker
    • FormField
    • Input
    • OptionGroup
    • PasswordInput
    • PhoneInput
    • RadioBox
    • RadioField
    • RadioGroup
    • Select
    • SwitchField
    • TextArea
    • TextInput
    • Upload
    • UploadButton
    Feedback
    • Badge
    • Banner
    • Callout
    • EmptyState
    • Modal
    • ModalSlideshow
    • DeprecatedModalSlideshow
    • PageModal
    • Skeleton
    • Tag
    • Toast
    • Tooltip
    Data display
    • Accordion
    • Avatar
    • Box
    • Calendar
    • CalendarRange
    • CollapsibleList
    • FileCard
    • InfoTip
    • ListBox
    • ListView
    • Panel
    • SidePanel
    • DeprecatedPreview
    • Table
    • Timeline
    • useDateFormatter
    Navigation
    • DropdownItem
    • DropdownMenu
    • Navigation
    • NavigationItem
    • Popover
    • Tabs

    Avatar

    The Avatar component is used to represent a user or a entity. It displays a picture or a fallback to initials.

    View source code
    • Usage
    • Props
    • Accessibility
    • text
      string

      The text to display whether src is not provided or src is not valid. The text will be truncated to one character. Random colors, based on the truncated text, will be assign automatically as background and text color.

    • badgeProps
      AvatarBadgeProps

      Whether the Avatar should contains a badge

    • className
      string

      className for the element

    • fallbackSrc
      string

      The fallback source to display when src is not provided or src is not valid. If defined, the Avatar component will not fallback on text initials.

    • iconName
      "adjustments-horizontal" | "archive" | "arrow-down-tray" | "arrow-down" | "arrow-left-right" | "arrow-left" | "arrow-merge" | "arrow-path" | "arrow-pointing-out" | "arrow-right-rectangle" | "arrow-right" | "arrow-split" | "arrow-top-right-square" | "arrow-turn-right" | "arrow-up-tray" | "arrow-up" | ... 143 more ...

      The name of the icon to display

    • lazyLoad
      boolean

      Whether the Avatar src should be lazy loaded

      Default: false
    • size
      16 | 24 | 32 | 40 | 56

      Specifies the size of the element.

      Default: 32
    • src
      string

      The image URL

    • variant
      "circle" | "square"

      Whether the Avatar should be square or circle

      Default: circle