Components
Status Indicator
A small presence dot with an optional pulse animation.
Installation
$ npx veil-ui@latest add status-indicatorUsage
import { StatusIndicator } from "@/components/ui/status-indicator";
<StatusIndicator status="online" />;Examples
Basic
OnlineAwayIn a meetingOffline
Pulse
Live
API reference
| Prop | Type | Default | Description |
|---|---|---|---|
| status | "online" | "offline" | "busy" | "away" | "online" | Presence state and color. |
| label | string | — | Visible label; defaults to the status name. |
| pulse | boolean | false | Adds a soft ping animation. |
Accessibility
- The dot is decorative; the status text is rendered for everyone.
- Set
pulseonly when the state is live, and respect reduced motion in custom styles.
Vue and plain HTML
This component also ships for Vue (Reka UI) and plain HTML. Install it with npx veil-ui add status-indicator --framework vue or switch the framework in components.json.
<script setup lang="ts">
import { computed } from "vue";
import { cn } from "@/lib/utils";
const tones = {
online: "bg-emerald-500",
offline: "bg-muted-foreground",
busy: "bg-red-500",
away: "bg-amber-500",
} as const;
const props = withDefaults(
defineProps<{
status?: keyof typeof tones;
label?: string;
pulse?: boolean;
class?: string;
}>(),
{ status: "online", pulse: false },
);
const tone = computed(() => tones[props.status]);
</script>
<template>
<span
data-slot="status-indicator"
:data-status="props.status"
:class="
cn(
'inline-flex items-center gap-1.5 text-xs text-muted-foreground',
props.class,
)
"
>
<span class="relative flex size-2" aria-hidden="true">
<span
v-if="props.pulse"
:class="
cn(
'absolute inline-flex size-full animate-ping rounded-full opacity-75',
tone,
)
"
/>
<span
:class="cn('relative inline-flex size-2 rounded-full', tone)"
/>
</span>
{{ props.label ?? props.status }}
</span>
</template>