feat(avatar): add RuiAvatar and RuiAvatarGroup components#518
Merged
kelsos merged 1 commit intorotki:mainfrom Apr 27, 2026
Merged
feat(avatar): add RuiAvatar and RuiAvatarGroup components#518kelsos merged 1 commit intorotki:mainfrom
kelsos merged 1 commit intorotki:mainfrom
Conversation
Image-first avatar with initials/icon/slot fallback, six size tokens (xs–2xl) plus arbitrary numeric sizes, three variants (circular, rounded, square), and context-color theming. RuiAvatarGroup overlaps children with a configurable spacing token, slices to `max`, and renders a `+N` surplus that respects an optional `total` override. Group provides size/variant via injection so children inherit unless explicitly overridden.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #518 +/- ##
==========================================
+ Coverage 84.60% 84.87% +0.26%
==========================================
Files 139 143 +4
Lines 5066 5209 +143
Branches 1507 1553 +46
==========================================
+ Hits 4286 4421 +135
- Misses 780 788 +8 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
RuiAvatarwith image-first rendering, initials/icon/slot fallback, six size tokens (xs–2xl) plus arbitrary numeric sizes, three variants (circular/rounded/square), and context-color theming.RuiAvatarGroupthat overlaps children with a configurable spacing token, slices tomaxwith a+Nsurplus (overridable viatotalor thesurplusslot), and provides size/variant to children via injection./avatars), Storybook stories, and Playwright e2e coverage.Closes #144
Test plan
pnpm run typecheckpnpm --filter @rotki/ui-library run test:run(28 avatar unit tests pass)pnpm run build:prodPLAYWRIGHT_CHROMIUM_PATH=/usr/bin/chromium pnpm test:e2e avatar.spec.ts(10/10 pass)pnpm run storybook) — Default, WithImage, Initials, WithIcon, BrokenImage, Sizes, Variants, Colors, NumericSize, WithStatusBadge/avatarsexample page across sizes, variants, colors, and group cases