1 звезда на GitHub = 1 новый компонент.

Поставить звезду
Уведомленияindicatorstatus

Pulse Dot

Пульсирующая точка статуса для обозначения живого подключения и онлайна.

Живое превью

All systems operational
Degraded

Использование

Скопируйте и вставьте этот код в ваш React-компонент:

tsx
import { PulseDot } from 'react-component-kit-ui/feedback';

<PulseDot label="All systems operational" color="#34d399" />

Ручная установка

Если вы не используете пакет npm, создайте файл и вставьте следующий код: src/components/PulseDot.tsx + PulseDot.css:

PulseDot.tsx
'use client';

import type { CSSProperties, HTMLAttributes, ReactNode } from 'react';
import './PulseDot.css';

/**
 * PulseDot — A status indicator with a labeled text and a pulsing dot animation.
 *
 * @param label - Required. Status text.
 * @param color - Optional. Default '#34d399'.
 */
export interface PulseDotProps extends HTMLAttributes<HTMLDivElement> {
  label: ReactNode;
  color?: string;
}

export function PulseDot({ label, color = '#34d399', className, style, ...rest }: PulseDotProps) {
  return (
    <div {...rest} className={['status-wrap', className].filter(Boolean).join(' ')} style={{ '--status-color': color, ...style } as CSSProperties}>
      <div className="pulse-dot" aria-hidden="true" />
      <span className="status-text">{label}</span>
    </div>
  );
}

export default PulseDot;
PulseDot.css
/* PulseDot — ported from astro-component-kit (feedback/PulseDot.astro) */

.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: pulse-dot-status-pulse 1.8s infinite; 
}

@keyframes pulse-dot-status-pulse { 
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(3.5); opacity: 0; } 
}

.status-text { white-space: nowrap; }

Краткая информация

Категория
Уведомления
Имя файла
PulseDot.tsx
Зависимости
Нет — чистый React + CSS
Теги
indicatorstatus