Confirmation
An alert-based component for managing tool execution approval workflows with request, accept, and reject states.
This tool wants to delete the file
/tmp/example.txt . Do you approve this action? Installation
If you prefer using jsrepo, please install via the command below:
Examples
Approval Request State
This tool wants to execute a query on the production database:
SELECT * FROM users WHERE role = 'admin' Approved State
You approved this tool execution
Rejected State
You rejected this tool execution
Props
Confirmation
| Name | Type | Default |
|---|---|---|
approval | ToolUIPartApproval | |
state | ToolUIPartState | |
class | string | |
children | Snippet | |
...restProps | HTMLAttributes<HTMLDivElement> | |
ConfirmationTitle
| Name | Type | Default |
|---|---|---|
class | string | |
children | Snippet | |
ConfirmationRequest
| Name | Type | Default |
|---|---|---|
children | Snippet | |
ConfirmationAccepted
| Name | Type | Default |
|---|---|---|
children | Snippet | |
ConfirmationRejected
| Name | Type | Default |
|---|---|---|
children | Snippet | |
ConfirmationActions
| Name | Type | Default |
|---|---|---|
class | string | |
children | Snippet | |
ConfirmationAction
| Name | Type | Default |
|---|---|---|
variant | 'default' | 'destructive' | 'outline' | 'secondary' | 'ghost' | 'link' | 'default' |
size | 'default' | 'sm' | 'lg' | 'icon' | 'sm' |
class | string | |
children | Snippet | |
onclick | (e: MouseEvent) => void | |
...restProps | HTMLButtonAttributes | |