@bob-supply/react
v0.1.0
Published
React image component for [bob.supply](https://bob.supply) avatars.
Readme
@bob-supply/react
React image component for bob.supply avatars.
Install
npm install @bob-supply/reactUsage
import { BobAvatar } from "@bob-supply/react";
export function ProfileAvatar() {
return <BobAvatar seed="alice" width={64} height={64} />;
}BobAvatar renders a normal <img> element and accepts standard image props except src, which is generated from the seed.
<BobAvatar seed="alice bob" alt="Alice Bob avatar" className="avatar" loading="lazy" />API
<BobAvatar />
type BobAvatarProps = Omit<ImgHTMLAttributes<HTMLImageElement>, "src"> & {
readonly seed: string;
readonly format?: "png";
};Props:
seed: Required deterministic avatar seed.format: Optional image format. Currently onlypngis supported.alt: Optional alt text. Defaults to${seed} avatar.
The generated image URL uses https://bob.supply/{seed}?format=png.
