Lock Status Badge
A compact session-lock indicator — locked, unlocked, or no-vault — with distinct iconography and an accessible text label.
Lock Status Badge
The Lock Status Badge is a compact chip that shows the session-lock state of
an encrypted vault: locked, unlocked, or no-vault. Each state has distinct
iconography and an accessible text label (state is announced as text, never color
alone).
Presentational and key-safe. The badge holds no key material and performs no crypto — pass the current lock state in. Recommended LocalMode source: the
statusfield ofuseEncryptedVaultfrom@localmode/react(map its'uninitialized' | 'locked' | 'unlocked'onto'no-vault' | 'locked' | 'unlocked') — a recommendation, never a requirement.
When to use it: any header, toolbar, or item list that needs to surface whether an encrypted vault is currently locked.
Preview
Installation
pnpm dlx shadcn@latest add @localmode/ui/security-privacy/lock-status-badgenpx shadcn@latest add @localmode/ui/security-privacy/lock-status-badgeyarn dlx shadcn@latest add @localmode/ui/security-privacy/lock-status-badgebunx --bun shadcn@latest add @localmode/ui/security-privacy/lock-status-badgeDependencies
- Data source: renders the
statusyou pass. Works with any backend. Recommended LocalMode hook:useEncryptedVault(optional). lucide-react— iconsclsx+tailwind-merge— via the sharedcn()util (installed automatically as a registry dependency)
Files installed
lock-status-badge.tsx— the componentlib/utils.ts— thecn()helper (if not already present)
Props
LockStatusBadge
Prop
Type
Examples
Reflect the vault's lock state
import { useEncryptedVault } from '@localmode/react';
import { LockStatusBadge } from '@/components/lock-status-badge';
export function VaultHeader() {
const { status } = useEncryptedVault({ name: 'notes' });
return <LockStatusBadge status={status === 'uninitialized' ? 'no-vault' : status} />;
}Custom label
<LockStatusBadge status="unlocked" label="Session open" />Customization
Each state's icon and semantic token classes live in a small STATUS_CONFIG map
in the copied file — swap the icons, retune the colors, or change the default
labels to match your design system. Because you own the file, the state-to-token
mapping is yours to change.
Vault Item Card
A lock-state-aware card for an encrypted note or document — masked while locked, decrypt-on-view when unlocked. Never receives ciphertext or keys.
DevTools
Local-AI observability surfaces — queue, event, pipeline, and model-cache monitors that render @localmode/devtools hook snapshots (or any backend's data) with zero @localmode dependencies.