Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add size context for Avatar #2020

Open
ogonkov opened this issue Dec 25, 2024 · 0 comments
Open

Add size context for Avatar #2020

ogonkov opened this issue Dec 25, 2024 · 0 comments

Comments

@ogonkov
Copy link
Contributor

ogonkov commented Dec 25, 2024

That would be nice to have optional context, that could be used to sync Avatar sizes inside some common component, for example in AvatarStack

AvatarProvider.tsx

const AvatarProvider = ({size, children}: Props) => {
  return <AvatarContext.Provider value={{size}}>{children}</AvatarContext.Provider>;
}

Avatar.tsx

const Avatar = ({size = 'm'}) => {
  const avatarSize = useAvatarContext() || size;

  //
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant