Skip to main content

Group Avatar

AvatarGroup is part of the @flexnative/avatar package. To use the AvatarGroup you needs to install @flexnative/avatar package. Fallow this link on how to install the package.

API

import { AvatarGroup } from '@flexnative/avatar';

Component

AvatarGroup Type: React.PureComponent<AvatarGroupProps>

Props

info

AvatarGroup extends ViewProps from React Native.

NameTypeRequiredDefault ValueDescription
sortIndex'asc' | 'asc'false'asc'asc or desc are supported
itemPaddingnumberfalse13Padding between avatar items.
itemBorderWidthBorderWidthfalsethickOptional avatar borders width.
itemBorderColorColorValuefalsetheme.colors.cardBorders color according react-native ColorValue.
childrenArray<React.ReactElement<AvatarProps>>truefull

Usecase Examples

The following example demonstrates the different types of Avatar Groups in action.

Children

R A
R A
R A
R A

SortIndex

R A
R A
R A
R A
R A
R A

ItemBorderColor

R A
R A
R A
R A
R A
R A
R A
R A
R A
R A
R A
R A

ItemBorderWidth

R A
R A
R A
R A
R A
R A
R A
R A
R A
R A
R A
R A
R A
R A
R A
R A
R A
R A

ItemPadding

R A
R A
R A
R A
R A
R A

Combinations

RA

Playground

Live Editor
//Play with props to see live changes;

const styles = {
  groupStyle: {
    paddingTop: 8,
    paddingBottom: 8,
    paddingRight: 8,
    paddingLeft: 21,
    borderRadius: 99,
    backgroundColor: '#ed143d30'
  }
};

render(
  <AvatarGroup style={styles.groupStyle}>
    <Avatar text='RA' size='large' type='text' color='primary' />
    <Avatar icon='avatar' size='large' type='icon' color='success' />
    <Avatar source={LOGO} size='large' color='info' />
  </AvatarGroup>
);
Result
Loading...