Capability Gate
- from @localmode
- by LocalMode
A true gate: renders its children only when the device meets a stated requirement (e.g. requires="webgpu"), otherwise a themed fallback slot with guidance. The capability check uses useCapabilities. Local models have hard device requirements (LiteRT Gemma is WebGPU-only), so gating prevents a broken experience. The read-only display sibling is DeviceBadge.
Install
New to shadcn? Set up your project
If your project already has a shadcn components.json, skip initialization. Otherwise, run this once from your project root.
pnpm dlx shadcn@latest initpnpm dlx shadcn@latest add @localmode/ui/local-first/capability-gateLive preview
No live preview has been built for this component yet.
Registry dependencies2
- @localmode/ui/lib/utils
- @localmode/ui/lib/use-environment
Packages0
No npm packages are installed with it.
