Skip to content
Sign upGet access
MicrointeractionsLock grantMenu

Lock grant

A permission that unlocks, physically: the shackle lifts and swings open and the row turns green.

Grant a tool permission and the shackle lifts and swings open as the row turns green; revoke and it drops back and clicks shut.

The row's lock is closed while the agent cannot do the thing. Grant it and the shackle lifts out of the body and swings open on its hinge, the row takes the green of things allowed and the switch slides over. Revoke and the shackle drops back in and clicks shut. One row, one decision, readable from across the room.

Installation

$ pnpm dlx shadcn@latest add https://chatcn.dev/r/lock-grant.json

Usage

tsx
import { LockGrant } from "@/components/ui/chatcn/lock-grant"

<LockGrant label="Read your calendar" detail="Scheduling agent, this session" granted={granted} onGrantedChange={setGranted} />

Props

PropTypeNotes
labelstringWhat is being allowed
detailstringWho gets it, or for how long
granted / onGrantedChangeboolean

Keyboard

KeyAction
Space / EnterGrant or revoke

Accessibility

  • A role="switch" button with aria-checked, named by its label.

Motion

  • The shackle lifts, then turns on its hinge, 160 ms each; the row colour fades 300 ms. Reduced motion: the shackle just rises.