Glass Avatar
washiveil/glass-avatarFreeComponent
Avatar with a glass ring, built on Radix Avatar.
Install it
npx shadcn@latest add https://washiveil.alexchih.com/r/glass-avatar.jsonSource
1'use client';23import * as React from 'react';4import { Avatar as AvatarPrimitive } from 'radix-ui';56import { cn } from '@/lib/utils';78const GlassAvatar = React.forwardRef<9 React.ComponentRef<typeof AvatarPrimitive.Root>,10 React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Root>11>(({ className, ...props }, ref) => (12 <AvatarPrimitive.Root13 ref={ref}14 className={cn(15 'relative flex size-10 shrink-0 overflow-hidden rounded-full border border-glass-edge bg-glass backdrop-blur',16 className,17 )}18 {...props}19 />20));21GlassAvatar.displayName = AvatarPrimitive.Root.displayName;2223const GlassAvatarImage = React.forwardRef<24 React.ComponentRef<typeof AvatarPrimitive.Image>,25 React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Image>26>(({ className, ...props }, ref) => (27 <AvatarPrimitive.Image ref={ref} className={cn('aspect-square size-full object-cover', className)} {...props} />28));29GlassAvatarImage.displayName = AvatarPrimitive.Image.displayName;3031const GlassAvatarFallback = React.forwardRef<32 React.ComponentRef<typeof AvatarPrimitive.Fallback>,33 React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Fallback>34>(({ className, ...props }, ref) => (35 <AvatarPrimitive.Fallback36 ref={ref}37 className={cn(38 'flex size-full items-center justify-center font-mono text-[0.75rem] uppercase text-muted-foreground',39 className,40 )}41 {...props}42 />43));44GlassAvatarFallback.displayName = AvatarPrimitive.Fallback.displayName;4546export { GlassAvatar, GlassAvatarImage, GlassAvatarFallback };
What it pulls in
npm packages
Other registry items
Files it writes
More from washiveil
All 58 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Ambient Fieldambient-field | washiveil | Components | Free | no deps | |
| Chipchip | washiveil | Components | Free | 1 dep | |
| Code Badgecode-badge | washiveil | Components | Free | no deps | |
| Glass Accordionglass-accordion | washiveil | Components | Free | 2 deps | |
| Glass Alertglass-alert | washiveil | Components | Free | 1 dep | |
| Glass Alert Dialogglass-alert-dialog | washiveil | Components | Free | 1 dep | |
| Glass Aspect Ratioglass-aspect-ratio | washiveil | Components | Free | 1 dep | |
| Glass Breadcrumbglass-breadcrumb | washiveil | Components | Free | 2 deps |
