Dev Design Library

Cache Badge

Annotates a result as served from the semantic cache, optionally with the hit latency (e.g. "cached · 12ms"). Drive cached/latencyMs from a useSemanticCache lookup result. Renders nothing when cached is false, so it is safe to drop next to.

Cache Badge preview
Library
LocalMode
Framework
React
Type
component
License
MIT
Dependencies
lucide-react
Install
npx shadcn add @localmode/ui/ui/local-first/cache-badge
Files
  • apps/ui/registry/localmode/local-first/cache-badge/cache-badge.tsx
  • apps/ui/registry/localmode/lib/utils.ts
Source
https://github.com/LocalMode-AI/LocalMode

Categories

More from LocalMode