aiellie

Search

Find a component, template or page

GitHub
Components

Approval Mode Menu

How much an agent may do without asking, chosen from the composer: auto, manual, accept edits and plan, with full access set apart.

Open full screen
fig. 01 · open it full screen from the corner

Installation

npx shadcn@latest add "@aiellie/approval-mode-menu"

shadcn needs the @aiellie registry in components.json first. npx aiellie add approval-mode-menu adds it on its first run, then installs the same way.

Approval Mode Menu chooses how much an agent may do without asking, from the composer. Each mode says what it allows under its name: Auto asks only when something looks risky, Manual asks every time, Accept edits writes files freely, and Plan changes nothing until you agree. Full access, which never asks, sits under a rule in the destructive ink, and the button turns that ink while it's chosen.

Getting started

  1. Add it beside the composer

    components/agent-input.tsx
    "use client"
    
    import * as React from "react"
    
    import { ApprovalModeMenu } from "@/components/aiellie/approval-mode-menu"
    
    export function AgentMode() {
      const [mode, setMode] = React.useState("auto")
      return <ApprovalModeMenu value={mode} onValueChange={setMode} />
    }

    Your agent decides what each mode means. The menu only keeps the choice.

Anatomy

<button data-slot="approval-mode-menu" data-destructive /> {/* menu trigger */}
<div data-slot="menu-content"> {/* in a portal */}
  <div data-slot="menu-radio-group">
    {/* a row per mode: icon, name, description, tick */}
    {/* a rule, then the destructive modes */}
  </div>
</div>

It's the aiellie Menu with radio rows, so arrow keys move through the modes and the chosen one carries a tick.

Examples

Your own modes

modes replaces the list. Mark a mode destructive to set it apart.

API reference

ApprovalModeMenu

PropTypeDefaultDescription
valuestringrequiredThe chosen mode's id.
onValueChange(value: string) => voidrequired
modesApprovalMode[]APPROVAL_MODESThe modes.
labelstring"Approvals"Heads the menu and is read out on the button.
side, alignWhere the menu opens.
renderReactElementa small ghost ButtonThe button it renders as.

All other menu trigger props are forwarded.

ApprovalMode

FieldTypeDefaultDescription
idstringrequired
namestringrequired
descriptionstringrequiredWhat it allows.
iconIconSvgElementrequiredA Hugeicons glyph.
destructivebooleanSets it apart under a rule, in the destructive ink.