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.
react-metamask-avatar
Advanced tools
Readme
Statements | Branches | Functions | Lines |
---|---|---|---|
🤡 A React component for rendering MetaMask avatars based on account address
The MetaMaskAvatar
component is a React functional component that takes in a required address
property of type string
and an optional size
property of type number
. It returns an image avatar of the given Ethereum address provided as a string and renders it within an AvatarWrapper
component, which can be styled using the className
property.
Hosted storybook
npm install react-metamask-avatar
yarn add react-metamask-avatar
The required address property is a string of length 42 that represents an Ethereum address. If it is not provided or does not meet the expected length, the component returns null.
The optional size property is a number that sets the size of the avatar image in pixels. If not provided, it defaults to 24.
The optional className property is a string that allows for custom styling using the AvatarWrapper component. It will be added to the className prop of the AvatarWrapper component.
import React from 'react';
import { MetaMaskAvatar } from 'react-metamask-avatar';
export const App: React.FunctionComponent = () => {
return (
<MetaMaskAvatar address="0xb01F14d1C9000D453241221EB54648F1C378c970" size={24} />
)
}
Under the hood react-metamask-avatar
uses @emotion/styled
. Therefore, following a guide
for custom styling emotion elements is the way to go.
Example:
import React from 'react';
import { MetaMaskAvatar } from 'react-metamask-avatar';
const SquareMetaMaskAvatar = styled(MetaMaskAvatar)`
border-radius: none;
`;
export const App: React.FunctionComponent = () => {
return (
<SquareMetaMaskAvatar address="0xb01F14d1C9000D453241221EB54648F1C378c970" size={24} />
)
}
FAQs
A React component for rendering MetaMask avatars based on account address
The npm package react-metamask-avatar receives a total of 1,011 weekly downloads. As such, react-metamask-avatar popularity was classified as popular.
We found that react-metamask-avatar demonstrated a healthy version release cadence and project activity because the last version was released less than 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.