Tabs in Monaco Editor

Viewed 6001

How do I make tabs in the Monaco editor like Visual Studio Code? For example, this is what I mean. enter image description here

2 Answers

There is a quite good explanation on monaco-editor GitHub.

The tab is just a visual representation of Radio Button or Simple Button for example, where you have to subscribe onChange event. In the event handler, you have to update the model and view state, e.g. switching between foo.js & foo1.js files.

editor.setModel(data[desiredModelId].model);
editor.restoreViewState(data[desiredModelId].state);
Related