Skip to content

shadcn.io is an independent project built on shadcn/ui

Performance Stats Hover Card for Vue

A 98.5% Uptime badge opens System Performance, a Healthy label, an uptime bar, 124ms, and a 0.02% error rate.

UI library: Ark UI

The trigger is a badge with an activity icon and 98.5% Uptime. The card shows System Performance, a Healthy badge, a bar filled to 98.5%, Response Time 124ms, and Error Rate 0.02%.

Use it in a status header when the badge is enough until someone asks. The bar is plain markup, not a Progress meter. In Vue, Ark UI does not measure uptime. The numbers are fixed.

Preview

Preview width

Installation

MCP · Pro
Make your AI a shadcn expert
Your agent installs components, builds pages and restyles your app from one prompt, in Claude Code, Cursor or VS Code.
Part of Pro

Anatomy

Hover Card anatomy: trigger, positioner, arrow, content

Usage

<HoverCard>
  <HoverCardTrigger :asChild="true">
    <button class="rounded-full" type="button">
      <Badge variant="secondary">
        <ActivityIcon aria-hidden="true" data-icon="inline-start" />98.5% Uptime
      </Badge>
    </button>
  </HoverCardTrigger>
  <HoverCardContent class="w-80">
    <div class="flex flex-col gap-3">
      <div class="flex items-center justify-between">
        <h4 class="font-semibold text-sm">System Performance</h4>
        <Badge class="text-success" variant="outline">Healthy</Badge>
      </div>
      <div class="flex flex-col gap-2 text-sm">
        <div>
          <div class="mb-1 flex justify-between">
            <span class="text-muted-foreground">Uptime</span>
            <span class="font-medium">98.5%</span>
          </div>
          <div class="h-2 overflow-hidden rounded-full bg-muted">
            <div class="h-full w-[98.5%] bg-success"></div>
          </div>
        </div>
        <div class="flex justify-between">
          <span class="text-muted-foreground">Response Time:</span>
          <span class="font-medium">124ms</span>
        </div>
        <div class="flex justify-between">
          <span class="text-muted-foreground">Error Rate:</span>
          <span class="font-medium">0.02%</span>
<!-- The rest of the file is under Installation. -->

FAQ

What is in the card?

System Performance with a Healthy outline badge in text-success, Uptime 98.5% over a bar filled to 98.5% with bg-success, Response Time 124ms and Error Rate 0.02%.

How is the uptime badge made the trigger?

HoverCardTrigger takes as-child, and the demo passes the uptime badge.

Is the uptime bar a progress bar?

No, it is two divs, a muted track and a filled bar, because the number beside it already carries the value. Use Progress when the bar has to be announced on its own.

How wide is the card?

w-80 on the card, for the extra content. The class is on HoverCardContent.

How do I change how fast the card opens and closes?

The card opens a moment after the pointer rests on the trigger and stays up long enough for the pointer to move into it. Both delays are in milliseconds. Set openDelay and closeDelay on HoverCard; they default to 10 and 100. positioning picks another side than the bottom.

Does the card open from the keyboard and on touch screens?

Focusing the badge opens the card, moving focus away or pressing Escape closes it. Touch screens have no hover, so keep what matters reachable elsewhere, or use a Popover when the card has to open on a tap.

API Reference

Hover Card

Sets asChild. The rest is on the Hover Card page.

Badge

Sets variant="secondary" and variant="outline". The rest is on the Badge page.