feat(PageCard/PageCardGroup): add avatar prop with Button.vue pattern#25
Merged
Conversation
- PageCard: new `avatar` prop renders B24Avatar in the leading slot; top-level `icon` keeps precedence (mirrors Button.vue behaviour). Theme gains `leadingAvatar` + `leadingAvatarSize` slots. - PageCardGroup: item gets per-item `avatar` config (full AvatarProps) plus a group-level `:avatar` umbrella default; per-item `avatar.color` merges over the group. Plain `icon` field still works and now scales with the group `size` via the new `leadingIcon` size variants. - Size mapping (PageCardGroup → Avatar / leadingIcon): sm→sm (28px), md→md (32px), lg→lg (42px). Base `leadingAvatarSize` slot left empty so the size variant value is forwarded verbatim — previous `'xl'` base concatenated with the variant value into an invalid `'xl xl'` Avatar size, collapsing the avatar to 0×0. - Docs: new "Icon vs Avatar" section, dedicated `PageCardGroupAvatarExample` per-item palette demo, "Custom leading icon" repositioned as the escape hatch beyond Avatar. - Playgrounds (demo + nuxt): split palette and group-color controls so toggling either actually re-renders (per-item `avatar.color` wins on merge — disable the group-color picker when the item palette is on); add static showcases for per-item palette, group-level avatar color and the plain-icon mode. - Skill recipe (card-pickers): document the icon-vs-avatar choice and the new merging rules. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced May 11, 2026
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
PageCardgains anavatarprop — rendersB24Avatarin the leading slot; top-leveliconkeeps precedence (mirrorsButton.vue). Theme addsleadingAvatar+leadingAvatarSizeslots.PageCardGroupitems accept a fullavatarconfig (color, src, chip, icon) plus a group-level:avatarumbrella default; per-itemavatar.colormerges over the group default. Plain top-leveliconstill works and now scales withsizevia newleadingIconsize variants.size:sm→ 28px,md→ 32px,lg→ 42px. Bug fix: previous'xl'base forleadingAvatarSizeconcatenated with size-variant value into an invalid'xl xl'Avatar size and collapsed the avatar to 0×0.PageCardGroupAvatarExampleper-item palette demo, "Custom leading icon" repositioned as the escape hatch.Test plan
vitest run— 212 files / 4852 tests passnuxt typecheckclean fordocs,playgrounds/demo,playgrounds/nuxteslintclean on changed filessize-7/size-8/size-10.5) per groupsizesize-7/size-8/size-10) per groupsizeAvatar mode,Item palette,Group avatar color; verify both the palette and group-color paths actually update the rendered grid🤖 Generated with Claude Code