IN-02Inputs
Avatar Picker
Generated avatars from a name, morphing as you type, on a 3D coin you can flick, tap or shuffle.
PRONatural Date Input and more like it are in Kokonut UI Pro
Installation
Avatar Picker is a free, open-source React component in the Kokonut UI Inputs collection. Add it with the shadcn CLI, which copies the source into components/kokonutui/avatar-picker.tsx, so the code is yours to change.
npx shadcn@latest add @kokonutui/avatar-pickerOr add it by hand: install its packages, then copy the source from Copy code above into components/kokonutui/avatar-picker.tsx.
npm install lucide-react motionUsage
import AvatarPicker from "@/components/kokonutui/avatar-picker";
export default function Example() {
return <AvatarPicker />;
}Props
valueAvatarValueControlled value.
defaultValuePartial<AvatarValue>Initial value when uncontrolled.
onChange(value: AvatarValue & { seed: string; description: string }) => voidCalled when the name changes or a face lands.
onComplete(value: AvatarValue & { seed: string }) => voidCalled by the submit button.
namestringForm field name; a hidden input carries the avatar seed.
titlestringDefault "Pick your avatar"descriptionstringDefault "Made from your name. Spin it or pick one."submitLabelstringDefault "Continue"classNamestringExtra classes for the root element.
AvatarValue
displayNamerequiredstringThe name the faces are generated from.
variantrequirednumberWhich face for that name. Any integer works; each one is a new face.
Dependencies
| Needs | Version | Comes from |
|---|---|---|
lucide-react | ^0.556.0 | npm, installed by the CLI |
motion | ^12.23.25 | npm, installed by the CLI |
cn from lib/utils.ts | shadcn init | |
| React | 19 | Your app |
| Tailwind CSS | 4 | Your app |
No provider, font or global CSS to set up: the file works as soon as it lands.

