Patterns
Avatar
Colour from the name (same person, same colour); status dot, verified tick, gradient ring, square for organisations.
"use client";
import { Avatar, AvatarStack } from "@waveinno/ui";
export default function AvatarExample() {
return (
<div className="space-y-4">
<div className="flex flex-wrap items-end gap-4">
<Avatar name="Karim Ahmed" size="2xl" ring="gradient" verified />
<Avatar name="Nusrat Jahan" size="xl" status="online" />
<Avatar name="Shahidul Islam" size="lg" status="away" />
<Avatar name="Farhana Akter" size="md" status="busy" />
<Avatar name="Rafiq Hasan" size="md" status="offline" />
<Avatar name="Gulshan Car Park" size="xl" shape="square" verified />
<Avatar name="Banani Trade Centre" size="lg" shape="square" />
</div>
<AvatarStack names={["Karim Ahmed", "Nusrat Jahan", "Shahidul Islam", "Farhana Akter", "Rafiq Hasan", "Tania Sultana"]} size="md" />
</div>
);
}Examples#
Each one on its own: copy its code into your app, or copy it to Figma and paste it on the canvas as layers.
Sizes
sm in tables, md in lists, lg and xl in headers, 2xl on a profile.
"use client";
import { Avatar } from "@waveinno/ui";
export default function AvatarSizesExample() {
return (
<div className="flex items-end gap-3">
{(["sm", "md", "lg", "xl", "2xl"] as const).map((size) => (
<Avatar key={size} name="Karim Ahmed" size={size} />
))}
</div>
);
}Status
Online, away, busy or offline, as a dot on the corner.
"use client";
import { Avatar } from "@waveinno/ui";
export default function AvatarStatusExample() {
return (
<div className="flex items-end gap-4">
<Avatar name="Nusrat Jahan" size="lg" status="online" />
<Avatar name="Shahidul Islam" size="lg" status="away" />
<Avatar name="Farhana Akter" size="lg" status="busy" />
<Avatar name="Rafiq Hasan" size="lg" status="offline" />
</div>
);
}Gradient ring and verified
The brand ring marks the owner or the current user; the tick, a verified account.
"use client";
import { Avatar } from "@waveinno/ui";
export default function AvatarRingExample() {
return (
<Avatar name="Karim Ahmed" size="2xl" ring="gradient" verified />
);
}Organisation
Square for companies and places, so they never read as people.
"use client";
import { Avatar } from "@waveinno/ui";
export default function AvatarSquareExample() {
return (
<div className="flex items-end gap-3">
<Avatar name="Gulshan Car Park" size="xl" shape="square" verified />
<Avatar name="Banani Trade Centre" size="lg" shape="square" />
</div>
);
}Stack
A team in a row, with a count for the rest.
"use client";
import { AvatarStack } from "@waveinno/ui";
export default function AvatarStackExample() {
return (
<AvatarStack names={["Karim Ahmed", "Nusrat Jahan", "Shahidul Islam", "Farhana Akter", "Rafiq Hasan", "Tania Sultana"]} size="md" />
);
}Animated#
Motion that earns its place: free ones to copy now, and Pro ones whose code and Figma copy come with a Wavi Pro licence. They respect the visitor's reduced-motion setting.
Stack that spreadsFree
The faces fan out on hover, so each one can be seen.
"use client";
import { Avatar } from "@waveinno/ui";
export default function AvatarSpreadExample() {
return (
<div className="group flex">
{["Karim Ahmed", "Nusrat Jahan", "Shahidul Islam", "Farhana Akter", "Rafiq Hasan"].map((name, i) => (
<span
key={name}
className="-ml-2.5 rounded-full ring-2 ring-canvas transition-[margin] duration-300 ease-[cubic-bezier(.34,1.56,.64,1)] first:ml-0 group-hover:ml-1 group-hover:first:ml-0"
style={{ zIndex: 10 - i }}
>
<Avatar name={name} size="lg" />
</span>
))}
</div>
);
}Live ring Pro
A turning brand ring and a LIVE tag: someone presenting or on a call.
This example's code comes with Wavi Pro
One payment for every Pro component, block and template, with every update.
Import#
Everything comes from the package root. The example above uses:
import { Avatar, AvatarStack } from "@waveinno/ui";Props#
Read from the source of this version, so they match the code exactly.
<Avatar>
src/components/ui/avatar.tsx| Prop | Type | Default | Description |
|---|---|---|---|
namerequired | string | — | |
src | string | null | — | |
size | keyof typeof sizes | "md" | |
status | keyof typeof STATUS | — | |
verified | boolean | — | |
ring | "gradient" | — | |
shape | "circle" | "square" | "circle" | |
className | string | — |
<AvatarStack>
src/components/ui/avatar.tsx| Prop | Type | Default | Description |
|---|---|---|---|
namesrequired | string[] | — | |
max | number | 4 | |
size | keyof typeof sizes | "sm" |
Install#
If the project does not have the package yet, add it, then follow the setup for Next.js or Vite once.
$ npm install @waveinno/ui