@atlaskit/avatar
Version:
An avatar is a visual representation of a user or entity.
16 lines • 432 B
JavaScript
import { createContext, useContext } from 'react';
/**
* __Avatar context__
*
* This allows setting the size of all avatars under a context provider.
*
* ```tsx
* <AvatarContext.Provider value={{ size: 'small' }}>
* <Avatar
* // ...props
* />
* </AvatarContext.Provider>
* ```
*/
export const AvatarContext = /*#__PURE__*/createContext(undefined);
export const useAvatarContext = () => useContext(AvatarContext);