Skip to content
PreviewA destructive act draws only Allow once, in the danger tone, and asks every time. Escape denies; the Dismiss button closes it without a decision.
Describe a change, @ to add files

PermissionPrompt

titlerequired
ReactNode
The act and the thing it names: "Delete agent Rosalind".
agentrequired
ReactNode
Who asks: its avatar, its name and its model, composed with the kit.
target
ReactNode
Where the act lands: "Release notes", "acme/web".
toolIcon
IconName
The tool's mark beside the target.
section
ReactNode
The place inside the target, when both are worth naming.
removes
ReactNode
What goes with it when it cannot be undone: "Rosalind's chat and memory".
facts
readonly Fact[]
Structured facts after the built-in ones (Asked by, Target, Section, Removes), one row each: "Run", "ci-4821".
risk
"safe" | "risky" | "destructive"
Default: "safe"
risky and destructive say so in the header; a destructive act turns Allow red and offers only the first choice.
reason
ReactNode
The agent's own words on why it asks.
consequences
readonly PermissionConsequence[]
Default: []
What will happen, a line each, under "What will happen".
reversibility
"reversible" | "irreversible" | "unknown"
Default: "reversible"
And irreversible for a destructive act.
choices
readonly PermissionChoice[]
Default: DEFAULT_CHOICES
How the person may allow, shortest first. Default one: Allow once.
disabled
boolean
Default: false
True while the product cannot take an answer yet: every button and choice is disabled and no key acts.
denyLabel
ReactNode
Default: "Don't allow"
The deny button's words.
allowButtonProps
PermissionButtonAttrs
The caller's own marks on the Allow button: its data-* and an accessible name, never a class, a style or a handler. The chosen choice's own buttonProps come after these.
denyButtonProps
PermissionButtonAttrs
The caller's own marks on the Don't allow button.
dismissButtonProps
PermissionButtonAttrs
The caller's own marks on the header's Dismiss button.
state
"asking" | "allowed" | "denied" | "expired"
Default: "asking"
decision
string
The choice id taken, once allowed.
until
number
When a timed grant ends, in epoch milliseconds: counted down while it asks, and the time left once decided.
now
number
The clock, when the product keeps its own; the part ticks when this is left out.
onAllow
(choice: PermissionChoice) => void | Promise<unknown>
The person allowed it, with the choice they took. A promise locks the buttons and shows a spinner; a rejection keeps the prompt asking.
onDeny
() => void | Promise<unknown>
The person did not allow it.
onExpire
() => void
The request ran out of time.
onRevoke
() => void
On the decided line: the grant can be taken back.
onChange
() => void
On the decided line: ask again, with the choice in hand.
onDismiss
() => void
The person closed it without deciding.
at
ReactNode
When the decision was recorded, in the kit's clock (fmtTime).
error
ReactNode
The decision did not land: what happened and what to do.
nesting
"contained-object"
Mark an independent tray contained in another surface. A tray docked beside the composer needs no mark.
placement
"above" | "below" | "drop"
Default: "above"
Which side of the composer it docks to. above rises from below; below drops from above. drop hangs under the box it stands in with the composer (a positioned dock), over what follows, a popup's shadow under it, so the page under the composer does not move (a home page's pickers).
motion
"enter" | "static"
Default: "enter"
enter: 120ms rise + fade on mount, 90ms fade on close. Only event-driven trays animate (a question or approval arriving, a message queued). static: appears and leaves instantly: hydrated trays and the +, / and @ pickers, which open at once.
open
boolean
Omit to mount and unmount the tray yourself (no exit motion). Pass it to let the tray keep itself mounted for its exit fade (data-exiting, inert) and unmount afterwards.
rootStyle
RootStyle<TrayKnobs>
Typed StyleX override: where the tray sits (layout) and its --tray-* knobs.

Rest props go to <div> props and render.

State machine

PreviewScout asks to deploy the preview.