subpanel add
A subpanel is a webview view rendered inline inside a menu’s activity-bar container (unlike a panel, which opens in the editor area).
vsceasy subpanel add --name history --menu settings --title "History"| Flag | Type | Notes |
|---|---|---|
--name | text | Required. Subpanel id. |
--menu | menu id | Required. Container to render inside. |
--title | text | View title. |
--withApi | yes | no | Generate a typed RPC interface. |
What it generates
Section titled “What it generates”src/subpanels/<name>.ts— the subpanel definition.src/webview/subpanels/<name>/{App.tsx,main.tsx}— the React UI.- Appends
<Name>ViewApitosrc/shared/api.tswhen the API is on.
import { defineSubpanel } from '../shared/vsceasy';
export default defineSubpanel({ title: 'History', menu: 'settings', order: 2, // position inside the container titleActions: [{ command: 'clearHistory' }], // buttons on the title row});Subpanels and panels share the same RPC machinery — see Typed RPC.
Subpanels and tree views share one ordering inside a container, so a tree
view with order: 1 sits above a subpanel with order: 2. See
Sidebar views.