Profile Picture UI
A lightweight, framework-agnostic profile picture component built with Lit Web Components
Profile Picture UI
@grasco/profile-picture is a lightweight (~6KB gzipped) profile picture component library built with Lit Web Components. It works natively in any framework without wrappers, adapters, or peer dependencies.
Key Features
- Tiny bundle — ~6KB gzipped, tree-shakeable ESM
- Zero framework dependencies — built on native Web Components via Lit
- Fully customizable — variants (circle, rounded, square), badges, rings, presence indicators, glow effects, and more
- Native lazy loading — images load only when visible
- TypeScript types — full type definitions included
- Tailwind compatible — renders in Light DOM for seamless Tailwind utility class support
- Framework support — first-class support for React, Vue, Angular, and Svelte
Quick Start
import { ProfilePicture } from '@grasco/profile-picture';
function App() {
return (
<ProfilePicture
src="https://example.com/avatar.png"
alt="John Doe"
size="lg"
variant="circle"
border
borderColor="white"
/>
);
}Explore the Docs
Installation
Install @grasco/profile-picture via npm or bun
ProfilePicture
The core avatar component with variants, badges, rings, and more
ProfilePictureGroup
Stack and overlap multiple profile pictures
Events
Event reference for ProfilePicture and ProfilePictureGroup
Styling
Customize colors, sizes, and effects with Tailwind or CSS
CDN Integration
Load profile pictures directly from the Grasco CDN
React
Framework guide for React and Next.js
Vue
Framework guide for Vue and Nuxt
Angular
Framework guide for Angular
Svelte
Framework guide for SvelteKit and Svelte
Select Profile Picture (SSE) POST
Queue a profile picture processing job and stream progress via SSE. **Response format:** `text/event-stream` **SSE Event sequence:** 1. `registered` — Job queued successfully, includes `jobId` 2. `progress` — Step updates (fetching → normalizing → cropping → styling → matting → resizing → uploading) 3. `completed` — Processing finished, includes `extCustomerId` **Error events** can occur at any point and include a `retryable` flag.
Installation
Install @grasco/profile-picture in your project