Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Add a placeholder prop to the Avatar component

Aperta
#8,464 4 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

@SimonGebru ci sta già lavorando.

Dal 12/10/2026.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
68/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
react, typescript
Ambito
frontend

Direzione di ricerca

Start by locating the Avatar component and its existing tests, then read how src, size, and square shape are currently handled. Add coverage for text placeholders at different sizes, confirm images take precedence when src is present, and verify the placeholder is centered and follows the existing shape.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Feature request

Add an optional placeholder prop to Avatar so it can display text, such as an initial or short label, when no image URL is provided.

For example:

Avatar placeholders displaying S, M, L, XL, and XXL at different sizes

<Avatar placeholder="S" size={24} />
<Avatar placeholder="M" size={32} />
<Avatar placeholder="L" size={40} />
<Avatar placeholder="XL" size={56} />
<Avatar placeholder="XXL" size={72} />

The placeholder should be centered inside the avatar and scale appropriately with size. It should follow the existing circular or square shape. When src is provided, the image should take precedence.

Motivation

The current Avatar renders an <img> and requires src, so there is no built-in way to show a text avatar for a user who has no profile image. A placeholder prop would let applications use the same component and sizing API for both image and text avatars, as shown in the attached example.

Lingua principale
TypeScript
Stelle
3.9k
Fork
697
Merge medio
3g 12h
PR unite (30g)
51

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

  • Nessun Dockerfile né file Docker Compose
  • Ha un modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di primer/react

Tutte le issue di primer/react

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.