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"

Flags

FlagTypeNotes
--nametextRequired. Subpanel id.
--menumenu idRequired. Container to render inside.
--titletextView title.
--withApiyes | noGenerate a typed RPC interface.

What it generates

  • 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',
});

Subpanels and panels share the same RPC machinery — see Typed RPC.