Socket
Socket
Sign inDemoInstall

@paprika/avatar

Package Overview
Dependencies
92
Maintainers
4
Versions
62
Alerts
File Explorer

Advanced tools

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.


Version published
Maintainers
4
Created

Readme

Source

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>;

FAQs

Last updated on 07 Jul 2020

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc