
Product
Introducing Module Reachability: Focus on the Vulnerabilities That Matter
Module Reachability filters out unreachable CVEs so you can focus on vulnerabilities that actually matter to your application.
@paprika/avatar
Advanced tools
Avatar component represents an object or entity and displays initials or icon.
Avatar component represents an object or entity and displays initials or icon.
yarn add @paprika/avatar
or with npm:
npm install @paprika/avatar
Prop | Type | required | default | Description |
---|---|---|---|---|
children | node | false | null | Avatar content. It can be initial as a string or icon |
backgroundColor | string | false | null | Background color of the Avatar |
color | string | false | null | Color for the initial or icon |
isRound | bool | false | false | Shape of the Avatar |
size | [ Avatar.types.size.SMALL, Avatar.types.size.MEDIUM, Avatar.types.size.LARGE] | false | Avatar.types.size.LARGE | Size of Avatar |
Avatar
component represents an object or entity and displays initials or icon.
By default, Avatar component sets the background and text color using the getAvatarColor
function with the children props value as the parameter.
import Avatar from "@paprika/avatar";
<Avatar>Terry Fox</Avatar>;
Access getAvatarColors
import Avatar from "@paprika/avatar";
import { getAvatarColors } from "@paprika/avatar/lib/helpers";
const color = getAvatarColors("Terry Fox");
<Avatar backgroundColor={color.backgroundColor} color={color.fontColor}>
Terry Fox
</Avatar>;
Set custom size, background and text color
import Avatar from "@paprika/avatar";
<Avatar backgroundColor="black" color="white" size="small">
Terry Fox
</Avatar>;
FAQs
Avatar component represents an object or entity and displays initials or icon.
The npm package @paprika/avatar receives a total of 881 weekly downloads. As such, @paprika/avatar popularity was classified as not popular.
We found that @paprika/avatar demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers 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.
Product
Module Reachability filters out unreachable CVEs so you can focus on vulnerabilities that actually matter to your application.
Company News
Socket is bringing best-in-class reachability analysis into the platform — cutting false positives, accelerating triage, and cementing our place as the leader in software supply chain security.
Product
Socket is introducing a new way to organize repositories and apply repository-specific security policies.