Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@paprika/avatar

Package Overview
Dependencies
Maintainers
3
Versions
62
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.15
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.1K
decreased by-10.87%
Maintainers
3
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 11 Jun 2022

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc