Feedback indicatorstatus

Pulse Dot

Status label with pulsing effect.

Preview

Usage

Copy the full block below to use this component with its imports.

astro
---
import { PulseDot } from 'astro-component-kit';
---

<PulseDot label="Recording" color="#ef4444" />
--- import { PulseDot } from 'astro-component-kit'; --- <PulseDot label="Recording" color="#ef4444" />

Manual Installation

If you are not using the npm package, create a new file src/components/lib/PulseDot.astro and paste the following code:

astro
---
/**
 * PulseDot — A status indicator with a labeled text and a pulsing dot animation.
 * 
 * @param {string} label - Text label (e.g. "System Active").
 * @param {string} color - CSS color for the pulse and text. Default is '#34d399' (Success).
 */
interface Props {
  label: string;
  color?: string;
}

const { label, color = '#34d399' } = Astro.props;
---

<div class="status-wrap" style={`--status-color: ${color};`}>
  <div class="pulse-dot" aria-hidden="true"></div>
  <span class="status-text">{label}</span>
</div>

<style>
  .status-wrap { 
    display: flex; 
    align-items: center; 
    gap: var(--sp-3, 0.6rem); 
    color: var(--status-color); 
    font-weight: 700; 
    font-size: 0.75rem; 
    text-transform: uppercase; 
    letter-spacing: 0.05em;
  }
  
  .pulse-dot { 
    width: 8px; 
    height: 8px; 
    background: var(--status-color); 
    border-radius: var(--r-full, 50%); 
    position: relative; 
  }
  
  .pulse-dot::after { 
    content: ""; 
    position: absolute; 
    inset: 0; 
    border-radius: 50%; 
    border: 2px solid var(--status-color); 
    animation: status-pulse 1.8s infinite; 
  }
  
  @keyframes status-pulse { 
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(3.5); opacity: 0; } 
  }
  
  .status-text { white-space: nowrap; }
</style>
--- /** * PulseDot — A status indicator with a labeled text and a pulsing dot animation. * * @param {string} label - Text label (e.g. "System Active"). * @param {string} color - CSS color for the pulse and text. Default is '#34d399' (Success). */ interface Props { label: string; color?: string; } const { label, color = '#34d399' } = Astro.props; --- <div class="status-wrap" style={`--status-color: ${color};`}> <div class="pulse-dot" aria-hidden="true"></div> <span class="status-text">{label}</span> </div> <style> .status-wrap { display: flex; align-items: center; gap: var(--sp-3, 0.6rem); color: var(--status-color); font-weight: 700; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; } .pulse-dot { width: 8px; height: 8px; background: var(--status-color); border-radius: var(--r-full, 50%); position: relative; } .pulse-dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--status-color); animation: status-pulse 1.8s infinite; } @keyframes status-pulse { 0% { transform: scale(1); opacity: 0.8; } 100% { transform: scale(3.5); opacity: 0; } } .status-text { white-space: nowrap; } </style>

Quick Info

Category
Feedback
Filename
PulseDot.astro
Dependencies
None — pure Astro + CSS
Tags
indicatorstatus