Socket
Socket
Sign inDemoInstall

@rmwc/avatar

Package Overview
Dependencies
21
Maintainers
1
Versions
112
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @rmwc/avatar

RMWC avatar component


Version published
Weekly downloads
1.4K
increased by15.13%
Maintainers
1
Install size
1.66 MB
Created
Weekly downloads
 

Readme

Source

Avatars RMWC ADDON

Avatars are virtual representations of users in a system.

  • Module @rmwc/avatar
  • Import styles:
    • Using CSS Loader
      • import '@rmwc/avatar/styles';
    • Or include stylesheets
      • '@rmwc/avatar/avatar.css'
      • '@rmwc/icon/icon.css'
      • '@material/ripple/dist/mdc.ripple.css'
<>
  <Avatar
    src="images/avatars/blackwidow.png"
    size="xsmall"
    name="Natalia Alianovna Romanova"
  />
  <Avatar
    src="images/avatars/hulk.png"
    size="small"
    name="Bruce Banner"
  />
  <Avatar
    src="images/avatars/thor.png"
    size="medium"
    name="Thor Odinson"
  />
  <Avatar
    src="images/avatars/captainamerica.png"
    size="large"
    name="Steve Rogers"
  />
  <Avatar
    src="images/avatars/ironman.png"
    size="xlarge"
    name="Tony Stark"
  />
</>
<>
  <Avatar name="Natalia Alianovna Romanova" size="xsmall" />
  <Avatar name="Bruce Banner" size="small" />
  <Avatar name="Thor Odinson" size="medium" />
  <Avatar name="Steve Rogers" size="large" />
  <Avatar name="Tony Stark" size="xlarge" />
</>
<Avatar
  src="images/avatars/blackwidow.png"
  size="large"
  name="Natalia Alianovna Romanova"
  square
/>
<Avatar
  src="images/avatars/google.svg"
  size="large"
  contain
  name="Google"
  square
/>

Avatar Groups

This is for Avatars that are displayed in a corellated grouping or list.

<AvatarGroup>
  <Avatar
    src="images/avatars/captainamerica.png"
    name="Steve Rogers"
    size="large"
    interactive
  />
  <Avatar
    src="images/avatars/ironman.png"
    name="Tony Stark"
    size="large"
    interactive
  />
  <AvatarCount size="large" value={12} interactive />
</AvatarGroup>
<AvatarGroup dense>
  <Avatar
    src="images/avatars/captainamerica.png"
    name="Steve Rogers"
    size="large"
    interactive
  />
  <Avatar
    src="images/avatars/ironman.png"
    name="Tony Stark"
    size="large"
    interactive
  />
  <AvatarCount size="large" overflow value={4} interactive />
</AvatarGroup>

Usage with other components

The avatar component has been designed to work nicely in any of the places you would use an icon.

<Button
  label="Enlist now!"
  icon={
    <Avatar
      src="images/avatars/captainamerica.png"
      name="Steve Rogers"
    />
  }
/>
<Chip
  label="Hulk Smash"
  icon={<Avatar src="images/avatars/hulk.png" name="Bruce Banner" />}
/>
<TextField
  label="Message Natalia..."
  outlined
  icon={
    <Avatar
      src="images/avatars/blackwidow.png"
      name="Natalia Alianovna Romanova"
      square
    />
  }
/>

Avatar

An Avatar component for displaying users in a system.

Props

NameTypeDescription
containbooleanContain the avatar image instead of covering.
interactivebooleanMake the avatar interactive.
namestringThe name of the user. This will get converted to initials and set the hover title.
rippleRipplePropTAdds a ripple effect to the component
sizeIconSizeTThe size of the avatar
squarebooleanMake the avatar square.
srcstringThe url for the image. This gets passed to the Icon component.

AvatarGroup

A container for groups of Avatars

Props

NameTypeDescription
densebooleanMakes the list dense

AvatarCount

An Avatar count for displaying list overflow.

Props

NameTypeDescription
interactivebooleanMake the avatar interactive.
overflowbooleanOptionally renders a "+" to indicate overlow.
sizeIconSizeTThe size of the avatar
squarebooleanMake the avatar square.
valuenumberThe number of users.

Keywords

FAQs

Last updated on 17 Apr 2024

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