Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
@s-ui/react-molecule-avatar
Advanced tools
Readme
The Avatar component is the representation of a user.
$ npm install @s-ui/react-molecule-avatar
import MoleculeAvatar from '@s-ui/react-molecule-avatar'
return <MoleculeAvatar />
@import '~@s-ui/theme/lib/index';
// @import 'your theme';
@import '~@s-ui/react-molecule-avatar/lib/index';
If no name
or src
is set, a default icon will be displayed by default, it can be customized using fallbackIcon
prop
import MoleculeAvatar from '@s-ui/react-molecule-avatar'
const FallbackIconStory = () => (
<>
<MoleculeAvatar />
<MoleculeAvatar fallbackIcon={<Icon />} />
</>
)
If name
is set but src
is not the initials of the name will be used to generate a accessible background color
import MoleculeAvatar from '@s-ui/react-molecule-avatar'
const FallbackNameStory = () => (
<>
<MoleculeAvatar name="Jon Snow" />
</>
)
Modify the size of the avatar with size
prop. Choose between xsmall
, small
, medium
, large
, xlarge
and xxlarge
import MoleculeAvatar, {AVATAR_SIZES} from '@s-ui/react-molecule-avatar'
const SizeStory = () => (
<>
<MoleculeAvatar size={USER_AVATAR_SIZES.XSMALL} />
<MoleculeAvatar size={USER_AVATAR_SIZES.SMALL} />
<MoleculeAvatar size={USER_AVATAR_SIZES.MEDIUM} />
<MoleculeAvatar size={USER_AVATAR_SIZES.LARGE} />
<MoleculeAvatar size={USER_AVATAR_SIZES.XLARGE} />
<MoleculeAvatar size={USER_AVATAR_SIZES.XXLARGE} />
</>
)
If src
is set an image will be displayed, if it fails one of the fallbacks will be used instead.
import MoleculeAvatar from '@s-ui/react-molecule-avatar'
const ImageStory = () => (
<>
<MoleculeAvatar name="Jon Snow" src="https://www.images/jon_snow.png" />
</>
)
Use MoleculeAvatar.Badge
component to display a status badge.
import MoleculeAvatar from '@s-ui/react-molecule-avatar'
const BadgeStory = () => (
<>
<MoleculeAvatar name="Jon Snow">
<MoleculeAvatar.Badge />
</MoleculeAvatar>
</>
)
Find full description and more examples in the demo page.
FAQs
The Avatar component is the representation of a user.
The npm package @s-ui/react-molecule-avatar receives a total of 1,029 weekly downloads. As such, @s-ui/react-molecule-avatar popularity was classified as popular.
We found that @s-ui/react-molecule-avatar demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.