Triplex for VS Code turns Visual Studio Code and Cursor into a visual IDE, bringing the best features of Triplex for you to stay in context while coding.
Installation
- Visit the Visual Studio Code marketplace
- Press the "Install" button
- Make sure "Auto Update" is checked
Opening Components
Using the CodeLens action
The Open in Triplex CodeLens action appears next to component functions. Clicking it opens the component in Triplex.
Using the Command Palette
While focused in a tsx or jsx file selecting the Triplex: Open File action through the Command Palette will open the first found component of that file in Triplex.
Excluding files
By default all React components can be opened by Triplex. When wanting to scope down files that can be opened you can create a configuration file and populate the "files" field.
For example the following configuration marks all tsx files inside the components folder can be opened, everything else is excluded.
{
"files": ["../src/components/**/*.tsx"]
}For more information see config.json Options > files.
Common Questions
Why is there a SharedArrayBuffer is not defined error?
Visual Studio Code by default doesn't run in a secure context which means certain APIs are unavailable, like SharedArrayBuffer. To enable these APIs you need to close all instances of Visual Studio Code and then re-open with the --enable-coi flag.
code --enable-coiThis flag was introduced on September 2022 (version 1.72).
Why can't I open one of my components?
Only components that are exported can be opened in Triplex. If you're trying to open a component that isn't exported you'll need to export it first.
-function Component(): JSX.Element;
+export function Component(): JSX.Element;How do I reload the editor?
If there's a problem and the editor has been put into an invalid state you can reload the editor by accessing the command palette via Shift + Cmd + P then selecting "Developer: Reload Webviews".
If you think you've found a bug please raise an issue on GitHub.
Next Steps
Learn how to start a project and work with Triplex.