Device Capability Grid
A full device-capability diagnostic card — the expanded sibling of Device Badge — with a stats bar, feature-flag grid, storage, and browser/OS footer.
Device Capability Grid
The Device Capability Grid is the expanded sibling of the Device Badge: a full diagnostic card reading useCapabilities. It renders a stats bar (CPU cores / memory / GPU), a status row per feature flag (WebGPU, WASM, SIMD, Threads, IndexedDB, Web Workers), a storage row, and a browser/OS footer, with a spinner while detection runs. It does not replace the Device Badge.
Preview
Installation
pnpm dlx shadcn@latest add @localmode/ui/local-first/device-capability-gridnpx shadcn@latest add @localmode/ui/local-first/device-capability-gridyarn dlx shadcn@latest add @localmode/ui/local-first/device-capability-gridbunx --bun shadcn@latest add @localmode/ui/local-first/device-capability-gridData source & dependencies
Data source: detects device capabilities via the bundled useCapabilities navigator hook — self-contained, works in any React app, no backend required. (It mirrors the detection useCapabilities from @localmode/react performs.)
@localmode/ui/lib/use-environment— the bundleduseCapabilitiesnavigator hook (installed automatically as a registry dependency)lucide-react— iconsclsx+tailwind-merge— via the sharedcn()util (installed automatically as a registry dependency)
Files installed
device-capability-grid.tsx— theDeviceCapabilityGridcomponentlib/use-environment.ts— the bundleduseCapabilitiesnavigator hooklib/utils.ts— thecn()helper (if not already present)
Examples
Full diagnostic
<DeviceCapabilityGrid />Customization
Each feature row shows a colored dot (emerald when on, muted when off). Add or remove flags by editing the FEATURES array in the copied file. Styled entirely with shadcn/ui CSS-variable utilities so it inherits your theme — because you own the copied file, every class and threshold is yours to change.
Capability Gate
A true gate: renders children only when the device meets a stated requirement (e.g. WebGPU), otherwise a themed fallback with guidance.
Browser Compat Card
A per-model runnability report: a pass/fail RAM-headroom bar, storage, threading, estimated speed, warnings, and a canRun gate. RAMUsageBar is independently usable.