Component packs › Hoist › 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.
| Prop | Type | Default | Description |
|---|---|---|---|
src | string | a sample portrait | Current photo URL. Default: a sample portrait. Pass "" to start empty. |
name | string | ||
width | number | 300 | Width in px. Default 300. |
dark | boolean | ||
onChange | (file: File | null) => void | ||
autoplay | number | false | Showcase mode: swaps between sample portraits every N ms while visible. |
set(file: File | string | null): voiddestroy(): voidimport AvatarUpload from './AvatarUpload';
<AvatarUpload />The Vue, HTML, Next.js, Tailwind and Motion versions take the same options.
Good for: File upload.