Avatar

Description

A small round image with an initials fallback.

Usage

bc_avatar(
  ...,
  src = NULL,
  alt = NULL,
  fallback = NULL,
  size = "default",
  badge = NULL
)

bc_avatar_group(..., count = NULL)

bc_avatar_badge(...)

Arguments

Argument Description
... Tag attributes and children, passed to htmltools::span().
src String. The image URL, or NULL for initials only.
alt String. Alt text for the image.
fallback String. Initials or short text shown when the image is absent.
size String. One of default, sm, lg. default writes no attribute.
badge A bc_avatar_badge(), or NULL.
count Text or an icon shown after the last avatar, or NULL.

Value

A <span> tag.

Examples

bc_avatar(src = "https://github.com/shadcn.png", alt = "@shadcn", fallback = "CN")
@shadcnCN

bc_avatar(fallback = "JP", size = "lg")
JP

bc_avatar_group(
  bc_avatar(fallback = "CN"),
  bc_avatar(fallback = "LR"),
  count = "+3"
)
CN LR +3

bc_avatar(
  fallback = "CN",
  badge = bc_avatar_badge(class = "bg-green-600")
)
CN