🚀 Socket Launch Week 🚀 Day 3: Socket Acquires Coana.Learn More
Socket
Sign inDemoInstall
Socket

@paprika/avatar

Package Overview
Dependencies
Maintainers
4
Versions
64
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@paprika/avatar

Avatar component represents an object or entity and displays initials or icon.

2.2.19
latest
Source
npm
Version published
Weekly downloads
1.1K
-16.5%
Maintainers
4
Weekly downloads
 
Created
Source

@paprika/avatar

Description

Avatar component represents an object or entity and displays initials or icon.

Installation

yarn add @paprika/avatar

or with npm:

npm install @paprika/avatar

Props

Avatar

PropTyperequireddefaultDescription
childrennodefalsenullAvatar content. It can be initial as a string or icon
backgroundColorstringfalsenullBackground color of the Avatar
colorstringfalsenullColor for the initial or icon
isRoundboolfalsefalseShape of the Avatar
size[ Avatar.types.size.SMALL, Avatar.types.size.MEDIUM, Avatar.types.size.LARGE]falseAvatar.types.size.LARGESize of Avatar

Avatar

Avatar component represents an object or entity and displays initials or icon.

Usage

By default, Avatar component sets the background and text color using the getAvatarColorfunction 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>;
  • Storybook Showcase
  • GitHub source code
  • Create GitHub issue
  • CHANGELOG

FAQs

Package last updated on 29 Mar 2025

Did you know?

Socket

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.

Install

Related posts