@cdr-kit/react/Components/Vault

Vault

Compound component — Clerk's SignedIn / SignedOut pattern adapted to CDR. A single access drives the shared state; Vault.Locked, Vault.Loading, and Vault.Unlocked render against it.
import { Vault } from "@cdr-kit/react"

Usage

SignalView.tsx
<Vault uuid={4200} auto>
<Vault.Locked>   <SubscribeButton /> </Vault.Locked>
<Vault.Loading>  <CdrSkeleton lines={3} /> </Vault.Loading>
<Vault.Unlocked> {(data) => <SignalView bytes={data} />} </Vault.Unlocked>
</Vault>

Slots

  • Vault.Locked — status is idle or error.
  • Vault.Loading — status is paying or collecting-partials. Optional render-prop receives { collected, threshold }.
  • Vault.Unlocked — status is ready. Render-prop receives the decrypted bytes.