Add a placeholder prop to the Avatar component
Maintainer thường phản hồi trong vòng 2 ngày
@SimonGebru đang làm issue này rồi.
Từ ngày 12/10/2026.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 68/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- react, typescript
- Lĩnh vực
- frontend
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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 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.
- Ngôn ngữ chính
- TypeScript
- Star
- 3.9k
- Fork
- 697
- Merge trung bình
- 3 ngày 21 giờ
- Pull request đã merge (30 ngày)
- 51
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Không có hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của primer/react
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
primer/react#8561 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
PageHeader.Title does not seem to accept id propCó thể đã có người làm @TylerJDev đã nhận 4 ngày trước. Đang mởcomponent: PageHeader react staff
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
primer/react#8474 · 1 bình luận · 1 reaction · 1 người được giao ·
Maintainer thường phản hồi trong vòng 2 ngày
-
The padding prop seems to have no effect with PageLayout.SidebarCó thể đã có người làm @minwookshin đã nhận 15 ngày trước. Đang mởcomponent: PageLayout react staff
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
primer/react#8470 · 1 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 2 ngày
-
bug component: Spinner react
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
primer/react#8423 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Low contrast in SelectĐang mởwaiting for author response
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
primer/react#8172 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
Issue tương tự
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 75/100
siyuan-note/siyuan#20629 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Volume eject does not refuse system, root or /home mountsCó thể đã có người làm @bernardopg đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
spacedriveapp/spacedrive#3159 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
melgarafael/DeskcommCRM#3000 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
callstackincubator/simlock#639 ·
Maintainer thường phản hồi trong vòng 1 ngày