2.2.18 • Published 2 years ago

@paprika/avatar v2.2.18

Weekly downloads
1,076
License
MIT
Repository
github
Last release
2 years ago

@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.LARGEfalseAvatar.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>;

Links

2.2.18

2 years ago

2.2.18-next.0

2 years ago

2.2.17

2 years ago

2.2.17-next.0

2 years ago

2.2.15

3 years ago

2.2.16

2 years ago

2.2.16-next.0

2 years ago

2.2.15-next.0

3 years ago

2.2.14

3 years ago

2.2.14-next.0

3 years ago

2.2.14-next.1

3 years ago

2.2.13

3 years ago

2.2.13-next.1

3 years ago

2.2.13-next.0

3 years ago

2.2.13-next.2

3 years ago

2.2.12

3 years ago

2.2.12-next.1

3 years ago

2.2.12-next.0

3 years ago

2.2.11

3 years ago

2.2.11-next.2

3 years ago

2.2.11-next.1

3 years ago

2.2.11-next.0

3 years ago

2.2.10

3 years ago

2.2.9

3 years ago

2.2.10-next.0

3 years ago

2.2.9-next.0

3 years ago

2.2.8

3 years ago

2.2.8-next.0

3 years ago

2.2.7

3 years ago

2.2.7-next.0

3 years ago

2.2.6

3 years ago

2.2.6-next.0

3 years ago

2.2.5

4 years ago

2.2.5-next.0

4 years ago

2.2.4

4 years ago

2.2.4-alpha.2

4 years ago

2.2.4-alpha.0

4 years ago

2.2.4-alpha.1

4 years ago

2.2.3

4 years ago

2.2.3-alpha.0

4 years ago

2.2.2

4 years ago

2.2.1

4 years ago

2.2.1-alpha.0

4 years ago

2.2.0

4 years ago

2.1.1-alpha.0

4 years ago

2.1.0

4 years ago

2.0.0

4 years ago

1.1.1-alpha.0

4 years ago

1.1.0

4 years ago

1.0.1-alpha.0

4 years ago

1.0.0

4 years ago

0.1.8

4 years ago

0.1.8-alpha.1

4 years ago

0.1.8-alpha.0

4 years ago

0.1.7

4 years ago

0.1.6

4 years ago

0.1.5

4 years ago

0.1.4

4 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

5 years ago