AI Components / Cache Indicator
Cache Indicator
Compact inline cache status indicator with optional expanded detail card showing hit rate, latency, and clear button.
ai-devops v0.6.0
Playground
Examples
Cache hit
<ai-cache-indicator status="hit" hitRate="87" latencySaved="240ms" cacheAge="2m ago" showDetails></ai-cache-indicator> Cache miss
<ai-cache-indicator status="miss" hitRate="23" latencySaved="0ms" cacheAge="expired"></ai-cache-indicator> Stale
<ai-cache-indicator status="stale" hitRate="65" cacheAge="15m ago"></ai-cache-indicator> Import
import { AiCacheIndicator } from '@cognivo/components'; // Or tree-shake: import '@cognivo/components/ai-cache-indicator'; Per-component imports ship only that component (~8 kB gzip).
API Reference
| Prop | Type | Default | Description |
|---|---|---|---|
status | "hit"|"miss"|"stale"|"disabled"|"loading" | "disabled" | Cache status |
hitRate | number | 0 | Hit rate 0-100 |
latencySaved | string | — | Latency saved label |
cacheAge | string | — | Cache age label |
showDetails | boolean | false | Show detail card |
Events
| Event | Detail | Description |
|---|---|---|
ai-cache-clear | {} | Clear cache clicked |
ai-cache-detail | {status, hitRate} | Detail toggled |