Socket
Socket
Sign inDemoInstall

@washingtonpost/wpds-avatar

Package Overview
Dependencies
21
Maintainers
4
Versions
60
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @washingtonpost/wpds-avatar

WPDS Avatar


Version published
Weekly downloads
2K
decreased by-1.84%
Maintainers
4
Install size
1.41 MB
Created
Weekly downloads
 

Readme

Source

Avatar

Using next/image

Some important things to note when using next/image with the wpds avatar component.

  • The next/image expects a pixel value to be passed into the height and width props. You can find the token to pixel mappings in the size documentation.
  • In order for the image to fit correctly in the container you need to specify layout="fixed".
  • If you're having issues, double check that you're passing in a loader
import { Avatar } from "@washingtonpost/wpds-ui-kit";

const myLoader = ({ src }) => {
  return `${src}`;
};

function Component() {
  	<Avatar size="200">
      <img
        src="https://i.pravatar.cc/300/300"
        alt="An avatar is an atomic component that represents an individual’s identity through a circular photo."
      />
    </Avatar>
    <Avatar>
      <Image
        loader={myLoader}
        src="https://i.pravatar.cc/300/300"
        width="32" //pixel equivalent of 200 token
        height="32" //pixel equivalent of 200 token
        layout="fixed"
        alt="An avatar is an atomic component that represents an individual’s identity through a circular photo."
      />
    </Avatar>
}

FAQs

Last updated on 09 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