Skip to content

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).

Terminal window
vsceasy subpanel add --name history --menu settings --title "History"
FlagTypeNotes
--nametextRequired. Subpanel id.
--menumenu idRequired. Container to render inside.
--titletextView title.
--withApiyes | noGenerate a typed RPC interface.
  • src/subpanels/<name>.ts — the subpanel definition.
  • src/webview/subpanels/<name>/{App.tsx,main.tsx} — the React UI.
  • Appends <Name>ViewApi to src/shared/api.ts when the API is on.
src/subpanels/history.ts
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.