Skip to content

panel add

Add a panel: a webview that opens in the editor area, with a React UI and an optional typed RPC bridge.

Terminal window
vsceasy panel add --name settings --title "Settings"

Flags

FlagTypeNotes
--nametextRequired. Panel id, e.g. settings.
--titletextTab title. Defaults to PascalCase of name.
--templateblank | form | list | dashboardStarter UI. Default blank.
--withApiyes | noGenerate a typed RPC interface. Forced on for non-blank templates.

What it generates

  • src/panels/<name>.ts — the panel definition.
  • src/webview/panels/<name>/{App.tsx,main.tsx} — the React UI.
  • Appends <Name>Api to src/shared/api.ts when the API is on.
  • An auto command <prefix>.open<Name> to open it.

Templates

--template starts you from a working screen built on the shared component library (auto-generated on first use) and wires the matching RPC method.

Terminal window
vsceasy panel add --name signup --template form # inputs + save() RPC
vsceasy panel add --name items --template list # list + load() RPC
vsceasy panel add --name stats --template dashboard # stat cards + stats() RPC
TemplateUIRPC method added
blankempty App.tsxnone
forminputs + Savesave(input)
listlist + Refreshlist()
dashboardstat cardsstats()

Example

src/panels/settings.ts
import { definePanel } from '../shared/vsceasy';
import type { SettingsApi } from '../shared/api';
export default definePanel<SettingsApi>({
title: 'Settings',
rpc: (vscode) => ({
// add RPC handlers here
}),
});