@washingtonpost/wpds-avatar
TypeScript icon, indicating that this package has built-in type declarations

1.24.0 • Public • Published

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>
}

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.6.2-experimental.00experimental
1.24.024latest

Version History

VersionDownloads (Last 7 Days)Published
1.24.024
1.23.11
1.23.00
1.22.62
1.22.01
1.21.052
1.20.00
1.19.00
1.18.00
1.17.00
1.16.20
1.16.10
1.16.01
1.15.00
1.14.00
1.13.00
1.12.00
1.11.12
1.11.00
1.10.00
1.9.10
1.9.00
1.8.50
1.8.40
1.8.20
1.8.00
1.8.10
1.7.10
1.7.00
1.6.20
1.6.2-experimental.00
1.6.10
1.6.0-experimental.10
1.6.0-experimental.00
1.5.20
1.5.00
1.4.00
1.2.00
1.1.00
0.25.00
0.24.044
0.23.20
0.23.10
0.22.00
0.21.00
0.20.10
0.20.00
0.19.10
0.19.1-experimental.00
0.19.00
0.18.00
0.17.00
0.16.00
0.15.00
0.14.00
0.13.00
0.12.00
0.11.10
0.11.00
0.10.0-experimental.00

Package Sidebar

Install

npm i @washingtonpost/wpds-avatar

Weekly Downloads

127

Version

1.24.0

License

MIT

Unpacked Size

39.3 kB

Total Files

11

Last publish

Collaborators

  • tam.steph
  • wp-aberg
  • ebgranger
  • artmsilva