Component packs › Hoist › Avatar Upload

Avatar Upload

The new photo is hooked off the desk, lifted into the round frame and punched into a circle; the old one drops out.

Avatar Upload is an avatar from Hoist, a component pack with 6 file upload components: File upload components where every file is a paper sheet lifted on a steel cable. Price: $2 for the whole pack.

Built with: punch from square to circle, real file input, empty frame state.

Code: React and Next.js (TypeScript), Vue 3, plain HTML/CSS/JS, Tailwind CSS v4 and Motion (motion.dev). No npm packages needed. Keyboard accessible, with a reduced-motion version, in dark and light.

Avatar Upload props

PropTypeDefaultDescription
srcstringa sample portraitCurrent photo URL. Default: a sample portrait. Pass "" to start empty.
namestring
widthnumber300Width in px. Default 300.
darkboolean
onChange(file: File | null) => void
autoplaynumber | falseShowcase mode: swaps between sample portraits every N ms while visible.

Methods on the ref

Use it in React

import AvatarUpload from './AvatarUpload';

<AvatarUpload />

The Vue, HTML, Next.js, Tailwind and Motion versions take the same options.

More in Hoist

Good for: File upload.