FACEHASH
bycossistanta React component that generates unique avatar faces from any string. zero dependencies. works with Next.js, Vite, Remix.
npm i facehashtry it — type anything
why facehash?
every app needs avatars. most solutions are either too heavy, require external services, or look dated. facehash generates unique, friendly faces from any string — emails, usernames, uuids, whatever.
same input = same face. always. no api calls, no storage, no randomness. just deterministic, beautiful avatars that work offline.
need an image URL for emails or og images? use the next.js route handler to generate PNGs on the fly — cached forever.
perfect for user profiles, comment sections, chat apps, and ai agents — give your bots a face that's consistent across sessions.
import { Facehash } from "facehash";
<Facehash name="agent-47" size={48} />// app/api/avatar/route.ts
import { toFacehashHandler } from "facehash/next";
export const { GET } = toFacehashHandler();// use it anywhere you need a URL
<img src="/api/avatar?name=john" />
// in emails, og images, etc.
https://yoursite.com/api/avatar?name=johnprops
name
import { Facehash } from "facehash";
<Facehash name="alice" />
<Facehash name="bob" />
<Facehash name="charlie" />size
<Facehash name="facehash" size={32} />
<Facehash name="facehash" size={48} />
<Facehash name="facehash" size={64} />colors
<Facehash name="facehash" colors={["#264653", "#2a9d8f", "#e9c46a"]} />intensity3d
<Facehash name="facehash" intensity3d="none" />
<Facehash name="facehash" intensity3d="subtle" />
<Facehash name="facehash" intensity3d="dramatic" />showInitial
<Facehash name="facehash" showInitial={true} />
<Facehash name="facehash" showInitial={false} />variant
<Facehash name="facehash" variant="gradient" />
<Facehash name="facehash" variant="solid" />need an image with fallback? use the Avatar wrapper:
Avatar
import { Avatar, AvatarImage, AvatarFallback } from "facehash";
<Avatar>
<AvatarImage src="/photo.jpg" />
<AvatarFallback name="anthony" />
</Avatar>use cases
user profiles, chat apps, comment sections, team directories, multiplayer games, placeholder avatars, bot identities, even AI agents like that one you randomly named "Claude" .
made by cossistant
the open-source chat support widget for react