# Avatar with status ring

> A round avatar with a status dot and a ring that pulses softly, showing someone is available.

- Category: [Microinteractions](https://library.aimran.es/components/microinteractions)
- Built with: React + Motion
- Live editor: https://library.aimran.es/blocks/pulsing-status-avatar
- Library: AIMRAN Library (https://library.aimran.es), free, no sign-up, by Aimran Oukham

## Where to use it

A pulsing ring says “there is a real person here” better than a line of text. It works for the support agent in a chat widget, the host of a holiday rental, a coach’s booking page or teammates in a project tool. This online status avatar in React uses initials by default, and a photo slots in easily.

Use green for available and switch to amber or grey for away, rather than keeping everyone pulsing. A slow pulse, over two seconds, feels calm; faster starts to look like an alert. Only animate the people who matter on that screen.

## Code

### React (Motion)

```tsx
import { motion } from "framer-motion";

interface StatusAvatarProps {
  color?: string;
  speed?: number;
}

export default function StatusAvatar({
  color = "#34c759",
  speed = 2.4,
}: StatusAvatarProps) {
  return (
    <div className="relative text-[#1d1d1f] dark:text-[#f5f5f7]">
      <motion.div
        className="absolute -inset-1 rounded-full border-2"
        style={{ borderColor: color }}
        animate={{ scale: [1, 1.12, 1], opacity: [1, 0.35, 1] }}
        transition={{ duration: speed, repeat: Infinity }}
      />
      <div className="grid h-16 w-16 place-items-center rounded-full bg-white dark:bg-[#1c1c1e] text-lg font-semibold shadow-[0_1px_2px_rgba(0,0,0,0.03),0_8px_28px_rgba(0,0,0,0.05)]">
        AL
      </div>
      <span
        className="absolute bottom-0 right-0 h-4 w-4 rounded-full border-2 border-white dark:border-[#1c1c1e]"
        style={{ backgroundColor: color }}
      />
    </div>
  );
}
```

## Prompt for AI assistants

Paste this into ChatGPT, Claude, Cursor, v0 or Lovable to adapt the block to your stack (Tailwind, Vue, Svelte…):

````text
I want to add the “Avatar with status ring” block (Microinteractions) from AIMRAN Library to my project.

## What it is
A round avatar with a status dot and a ring that pulses softly, showing someone is available.

## Chosen settings
- Color: #34c759
- Speed: 2.4s (from 1 to 4s)

## What I need
1. Add it to my project with the same look and animation as the reference code: same sizes, colours, radii, shadows, timings and easing.
2. It is built with React + TypeScript, with framer-motion for the animation and lucide-react for the icons. If my project uses something else (Vue, Svelte, Astro, plain HTML…), translate it without losing any behaviour. If I use Tailwind, turn the styles into classes; if not, keep the CSS in its own file.
3. Expose the settings above as props (or CSS variables) with those values as defaults.
4. Make it work well on phones: nothing that depends only on hover, touch targets of at least 44 px and no overflow on 320 px screens.
5. Make it look right in light and dark mode.
6. Keep it accessible: semantic HTML, roles and aria-* where needed, visible focus and keyboard support.
7. Respect prefers-reduced-motion: with reduced motion, no big animations but the same end result.

## Reference code
```tsx
import { motion } from "framer-motion";

interface StatusAvatarProps {
  color?: string;
  speed?: number;
}

export default function StatusAvatar({
  color = "#34c759",
  speed = 2.4,
}: StatusAvatarProps) {
  return (
    <div className="relative text-[#1d1d1f] dark:text-[#f5f5f7]">
      <motion.div
        className="absolute -inset-1 rounded-full border-2"
        style={{ borderColor: color }}
        animate={{ scale: [1, 1.12, 1], opacity: [1, 0.35, 1] }}
        transition={{ duration: speed, repeat: Infinity }}
      />
      <div className="grid h-16 w-16 place-items-center rounded-full bg-white dark:bg-[#1c1c1e] text-lg font-semibold shadow-[0_1px_2px_rgba(0,0,0,0.03),0_8px_28px_rgba(0,0,0,0.05)]">
        AL
      </div>
      <span
        className="absolute bottom-0 right-0 h-4 w-4 rounded-full border-2 border-white dark:border-[#1c1c1e]"
        style={{ backgroundColor: color }}
      />
    </div>
  );
}
```

Give me the complete final code, ready to paste, and tell me in one line where to put it in my project.
````
