1.0.8 • Published 2 years ago

custom-stack-avatar v1.0.8

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

custom-stack-avatar

This component lets you stack images by passing it an array of objects. In it's default style, the component is rendered as

Default Style

The basic usage of the component is

import StackAvatar from "custom-stack-avatar";

const avatarList = [
  {
    id: 0,
    imageUrl: "https://randomuser.me/api/portraits/men/52.jpg",
  },
  {
    id: 1,
    imageUrl: "https://randomuser.me/api/portraits/men/51.jpg",
  },
  {
    id: 2,
    imageUrl: "https://randomuser.me/api/portraits/women/1.jpg",
  },
];

return <StackAvatar faces={avatarList} />;

Note that in the above example, the key is id and the imageUrl is the url link of the image.

Component Configuration

The following props can be configured for this component

PropDescriptionDefault
facesContains the array of objects with each object containing a key with id as number and key imageUrl as url string of imagemandatory prop
numFacesDetermines how many stacked avatars should be displayed4
circleSizesize of each stack avatar20
offsetspace between each avatar(value must be <= 1)1
onHandlePressfunction to be called when pressing stack avatarvoid
renderfunction to render custom stack avatar( render(faces,numFaces) => return JSX element)void
containerStylecontainer style for stack avatar
overFlowCircleStyleoverflow circle style
imageStyleimage style
overFlowLabelStyleoverflow text style
showOverFlowwhether to show overflow circletrue

Important Note

Do not provide offset value to more than 1.

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

0.0.1

2 years ago