Ir al contenido
uiify

Avatar

Named image or fallback initials for a person.

Navegadores
Chrome 123+Firefox 121+Safari 17.5+
Nivel
0
Tamaño comprimido
293 B
Presupuesto de diseño forzado
0 ms
Presupuesto de axe
0
Compatible con SSR
Sí
Contrato publicado
Entorno de pruebas

Zona de pruebas

Avatar

Ada Lovelace

Ejemplos

Sizes

The root exposes its size through data-size.

Ada Lovelace
import { Avatar } from "@gunkin/uiify";

export default function Example() {
  return (
    <>
      <Avatar aria-hidden="true" name="Ada Lovelace" fallback="AL" size="sm" />
      <Avatar aria-hidden="true" name="Ada Lovelace" fallback="AL" size="md" />
      <Avatar aria-hidden="true" name="Ada Lovelace" fallback="AL" size="lg" />
      <span>Ada Lovelace</span>
    </>
  );
}

API

Avatar

PropTipoPredeterminadoDescripción
name*string—Accessible name for the person represented by the avatar.
fallback*string—Text shown when src is omitted; provide meaningful initials or a short name.
srcstring—Image URL; the image is rendered only when supplied.
size"sm" | "md" | "lg"—Visual scale written to data-size; omitted when unset.
aria-hidden"true"—Hide the avatar from assistive technology when adjacent visible text already names the person.
classNamestring—Clase aplicada al elemento raíz.
styleCSSProperties—Native root styles.
refRef<HTMLElement>—Ref forwarded to the rendered root element.
renderReactElement | ((props, state) => ReactElement)—Reemplaza el elemento renderizado y conserva las conexiones de comportamiento y accesibilidad.

Teclado

TeclaAcción

Accesibilidad

The root is named as an image and the fallback is hidden from assistive technology. Keep a visible name beside decorative avatars and set aria-hidden when that text already names the person. A supplied src renders an image; image-load failures do not trigger a replacement fallback.

Puntos de estilo

data-uiify-avatardata-partdata-size
Esta página se tradujo automáticamente y aún no se ha revisado.