dockview
- class trame.widgets.dockview.DockView(**kwargs)
Bases:
AbstractElementDockView component.
- Args:
- theme (string):
Theme to use for the layout manager. Possible values are: [
Abyss, AbyssSpaced, Dark, Dracula, Light, LightSpaced, Replit, VisualStudio,
]
- components (dict):
Map of components to replate using template names. Possible components to override:
watermarkComponent, rightHeaderActionsComponent, prefixHeaderActionsComponent, leftHeaderActionsComponent, defaultTabComponent
- default_renderer (string):
Possible values: always | onlyWhenVisible
- disable_auto_resizing (bool):
Disable the auto-resizing which is controlled through a ResizeObserver. Call .layout(width, height) to manually resize the container.
- disable_dnd (bool):
Disable drag and drop.
- disable_floating_groups (bool):
Disable floating groups.
- disable_tabs_overflow_list (bool):
Disable tabs overflow list.
dnd_edges (bool): floating_group_bounds (dict|string):
{ minimumHeightWithinViewport: number, minimumWidthWithinViewport: number } | ‘boundedWithinViewport’
- hide_borders (bool):
Hide borders
locked (bool): no_panels_overlay (string):
Define the behaviour of the dock when there are no panels to display. Defaults to watermark. Options: watermark | emptyGroup
- popout_url (string):
Popup url
- scrollbars (string):
Select native to use built-in scrollbar behaviours and custom to use an internal implementation that allows for improved scrollbar overlay UX. This is only applied to the tab header section. Defaults to custom. Options: custom | native
- single_tab_mode (string):
Options: default | fullwidth
- ready (event):
Event emitted when the component is ready.
- active_panel (event):
Event emitted when a panel is activated. The $event will be equal to the id used when creating the panel.
- remove_panel (event):
Event emitted when a panel is removed. The $event will be equal to the panel id provided at the panel creation.
- layout_changed (event):
Event emitted (debounced) whenever the layout changes. The $event will be equal to the serialized layout (api.toJSON()), which can be fed back to restore_layout().
- panel_visibility (event):
Event emitted when a panel becomes visible or hidden. The $event will be equal to { id, visible }.
- add_panel(id, title, template_name, **add_on)
Add a new panel to the layout. This can only be called once the widget is ready.
- Args:
- id (string):
Unique identifier for that panel
- title (string):
Title showing up in the tab.
- template_name (string):
Name of the trame layout to be placed inside the panel.
- **kwargs:
Additional parameter to control where the panel should be added. (https://dockview.dev/docs/core/panels/add#positioning-the-panel)
- remove_panel(id)
Remove/Close an existing panel within the layout. This can only be called once the widget is ready.
- Args:
- id (string):
Unique identifier for that panel
- active_panel(id)
Activate an existing panel within the layout. This can only be called once the widget is ready.
- Args:
- id (string):
Unique identifier for that panel
- move_panel_to(id, position)
Move an existing panel within the layout.
- Args:
- id (string):
Unique identifier for that panel.
- position (dict):
Same shape as add_panel’s position add-on:
{"referencePanel": <panel id>, "direction": <dir>}.directionaccepts add_panel’s values (“within”, “left”, “right”, “above”, “below”); “within” (the default) stacks the panel as a tab in the reference panel’s group. Without a referencePanel the move is relative to the panel’s own group.
- restore_layout(layout)
Restore a layout previously captured via the layout_changed event.
- Args:
- layout (dict):
Serialized layout as provided by the layout_changed event (api.toJSON()).