File Management
Keep your application tabs in sync with the viewer. The viewer 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 viewer.
By connecting your UI to the viewer's session state, you ensure that the active file and tab names are always accurate, even if the user switches files from within the viewer canvas.
- Automatic Updates: Your UI reacts instantly when files are opened or closed in the viewer.
- Two-Way Control: Switch tabs from your own UI or let the viewer handle the interaction.
- Consistent State: The viewer 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 viewer which file to show, and the viewer tells your app which files are open.
1. Host Switches Tab
When a user clicks a tab in your parent UI, command the viewer to switch.
2. Viewer Updates State
When the file loads or the user switches tabs manually, the viewer 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 viewer.
Interactive Workbench
File tabs preview
Open multiple files one at a time and monitor the tabs emitted by the viewer.
Keep tab sync connected to file payload references.
- Viewer Setup: Canvas Iframe Initialization
- File Upload: File Upload
- File API: API References
