LockStatus

Shows a badge naming the record's lock holder and updates when the lock is taken or released. Renders nothing for a free record unless renderFree is supplied. Needs a realtime data provider with lock support.

Installation

pnpm dlx shadcn@latest add @chelone/lock-status
Loading preview…

Shows a badge naming the record's lock holder and updates when the lock is taken or released. Renders nothing for a free record unless renderFree is supplied. Needs a realtime data provider with lock support.

See the realtime guide for provider setup and usage.

Props

PropTypeDefaultDescription
idIdentifier—Defaults to the id of the record context.
renderFree() => ReactNode—Rendered when the record is free. Defaults to nothing.
renderLock(lock: Lock) => ReactNode—Replaces the default badge naming the holder.
resourcestring—Defaults to the resource context.