feat: Add fallbackClassName prop to AvatarGroupItem#6
Merged
robdimarco-atxp merged 2 commits intomainfrom Jan 26, 2026
Merged
Conversation
Add separate fallbackClassName prop for better control over avatar colors. Problem: AvatarGroupItem was passing the same className to both Avatar container and AvatarFallback, causing class conflicts. Background colors intended for the fallback were also being applied to the container, and vice versa (border classes on fallback). Solution: Add fallbackClassName prop specifically for AvatarFallback styling. - className → Avatar container (border, sizing) - fallbackClassName → AvatarFallback (background, text color) - Default bg-muted text-foreground remains for when no fallbackClassName provided Benefits: - Clear separation of concerns (container vs fallback styling) - No class conflicts between container and fallback - Explicit API makes usage intent clear - Fallback won't be blank when no custom color provided Breaking change: No - existing usage with className still works, just passes to container only. Components relying on className for fallback colors should migrate to fallbackClassName.
Add two new stories demonstrating fallbackClassName prop usage: - CustomColors: Shows vivid colors with white text contrast - CustomBordersAndColors: Shows separating container (borders) from fallback (colors) Also update all existing stories to use fallbackClassName instead of className for background colors, following the new API pattern.
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.
Problem
AvatarGroupItem was passing the same
classNameto both the Avatar container and AvatarFallback, causing class conflicts:bg-indigo-500) were also being applied to the containerborder-2 border-surface-primary) were also being applied to the fallbackSolution
Add a separate
fallbackClassNameprop specifically for AvatarFallback styling:className→ Avatar container (border, sizing, positioning)fallbackClassName→ AvatarFallback (background, text color)The default
bg-muted text-foregroundremains in AvatarFallback, so it won't be blank when nofallbackClassNameis provided.Benefits
classNamestill worksExample Usage
Breaking Change
No - This is additive. Existing usage with
classNamestill works, but components that were relying onclassNameto style the fallback should migrate tofallbackClassNamefor clarity.Test Plan
fallbackClassName