File Management
Keep your application tabs in sync with the canvas. The canvas manages the list of open files and the active selection.
File Management allows you to synchronize your application's tab bar with the list of files open in the canvas.
By connecting your UI to the canvas's session state, you ensure that the active file and tab names are always accurate, even if the user switches files from within the canvas canvas.
- Automatic Updates: Your UI reacts instantly when files are opened or closed in the canvas.
- Two-Way Control: Switch tabs from your own UI or let the canvas handle the interaction.
- Consistent State: The canvas acts as the source of truth for the file list.
Switch tabs from the host and listen for tab state changes.
Set active tab
Listen for fileTabs
The sync process works in two ways: you tell the canvas which file to show, and the canvas tells your app which files are open.
1. Host Switches Tab
When a user clicks a tab in your parent UI, command the canvas to switch.
2. Canvas Updates State
When the file loads or the user switches tabs manually, the canvas emits the full tab list.
Sync file tabs in your UI and keep the active selection aligned.
Try the interactive preview below to see how events flow between the host and the canvas.
Interactive Workbench
File tabs preview
Open multiple files one at a time and monitor the tabs emitted by the Canvas.
Keep tab sync connected to file payload references.
- Canvas Setup: Canvas Iframe Initialization
- File Upload: File Upload
- File API: API References
