• Stars
    star
    105
  • Rank 328,196 (Top 7 %)
  • Language
    JavaScript
  • Created over 7 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

🙉👮🙎🤠 Face Piles (A group of overlapping round avatars) for React Native

React Native Face Pile

A group of overlapping round avatars are called face piles. Try it on Snack

npm version

Facepile Image

Installation

yarn add react-native-face-pile

// or

npm install --save react-native-face-pile

Usage

import FacePile from 'react-native-face-pile'

const FACES = [
  {
    id: 0,
    imageUrl: 'https://s3.amazonaws.com/uifaces/faces/twitter/vista/128.jpg',
  },
  {
    id: 1,
    imageUrl: 'http://www.yojackets.com/wp-content/uploads/2016/04/Civil-War-Scarlet-Witch-Red-Coat-1.jpg',
  },
  {
    id: 2,
    imageUrl: 'https://s3.amazonaws.com/uifaces/faces/twitter/brad_frost/128.jpg',
  },
  {
    id: 3,
    imageUrl: 'https://s3.amazonaws.com/uifaces/faces/twitter/k/128.jpg',
  },
  {
    id: 4,
    imageUrl: 'https://pbs.twimg.com/profile_images/885357926373654528/4tGgnF71_bigger.jpg',
  }
];

<FacePile numFaces={3} faces={FACES} />
  • Pass in your array of faces, then the number you want to render.
  • Any faces exceeding numFaces, or faces without images, will show up under the overflow (a circle with, for example, +3 after the faces)
  • If you want to hide the overflow, pass in hideOverflow (boolean)
  • If you don't want FacePile to figure out what to render, you can pass in your own render method: render=({ numFaces, faces }) => { do whatever you want here }

Prop types

render: PropTypes.func, // optional render method, otherwise we take control
numFaces: PropTypes.number, // number of faces you want to render. The rest is subtracted
hideOverflow: PropTypes.bool, // whether or not to show the +2 extra faces
overlap: PropTypes.number, // optional amount of overlap of faces (between 0 and 1), defaults to 0.5
faces: PropTypes.shape({
  id: PropTypes.string,
  imageUrl: PropTypes.string
}),
circleSize: PropTypes.number, // 20, 40, 60, etc.
containerStyle: PropTypes.instanceOf(StyleSheet), // overall container style
circleStyle: PropTypes.instanceOf(StyleSheet), // override default circle styles
imageStyle: PropTypes.instanceOf(StyleSheet), // override default image styles
overflowStyle: PropTypes.instanceOf(StyleSheet), // override default overflow circle styles
overflowLabelStyle: PropTypes.instanceOf(StyleSheet) // override default overflow label (+8) styles

Contributors

  • @peterpme
  • @dhruska
  • @angelk90

More Repositories

1

react-native-fast-text

A drop-in replacement Text component for React Native that removes overhead
JavaScript
122
star
2

apollo-tote

👜 A declarative approach to handling Apollo GraphQL queries in React
JavaScript
77
star
3

dotfiles

᠅ Dotfiles for zsh, tmux, fzf, neovim, git, zprezto, hammerspoon, kitty & more 🔥
Lua
72
star
4

react-gpt

✨ An experimental chat-gpt experience focused on React using LangChain & OpenAI
TypeScript
69
star
5

create-simple-icon

🎨 🔧 Download and colorize branded svg icons in a snap!
JavaScript
47
star
6

react-native-asyncstorage

📬 📫 🗄 Declarative AsyncStorage component for React Native
JavaScript
31
star
7

frontend-setup

🛠 OSX - Frontend Development Environment Setup & Utilities
18
star
8

reason-react-native-example

ReasonML React Native (Expo) example
OCaml
14
star
9

cloudinary-microurl

A tiny (346B), 0 dependency, fully-tested Cloudinary URL generator for JS
JavaScript
14
star
10

reason-conf-us-2019

Reason Conf US 2019 Website
OCaml
10
star
11

glamor-helpers

Helper functions for Glamor, the CSS-in-JS library
JavaScript
10
star
12

js-midi

Chrome Midi Api Bridge
JavaScript
10
star
13

sub-in

🥙 A tiny (115B) find-and-replace utility for strings in Javascript
JavaScript
8
star
14

tsdx-reason-example

Use tsdx with Reason
JavaScript
8
star
15

redux-crud-api-middleware

Redux Crud Api Middleware
5
star
16

codenames-deluxe

Codenames Deluxe: Play Codenames online with your friends & family across every device!
CSS
4
star
17

peterpme.github.io

TypeScript
3
star
18

bs-react-native-typography

OCaml
3
star
19

react-knob

React Knob
JavaScript
3
star
20

ng-google-sheets-cms

Pull in Google Docs data with Angular.
JavaScript
3
star
21

awesome-mac-automation

Guide to macOS / OSX Automation
3
star
22

react-midi

The Home of React Midi (WIP)
2
star
23

earth-moon-cosmos

2
star
24

create-node-app

JavaScript
2
star
25

tiny-js-libraries

A showcase of tiny js libraries ( < 1kb) and how developers were able to pull it off!
2
star
26

react-contest

A super tiny A/B (265 bytes!) testing platform for your components.
JavaScript
2
star
27

angular-accordion-tabs-directive

AngularJS directive that allows you to reuse components in order to create an accordion-to-tab approach seamlessly.
HTML
2
star
28

react-rally-schedule

React Rally Schedule
JavaScript
1
star
29

expo-av-example

TypeScript
1
star
30

chicagojs-conf-landing

CSS
1
star
31

tiny-isempty

A tiny implementation of isEmpty that works on strings, arrays & objects
JavaScript
1
star
32

react-native-new-arch-bignumber

Kotlin
1
star
33

ng-smooth-scroll

AngularJS directive that delivers smooth scrolling to your application
JavaScript
1
star
34

knowledge

Knowledge is Power
1
star
35

backpackmwa2

Kotlin
1
star
36

expo-react-navigation-sourcemap-issue

JavaScript
1
star
37

peterpme.github.io-backup

Home page for Peter Piekarczyk (https://www.peterp.me)
Shell
1
star
38

notion-blog

TypeScript
1
star
39

chat-gpt-results

OpenAI ChatGPT Results
1
star
40

peterpme

1
star
41

backpack-mwa-bindings

Java
1
star
42

xastro-dashboard

JavaScript
1
star
43

next-xastro-dashboard

TypeScript
1
star
44

ng-carousel

An AngularJS directive for a creating a simple carousel running in your application.
1
star