react-dockable-desktop
react-dockable-desktop
Classes
PanelRegistry
Defined in: components/PanelRegistry.ts:86
Registry mapping catalog entries to allow programmatic panel instantiation inside dynamic layout cells or floating windows. Exported so createWorkspace() can create scoped, per-instance registries.
Constructors
Constructor
new PanelRegistry(): PanelRegistry;Returns
Methods
get()
get(id): PanelRegistryEntry | undefined;Defined in: components/PanelRegistry.ts:109
Retrieve a registered panel configuration by identifier.
Parameters
| Parameter | Type |
|---|---|
id | string |
Returns
PanelRegistryEntry | undefined
getRegisteredIds()
getRegisteredIds(): string[];Defined in: components/PanelRegistry.ts:116
Returns a list of all registered panel entry identifiers.
Returns
string[]
register()
register<P>(
id,
Component,
defaultOptions?): void;Defined in: components/PanelRegistry.ts:95
Register a new component to the panel catalog registry.
Type Parameters
| Type Parameter |
|---|
P extends object |
Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | Unique string identifier. |
Component | ComponentType<P> | React component instance template. |
defaultOptions? | { canClose?: boolean; canDock?: boolean; canDrag?: boolean; canFloat?: boolean; canMinimize?: boolean; canPopOut?: boolean; className?: string; defaultAnchor?: FloatAnchor; disableLivePreview?: boolean; favoritePosition?: { height: string | number; width: string | number; x: string | number; y: string | number; }; icon?: ReactNode; initialTarget?: "docked" | "floating" | "tabbed"; keepAlive?: boolean; preserveEmbeds?: boolean; renderHeaderActions?: (panelId) => ReactNode; tabClassName?: string; title?: | string | { defaultMessage?: string; id: string; values?: Record<string, string | number>; } | (() => string); } | Custom default settings configuration. |
defaultOptions.canClose? | boolean | Enables/disables closing actions for the tab/window. |
defaultOptions.canDock? | boolean | false: the user can't dock this panel. Dragging it offers no group, tab or edge targets (corners still anchor a floating window), so it stays floating. The app's own docking calls always work; give the type initialTarget: 'floating' so it opens floating. Default true (7.9.0) |
defaultOptions.canDrag? | boolean | Enables/disables window drag interactions. |
defaultOptions.canFloat? | boolean | false: the user can't make this panel floating. A tab drag can't end in a floating window (dropped on nothing or on a corner, it stays where it was), and the "Float" and taskbar "Maximize" menu items are hidden. A window the app floated itself can still be moved. The app's own floatPanel always works. Default true (7.9.0) |
defaultOptions.canMinimize? | boolean | Enables/disables minimizing of the panel instance. |
defaultOptions.canPopOut? | boolean | true: a panel of this type can move into its own browser window (7.12.0), from its "Open in new window" menu item or workspace.popOutPanel(id). Needs a workspace created with popOut: true. It gates the menu item and new calls only: a window already open stays open when this changes. Default false |
defaultOptions.className? | string | Class added to each panel of this type, on its own content element (.rdd-panel-content), which moves with the panel between groups, windows and the taskbar preview. (7.8.0) |
defaultOptions.defaultAnchor? | FloatAnchor | Corner of the workspace to anchor newly-opened floating windows to. |
defaultOptions.disableLivePreview? | boolean | Disables live WebGL rendering canvas thumbnails inside the taskbar hover popup previews. |
defaultOptions.favoritePosition? | { height: string | number; width: string | number; x: string | number; y: string | number; } | Custom default bounds applied when the container is floated. |
defaultOptions.favoritePosition.height? | string | number | - |
defaultOptions.favoritePosition.width? | string | number | - |
defaultOptions.favoritePosition.x? | string | number | - |
defaultOptions.favoritePosition.y? | string | number | - |
defaultOptions.icon? | ReactNode | Icon placed next to title tags. |
defaultOptions.initialTarget? | "docked" | "floating" | "tabbed" | Initial mounting state inside the desktop layout grid. |
defaultOptions.keepAlive? | boolean | false unmounts the panel's component while it is hidden (an unselected tab, or minimized) and mounts it afresh when it is shown, to free what a heavy, rarely shown panel holds. Its own state is lost each time; its tab, title and lifecycle continue (onClose is not called), and the taskbar shows a placeholder instead of a live preview. While it is unmounted, a guard it registered with useBeforeClose is not active (its dirty flag still is), and saveLayout() saves its open-time props. Default true: panels stay mounted and keep their state, as they always have. (7.8.0) |
defaultOptions.preserveEmbeds? | boolean | Keep embedded documents and media alive when the panel moves (7.11.0): an <iframe> doesn't reload when the panel is docked, floated, minimised or restored. The library then moves the panel's element with moveBefore(), which keeps that state, in browsers that have it (Chrome and Edge 133+, Firefox 144+); in the others (Safari) it moves as before and an iframe reloads. Off by default. Default false |
defaultOptions.renderHeaderActions? | (panelId) => ReactNode | Custom header actions renderer, placing custom components in the window/tab titlebar. |
defaultOptions.tabClassName? | string | Class added to the tab of each panel of this type. (7.8.0) |
defaultOptions.title? | | string | { defaultMessage?: string; id: string; values?: Record<string, string | number>; } | (() => string) | Tab and window headers text — plain string or i18n descriptor. |
Returns
void
Functions
computeResizedRect()
function computeResizedRect(
dir,
dx,
dy,
start,
constraints): ResizeRect;Defined in: components/dragResize.ts:114
Pure function computing the new rect for an 8-directional resize handle drag.
maxW/maxH and minX/minY are independent, direction-scoped constraints rather than one "container bound" — a resize toward the fixed edge (e/s) is naturally bounded by a maximum dimension, while a resize toward the moving edge (w/n) is naturally bounded by a minimum position, and the two calling sites this was extracted from need different subsets of these (see workspace/floatingWindowDrag.ts's startResize, which omits all four and lets a window grow unbounded and be dragged fully off-screen, vs. panelOverlay/FloatingWidget.tsx's handleResizePointerDown, which supplies all four to keep windows within their container).
Parameters
| Parameter | Type |
|---|---|
dir | ResizeDir |
dx | number |
dy | number |
start | ResizeRect |
constraints | ResizeConstraints |
Returns
createWorkspace()
File
index.ts
Description
Public entry point for react-dockable-desktop 7.
Components carry an Rdd prefix, so they never collide with a UI kit's own Toolbar, Sidebar or ContextMenu. The full 6.x → 7.0 map is in the migration guide.
The library's modules still use their internal names; this file is the only place the 7.0 names are defined, and api-surface.json pins exactly what it exports.
Call Signature
function createWorkspace<TPanels, TEvents>(config): TypedWorkspace<TPanels, TEvents>;Defined in: api/index.tsx:77
Creates a workspace from a map marked by definePanels (7.10.0): openPanel takes only the registered names, with props checked against each panel's component. To name the events as well, pass both type arguments: createWorkspace<typeof panels, AppEvents>({ panels }).
Type Parameters
| Type Parameter | Default type |
|---|---|
TPanels extends Record<string, PanelDefinition> | - |
TEvents extends object | Record<string, unknown> |
Parameters
| Parameter | Type |
|---|---|
config | WorkspaceConfig & { panels: PanelMap<TPanels>; } |
Returns
TypedWorkspace<TPanels, TEvents>
Call Signature
function createWorkspace<TEvents>(config?): Workspace<TEvents>;Defined in: api/index.tsx:90
Creates a workspace. Pass it to <DockableDesktopProvider workspace={…}>.
Type Parameters
| Type Parameter | Default type |
|---|---|
TEvents extends object | Record<string, unknown> |
Parameters
| Parameter | Type |
|---|---|
config? | WorkspaceConfig |
Returns
Workspace<TEvents>
Example
interface AppEvents { 'layer:select': { layerId: string } }
export const workspace = createWorkspace<AppEvents>({
panels: { map: { component: MapPanel } },
initialState: localStorage.getItem('layout'),
});definePanels()
function definePanels<TPanels>(panels): PanelMap<TPanels>;Defined in: api/index.tsx:58
Marks a panel map for typing (7.10.0). Returns it unchanged; a workspace created from it gets a typed openPanel: only registered names, and props checked against that panel's component.
Type Parameters
| Type Parameter |
|---|
TPanels extends Record<string, PanelDefinition> |
Parameters
| Parameter | Type |
|---|---|
panels | TPanels |
Returns
PanelMap<TPanels>
Example
const panels = definePanels({ map: { component: MapPanel }, chart: { component: ChartPanel } });
const workspace = createWorkspace({ panels });
workspace.openPanel('c1', 'chart', { props: { series: 3 } }); // checked against ChartPanel's propsformatLabel()
function formatLabel(label, formatter): string;Defined in: core/messages.ts:22
Helper to resolve dynamic label strings or localizable descriptor objects into text.
Parameters
| Parameter | Type |
|---|---|
label | | string | MessageDescriptor | (() => string) | undefined |
formatter | MessageFormatter |
Returns
string
isComputedRtl()
function isComputedRtl(el): boolean;Defined in: utils/rtl.ts:36
Whether el is laid out right-to-left, as the browser computes it — from a dir attribute on any ancestor, the CSS direction property, or the workspace's own setDirection.
Use this, not document.documentElement.dir, wherever a pointer delta (physical) is turned into a size, side or index (logical): RTL is often set on <body> or a wrapper rather than <html>, and the workspace can be RTL on an LTR page.
Parameters
| Parameter | Type |
|---|---|
el | Element | null | undefined |
Returns
boolean
isElementRtl()
function isElementRtl(el): boolean;Defined in: utils/rtl.ts:3
Parameters
| Parameter | Type |
|---|---|
el | HTMLElement | null |
Returns
boolean
isSerializable()
function isSerializable(value): boolean;Defined in: components/serializable.ts:21
Recursively checks whether a value can round-trip through JSON.stringify/JSON.parse without silently losing information.
Deliberately not a JSON.stringify try/catch — that call doesn't throw for the actual failure case this guards against: a function-valued property is simply dropped by JSON.stringify, not rejected. This walks the value tree instead, returning false as soon as it finds a function, symbol, undefined, React element, or any non-plain object (a class instance, Map, Set, RegExp, etc.).
Date is treated as an explicit exception — serializable-enough, matching JSON.stringify's own behavior — even though it doesn't round-trip back to a Date instance on parse. That's a smaller, more tolerable gotcha than a silently-vanishing function, so it's documented rather than treated as a disqualifying case.
Used to decide whether a docked/floating panel's props can be included in the workspace's saveLayout() output — see PanelInfo.serializable.
Parameters
| Parameter | Type |
|---|---|
value | unknown |
Returns
boolean
RddFloatingWidget()
function RddFloatingWidget(props):
| ReactElement<unknown, string | JSXElementConstructor<any>>
| null;Defined in: components/panelOverlay/FloatingWidget.tsx:108
A floating widget inside a panel — anchored within an RddPanelOverlay.
Docks to any corner, drags free of it, and drops back onto one. Windows sharing a corner stack along the block axis with animated offsets. An axis can also span the panel instead of carrying a fixed size, so the window tracks the panel as it resizes — see RddFloatingWidgetProps.defaultStretch and Stretch.
Resize handles follow what is actually movable: a free-floating window is pinned by nothing and offers all eight, while a docked one offers only its free edges — plus both ends of any spanning axis, either of which releases it.
Parameters
| Parameter | Type |
|---|---|
props | RddFloatingWidgetProps |
Returns
| ReactElement<unknown, string | JSXElementConstructor<any>> | null
Examples
const [infoOpen, setInfoOpen] = useState(false);
<RddFloatingWidget
id="layer-info" title="Layer Info"
open={infoOpen} onClose={() => setInfoOpen(false)}
defaultAnchor="top-right" defaultWidth={300} defaultHeight={200}
>
<LayerInfoContent />
</RddFloatingWidget>// A full-width status strip along the bottom, tracking the panel's width.
// defaultHeight still applies; defaultWidth is what the inline axis returns to if released.
<RddFloatingWidget
id="timeline" title="Timeline"
open onClose={close}
defaultAnchor="bottom-left" defaultStretch="width"
defaultWidth={240} defaultHeight={120}
>
<TimelineContent />
</RddFloatingWidget>RddPanelOverlay()
function RddPanelOverlay(__namedParameters): ReactElement;Defined in: components/panelOverlay/PanelOverlayRoot.tsx:75
Context provider and layout root for the Panel Overlay system. Wrap your panel content with this to enable RddPanelToolbar, RddFloatingWidget, and useFloatingWidgets.
Parameters
| Parameter | Type |
|---|---|
__namedParameters | RddPanelOverlayProps |
Returns
ReactElement
Example
function MyPanel() {
return (
<RddPanelOverlay style={{ position: 'relative', width: '100%', height: '100%' }}>
<RddPanelToolbar position="top">...</RddPanelToolbar>
<div className="my-panel-body">content</div>
</RddPanelOverlay>
);
}RddPanelToolbar()
function RddPanelToolbar(__namedParameters): ReactElement;Defined in: components/panelOverlay/PanelToolbar.tsx:43
Toolbar strip that attaches to any edge of an RddPanelOverlay. Left/right toolbars inset automatically to avoid overlapping top/bottom toolbars. RTL layouts are detected and handled automatically.
Parameters
| Parameter | Type |
|---|---|
__namedParameters | RddPanelToolbarProps |
Returns
ReactElement
Example
<RddPanelToolbar position="top" variant="frosted">
<RddToolbarButton icon={<SaveIcon />} title="Save" onClick={save} />
<RddToolbarToggle icon={<GridIcon />} title="Grid" active={grid} onToggle={() => setGrid(v => !v)} />
</RddPanelToolbar>RddSidePanels()
function RddSidePanels(__namedParameters): ReactElement;Defined in: api/index.tsx:374
Renders the side drawers opened through useSidePanels.
Parameters
| Parameter | Type |
|---|---|
__namedParameters | RddSidePanelsProps |
Returns
ReactElement
RddToasts()
function RddToasts(__namedParameters):
| ReactElement<unknown, string | JSXElementConstructor<any>>
| null;Defined in: components/Toast.tsx:474
Portal-rendered notification host. Mount once at your app root, outside the workspace container. All toast.* calls are routed here automatically via the internal event emitter.
Parameters
| Parameter | Type |
|---|---|
__namedParameters | RddToastsProps |
Returns
| ReactElement<unknown, string | JSXElementConstructor<any>> | null
Example
<RddToasts position="top-right" progressBar />RddToolbarButton()
function RddToolbarButton(__namedParameters): ReactElement;Defined in: components/panelOverlay/PanelToolbar.tsx:131
Icon button for use inside a PanelToolbar.
Parameters
| Parameter | Type |
|---|---|
__namedParameters | RddToolbarButtonProps |
Returns
ReactElement
RddToolbarCenter()
function RddToolbarCenter(__namedParameters): ReactElement;Defined in: components/panelOverlay/PanelToolbar.tsx:206
Centers its children within the toolbar using absolute positioning.
Parameters
| Parameter | Type |
|---|---|
__namedParameters | { children: ReactNode; } |
__namedParameters.children | ReactNode |
Returns
ReactElement
RddToolbarItem()
function RddToolbarItem(__namedParameters): ReactElement;Defined in: components/panelOverlay/PanelToolbar.tsx:199
Wrapper for a custom non-button control (e.g. a dropdown or input) inside a PanelToolbar.
Parameters
| Parameter | Type |
|---|---|
__namedParameters | { children: ReactNode; } |
__namedParameters.children | ReactNode |
Returns
ReactElement
RddToolbarSearch()
function RddToolbarSearch(__namedParameters): ReactElement;Defined in: components/panelOverlay/ToolbarSearch.tsx:51
Debounced async search field for use inside a PanelToolbar. Renders as a compact icon button that expands into a text input on activation. Results appear in a portal-rendered dropdown below the input.
Parameters
| Parameter | Type |
|---|---|
__namedParameters | RddToolbarSearchProps |
Returns
ReactElement
Example
<ToolbarSearchInput
placeholder="Find layer…"
onSearch={(q, signal) => fetchLayers(q, { signal })}
onSelect={result => workspace.focusLayer(result.id)}
/>RddToolbarSeparator()
function RddToolbarSeparator(): ReactElement;Defined in: components/panelOverlay/PanelToolbar.tsx:185
Vertical (or horizontal) divider line between groups of toolbar items.
Returns
ReactElement
RddToolbarSpacer()
function RddToolbarSpacer(): ReactElement;Defined in: components/panelOverlay/PanelToolbar.tsx:192
Flex-grow spacer that pushes subsequent toolbar items to the far edge.
Returns
ReactElement
RddToolbarToggle()
function RddToolbarToggle(__namedParameters): ReactElement;Defined in: components/panelOverlay/PanelToolbar.tsx:165
Two-state icon toggle button for use inside a PanelToolbar. Sets aria-pressed automatically.
Parameters
| Parameter | Type |
|---|---|
__namedParameters | RddToolbarToggleProps |
Returns
ReactElement
sectionToTab()
function sectionToTab(section, fallbackIcon?): SidebarTab;Defined in: components/PanelContributionContext.tsx:158
Converts a contributed sidebar section into a SidebarTab for <RddSidebar tabs={...}>. SidebarTab.icon is optional but recommended unless the tab is hidden; supply fallbackIcon for sections that omit one. eagerMount/preserveState have no contribution-side equivalent — a contribution only exists while its owning panel is mounted and active, so both are left unset.
Parameters
| Parameter | Type | Default value |
|---|---|---|
section | PanelSidebarSection | undefined |
fallbackIcon | ReactNode | null |
Returns
startPointerDrag()
function startPointerDrag<TStart>(config): void;Defined in: components/dragResize.ts:42
Starts a pointer-capture-based drag: captures the pointer on element, tracks movement via listeners scoped to that element's own lifetime (not window), and cleans up automatically on release or cancel, and (7.9.0) when the window loses focus or the capture is lost, so a drag can never outlive its element or leave its classes behind.
Type Parameters
| Type Parameter |
|---|
TStart |
Parameters
| Parameter | Type |
|---|---|
config | PointerDragConfig<TStart> |
Returns
void
useActiveContribution()
function useActiveContribution(): PanelContribution | null;Defined in: components/PanelContributionContext.tsx:131
Returns whatever the currently active panel (state.activePanelId) has published via usePanelContribution(), or null if no panel is active or the active panel hasn't contributed anything. When the active panel shows a managed widget moved out of its owner panel (7.11.0), this is the owner's contribution. Intended for the app shell to merge into its own <RddToolbar items={...}> / <RddSidebar tabs={...}> calls.
Returns
PanelContribution | null
Throws
Error if used outside of a DockableDesktopProvider.
useBeforeClose()
function useBeforeClose(guard): void;Defined in: api/index.tsx:235
Registers a close guard: resolve false to keep the panel open (ask the user, save first, …). Pass null to register none. Always calls the latest guard passed in.
Parameters
| Parameter | Type |
|---|---|
guard | (() => boolean | Promise<boolean>) | null |
Returns
void
useColorScheme()
function useColorScheme(): ColorScheme;Defined in: hooks/useColorScheme.ts:30
Reactively reads the page's data-color-scheme attribute on <html> — the one the host application sets to switch the library's scheme (the library itself never writes it) — returning 'dark' or 'light' and re-rendering whenever it changes.
Useful for panel content that needs to react to the same scheme the workspace itself is using — e.g. swapping a map's tile layer or an embedded editor's theme to match.
Returns 'dark' when rendered on the server.
Returns
ColorScheme
useContextMenu()
function useContextMenu(): (options) => void;Defined in: components/ContextMenu.tsx:708
Returns
(options) => void
useFloatingWidgets()
function useFloatingWidgets(): FloatingWidgetsApi;Defined in: components/panelOverlay/useFloatingWidgets.tsx:114
Imperative hook for spawning N named floating windows at runtime from data or event handlers. All widgets share z-ordering, drag, and corner-docking infrastructure of the RddPanelOverlay, and accept the same placement options — including ManagedWidget.stretch to span an axis of the panel.
Must be called inside a descendant of RddPanelOverlay, not in the component that renders it.
Returns
A stable FloatingWidgetsApi.
Example
const manager = useFloatingWidgets();
manager.open('feature-42', { title: 'Feature 42', content: <FeatureDetail id={42} />, anchor: 'top-right' });
// A full-width strip along the bottom edge:
manager.open('timeline', { title: 'Timeline', content: <Timeline />, anchor: 'bottom-left', stretch: 'width', height: 120 });useFormatMessage()
function useFormatMessage(): MessageFormatter;Defined in: components/WindowManagerContext.tsx:264
React hook to retrieve the active i18n formatter.
Returns
useHostClasses()
function useHostClasses(): HostClasses;Defined in: components/WindowManagerContext.tsx:41
Custom hook to read configured style class contexts.
Returns
useMergedSidebarTabs()
function useMergedSidebarTabs(staticTabs, fallbackIcon?): SidebarTab[];Defined in: components/PanelContributionContext.tsx:187
Convenience wrapper around useActiveContribution() for the common case: append the active panel's contributed sidebar sections (via sectionToTab) to a static tab list, as dynamic tabs that appear only while their panel is active. Returns staticTabs unchanged when there's nothing to add.
Parameters
| Parameter | Type | Default value |
|---|---|---|
staticTabs | SidebarTab[] | undefined |
fallbackIcon | ReactNode | null |
Returns
useMergedToolbarItems()
function useMergedToolbarItems(staticItems): ToolbarItem[];Defined in: components/PanelContributionContext.tsx:174
Convenience wrapper around useActiveContribution() for the common case: append the active panel's contributed toolbar items (behind a separator) to a static list. Returns staticItems unchanged when there's nothing to add. For manual control (a different merge position, no separator, etc.), call useActiveContribution() directly instead.
Parameters
| Parameter | Type |
|---|---|
staticItems | ToolbarItem[] |
Returns
useMessages()
function useMessages(): Record<MessageKey, MessageDescriptor>;Defined in: components/WindowManagerContext.tsx:281
React hook to fetch the localizable predefined message map catalog.
Returns
Record<MessageKey, MessageDescriptor>
useModals()
function useModals(): ModalsApi;Defined in: api/index.tsx:319
Opens and tracks modals.
Returns
usePanel()
function usePanel(): PanelHandle;Defined in: api/index.tsx:163
The panel's own container: its id, where it is, and what it can do. Works in docked panels, floating windows, modals and side drawers.
The functions on the handle are stable; the handle object is not (see PanelHandle). To keep the tab title in step with a document:
const { setTitle, setDirty } = usePanel();
useEffect(() => { setTitle(doc.title); setDirty(doc.dirty); }, [setTitle, setDirty, doc.title, doc.dirty]);Returns
usePanelContextMenu()
function usePanelContextMenu(items): void;Defined in: components/WindowManagerContext.tsx:323
React hook for injecting custom context menu items into a panel's context menu from inside the panel component. Items are dynamic — the array is re-read each time the menu opens, so state-driven changes (enable/disable, add/remove) work automatically. The hook knows which panel it is in — no id needed.
Parameters
| Parameter | Type | Description |
|---|---|---|
items | ContextMenuItem[] | Array of ContextMenuItem entries (simple items, separators, submenus). |
Returns
void
Example
import { usePanelContextMenu } from 'dockable-windows';
function MyPanel() {
const [dirty, setDirty] = useState(false);
usePanelContextMenu([
{ label: 'Save', action: () => save() },
{ label: 'Revert', action: () => revert() },
]);
return <Editor onChange={() => setDirty(true)} />;
}usePanelContribution()
function usePanelContribution(contribution): void;Defined in: components/PanelContributionContext.tsx:104
Publish this panel's toolbar items and/or sidebar sections. Call on every render — republishes automatically whenever contribution changes, and is cleared when the panel unmounts. Memoize the object (and its array/callback contents, e.g. with useMemo/useCallback) to avoid republishing on every unrelated re-render.
Contributions are only ever surfaced while this panel is state.activePanelId — see useActiveContribution().
Parameters
| Parameter | Type |
|---|---|
contribution | PanelContribution |
Returns
void
Throws
Error if used outside of a DockableDesktopProvider.
Example
function MapPanel() {
const [controller, setController] = useState<'pan' | 'draw' | 'measure'>('pan');
usePanelContribution({
toolbarItems: (['pan', 'draw', 'measure'] as const).map(id => ({
type: 'toggle', id, label: id, icon: icons[id],
active: controller === id, onToggle: () => setController(id),
})),
sidebarSections: [{ id: 'layers', label: 'Layers', content: <LayerList /> }],
});
// ...
}usePanelEvents()
function usePanelEvents(events): void;Defined in: api/index.tsx:213
Subscribes to the panel's lifecycle. Call it at the top level of the panel component; it always calls the latest callbacks passed in and cleans up on unmount — no dependency array.
Parameters
| Parameter | Type |
|---|---|
events | PanelEvents |
Returns
void
usePanelSize()
function usePanelSize():
| {
height: number;
width: number;
}
| null;Defined in: components/FormContainerContext.ts:130
Reactive alternative to measuring the panel's container yourself. Returns the panel's current { width, height }, or null before it has been laid out, and re-renders whenever the panel's rendered box changes — including resizes caused by the workspace itself (a grid split being dragged, docking, floating, or tab activation), not just resizes of an element the panel created.
Returns
| { height: number; width: number; } | null
usePanelWindow()
function usePanelWindow(): PanelWindow;Defined in: components/workspace/panelWindow.tsx:44
The window and document the panel is shown in (7.12.0): the pop-out's while the panel is in its own window, the main ones otherwise (and outside a workspace panel, or with popOut off). It changes when the panel pops out and when it returns, so code that listens on the window, uses its requestAnimationFrame, devicePixelRatio or matchMedia, or creates elements, can follow.
Returns
Example
function Chart() {
const { window: win } = usePanelWindow();
useEffect(() => {
const onResize = () => redraw(win.devicePixelRatio);
win.addEventListener('resize', onResize);
return () => win.removeEventListener('resize', onResize);
}, [win]);
}useSaveState()
function useSaveState(getState): void;Defined in: api/index.tsx:247
Reports the panel's restorable state, pulled fresh on every saveLayout() and saved as the panel's props. Pass null to report none. Always calls the latest function passed in.
Parameters
| Parameter | Type |
|---|---|
getState | (() => unknown) | null |
Returns
void
useSidebar()
function useSidebar(): SidebarContext;Defined in: components/Sidebar.tsx:818
Returns sidebar control functions from anywhere inside a <RddSidebar> tree, including floating panels rendered via {children}.
Returns
Throws
Error if used outside of an RddSidebar.
useSidebarTab()
function useSidebarTab(): SidebarTabContext;Defined in: components/Sidebar.tsx:830
Returns tab-specific control functions for components rendered inside a sidebar tab's renderContent tree.
Returns
Throws
Error if used outside of an RddSidebar tab's renderContent tree.
useSidePanels()
function useSidePanels(): SidePanelsApi;Defined in: api/index.tsx:344
Opens and tracks the left and right side drawers.
Returns
useToolbar()
function useToolbar(): ToolbarContextValue;Defined in: components/ToolbarContext.tsx:45
Returns toolbar state and control functions from anywhere inside a <DockableDesktopProvider> tree.
Returns
Throws
Error if used outside of a DockableDesktopProvider.
useWidget()
function useWidget(): WidgetHandle | null;Defined in: components/panelOverlay/widgetContext.ts:57
The managed widget this component is rendered in, or null outside one (7.11.0).
Returns
WidgetHandle | null
Example
function TableWidget() {
const widget = useWidget();
useEffect(() => widget?.onMoved(() => grid.current?.resize()), [widget]);
return <Grid ref={grid} compact={widget?.location === 'panel'} />;
}useWorkspace()
function useWorkspace<TEvents>(): Workspace<TEvents>;Defined in: api/index.tsx:100
The workspace of the nearest <DockableDesktopProvider>. A stable object: it never changes, so a component that only calls actions never re-renders because of it.
Type Parameters
| Type Parameter | Default type |
|---|---|
TEvents extends object | Record<string, unknown> |
Returns
Workspace<TEvents>
useWorkspaceState()
Call Signature
function useWorkspaceState(): WorkspaceState;Defined in: components/WindowManagerContext.tsx:199
The live workspace state. The component re-renders whenever it changes — or, given a selector, only when the selected value changes.
For reads without a subscription, call the workspace's isOpen() or getOpenPanelIds().
The selector must return a value that stays the same while the state does — a primitive, or a part of the state as it is (s => s.panels[id]). A selector that builds a new object or array on each call (s => ({ n: s.floating.length }), s => s.floating.map(...)) is a new value every time React asks, and React stops with "Maximum update depth exceeded". Select the parts separately, or derive the object with useMemo from what you selected.
Returns
The current workspace state, or the selector's result.
Throws
Error if used outside <DockableDesktopProvider>.
Example
function PanelCount() {
const count = useWorkspaceState(s => Object.keys(s.panels).length);
return <span>{count} open</span>;
}Call Signature
function useWorkspaceState<T>(selector): T;Defined in: components/WindowManagerContext.tsx:200
The live workspace state. The component re-renders whenever it changes — or, given a selector, only when the selected value changes.
For reads without a subscription, call the workspace's isOpen() or getOpenPanelIds().
The selector must return a value that stays the same while the state does — a primitive, or a part of the state as it is (s => s.panels[id]). A selector that builds a new object or array on each call (s => ({ n: s.floating.length }), s => s.floating.map(...)) is a new value every time React asks, and React stops with "Maximum update depth exceeded". Select the parts separately, or derive the object with useMemo from what you selected.
Type Parameters
| Type Parameter |
|---|
T |
Parameters
| Parameter | Type |
|---|---|
selector | (state) => T |
Returns
T
The current workspace state, or the selector's result.
Throws
Error if used outside <DockableDesktopProvider>.
Example
function PanelCount() {
const count = useWorkspaceState(s => Object.keys(s.panels).length);
return <span>{count} open</span>;
}Interfaces
AlertOptions
Defined in: api/index.tsx:294
Options of ModalsApi.alert. The title defaults to the alertTitle message.
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
alertType? | "info" | "warning" | "success" | "danger" | - | api/index.tsx:297 |
icon? | ReactNode | - | api/index.tsx:298 |
message | | string | { defaultMessage?: string; id: string; values?: any; } | - | api/index.tsx:295 |
okLabel? | | string | { defaultMessage?: string; id: string; values?: any; } | - | api/index.tsx:299 |
size? | "small" | "auto" | "medium" | "large" | "fullscreen" | Defaults to 'small'. | api/index.tsx:301 |
title? | PanelTitle | - | api/index.tsx:296 |
BuiltInEvents
Defined in: WorkspaceClient.ts:20
Built-in lifecycle events always available on the workspace event bus.
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
layout:changed | Record<string, never> | Fires whenever something saveLayout() would capture changes — open/close/minimize/restore, float/dock/re-order/dock-to-edge, closing a group, maximizing a minimized panel, and an openPanel dedupeKey redirect. Coalesces those into one signal for autosave-style consumers, so they don't need to subscribe to separate events. Does not cover a registerStateProvider callback's return value changing on its own — that's a pull, there's no way to observe it changing without the panel separately notifying — nor split-ratio drags, floating-window moves and resizes, or toggling a floating window's maximized state. | WorkspaceClient.ts:63 |
layout:panels-excluded | { panels: { component: string; id: string; }[]; } | Fires from inside saveLayout() itself, only when that specific call excluded at least one panel (a panel whose current props — static or from a registerStateProvider — failed isSerializable). A passive PanelInfo.serializable flag alone isn't enough for this: nobody may be polling it at the exact moment a save happens and something silently drops out (e.g. a floating window rendering data from a live class instance). This is deliberately just a signal, not a UI opinion — decide for yourself whether that becomes a toast, a console warning, or nothing. | WorkspaceClient.ts:73 |
layout:panels-excluded.panels | { component: string; id: string; }[] | - | WorkspaceClient.ts:73 |
panel:closed | { id: string; } | - | WorkspaceClient.ts:22 |
panel:closed.id | string | - | WorkspaceClient.ts:22 |
panel:minimized | { id: string; } | - | WorkspaceClient.ts:23 |
panel:minimized.id | string | - | WorkspaceClient.ts:23 |
panel:opened | { component: string; id: string; } | - | WorkspaceClient.ts:21 |
panel:opened.component | string | - | WorkspaceClient.ts:21 |
panel:opened.id | string | - | WorkspaceClient.ts:21 |
panel:popped-out | { id: string; window: Window; } | A panel moved into its own browser window (popOutPanel, 7.12.0), sent once it is laid out there (in the window's frame, and a frame later), so a resize() sees the window's size: window is it, the one usePanelWindow() now gives the panel. Sent for a managed widget's own panel too (useFloatingWidgets().popOut), with that panel's id. | WorkspaceClient.ts:31 |
panel:popped-out.id | string | - | WorkspaceClient.ts:31 |
panel:popped-out.window | Window | - | WorkspaceClient.ts:31 |
panel:popping-out | { id: string; } | A panel is about to move into its own window (7.12.0): sent in the user's click, while its element is still in the page at its size. panel:popped-out follows, or panel:returned when the window fails before the panel got there. Not sent for a refused pop-out, nor for docking or floating. | WorkspaceClient.ts:47 |
panel:popping-out.id | string | - | WorkspaceClient.ts:47 |
panel:restored | { id: string; } | - | WorkspaceClient.ts:24 |
panel:restored.id | string | - | WorkspaceClient.ts:24 |
panel:returned | { id: string; } | A panel that was in its own window is back in the page (7.12.0), whatever brought it back: the app, the frame's button, the window closing, the provider unmounting. Not sent for a panel closed while out (panel:closed is). Sent once it is laid out in its place (a frame later); a panel back as a tab that isn't selected is 0 x 0 then. Also sent, without panel:popped-out, when the window fails before the panel got there. Sent for a managed widget's own panel too, as it goes back into its owner panel. | WorkspaceClient.ts:40 |
panel:returned.id | string | - | WorkspaceClient.ts:40 |
panel:returning | { id: string; } | A panel in its own window is about to come back (7.12.0): sent just before its element leaves that window, whatever brings it back, while it is still there at its size. panel:returned follows. Not sent for a panel closed while out. | WorkspaceClient.ts:53 |
panel:returning.id | string | - | WorkspaceClient.ts:53 |
CloseOptions
Defined in: components/FormContainerContext.ts:8
Options used when requesting to close a container.
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
force? | boolean | If true, bypasses any dirty state warnings or custom close guards. | components/FormContainerContext.ts:10 |
ConfirmOptions
Defined in: api/index.tsx:281
Options of ModalsApi.confirm. The title defaults to the modalTitle message.
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
alert? | string | - | api/index.tsx:284 |
alertType? | "info" | "warning" | "success" | "danger" | - | api/index.tsx:285 |
icon? | ReactNode | - | api/index.tsx:286 |
message | | string | { defaultMessage?: string; id: string; values?: any; } | - | api/index.tsx:282 |
size? | "small" | "auto" | "medium" | "large" | "fullscreen" | Defaults to 'small'. | api/index.tsx:290 |
title? | PanelTitle | - | api/index.tsx:283 |
yesNo? | boolean | Labels the buttons Yes and No instead of OK and Cancel. | api/index.tsx:288 |
ContextMenuAdapter
Defined in: components/ContextMenu.tsx:117
Properties
| Property | Type | Defined in |
|---|---|---|
Component | ForwardRefExoticComponent<ContextMenuProps & RefAttributes<ContextMenuHandle>> | components/ContextMenu.tsx:118 |
ContextMenuCheckbox
Defined in: components/ContextMenu.tsx:25
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
active? | boolean | Whether the checkbox column renders at all (default: true). | components/ContextMenu.tsx:27 |
enabled? | boolean | Whether the item is interactive (default: true). Prefer top-level disabled on the item instead. | components/ContextMenu.tsx:29 |
value | boolean | Current checked state. | components/ContextMenu.tsx:31 |
ContextMenuHandle
Defined in: components/ContextMenu.tsx:98
Methods
show()
show(options): void;Defined in: components/ContextMenu.tsx:99
Parameters
| Parameter | Type |
|---|---|
options | ShowContextMenuOptions |
Returns
void
ContextMenuSeparator
Defined in: components/ContextMenu.tsx:44
Properties
| Property | Type | Defined in |
|---|---|---|
separator | true | components/ContextMenu.tsx:45 |
ContextMenuSimpleItem
Defined in: components/ContextMenu.tsx:34
Properties
| Property | Type | Defined in |
|---|---|---|
action? | MenuItemAction | components/ContextMenu.tsx:39 |
checkbox? | ContextMenuCheckbox | components/ContextMenu.tsx:38 |
cyAction? | string | components/ContextMenu.tsx:40 |
disabled? | boolean | components/ContextMenu.tsx:41 |
icon? | ReactNode | components/ContextMenu.tsx:36 |
label | ContextMenuLabel | components/ContextMenu.tsx:35 |
title? | ContextMenuLabel | components/ContextMenu.tsx:37 |
ContextMenuSubMenu
Defined in: components/ContextMenu.tsx:48
Properties
| Property | Type | Defined in |
|---|---|---|
items? | ContextMenuItem[] | components/ContextMenu.tsx:51 |
label | ContextMenuLabel | components/ContextMenu.tsx:49 |
title? | ContextMenuLabel | components/ContextMenu.tsx:50 |
DirtyStateOptions
Defined in: components/dirtyOptions.ts:11
Represents custom configuration options applied to the automatic unsaved changes modal.
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
alert? | string | Optional custom alert notification banner text. Typically lists missing validation field requirements or backup statuses. | components/dirtyOptions.ts:28 |
alertType? | "info" | "warning" | "success" | "danger" | Color scheme severity level of the validation banner. Maps to theme highlight alerts. Default: 'info' | components/dirtyOptions.ts:34 |
message? | string | MessageDescriptor | Custom warning explanation text or localizable message descriptor. Replaces the standard default message body templates. | components/dirtyOptions.ts:22 |
title? | string | MessageDescriptor | (() => string) | Custom header title text or localizable message descriptor. Replaces the default "Unsaved Changes" title. | components/dirtyOptions.ts:16 |
DockableDesktopProviderProps
Defined in: components/DockableDesktopProvider.tsx:15
Props for <DockableDesktopProvider>.
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
children | ReactNode | - | components/DockableDesktopProvider.tsx:16 |
contextMenuAdapter? | ContextMenuAdapter | Context menu implementation. Defaults to the built-in menu. | components/DockableDesktopProvider.tsx:46 |
dir? | "rtl" | "ltr" | Initial layout direction, when the workspace doesn't set one. | components/DockableDesktopProvider.tsx:27 |
formatMessage? | MessageFormatter | Translates every built-in label. Overridden by the workspace's own formatMessage. | components/DockableDesktopProvider.tsx:23 |
messages? | Record<string, MessageDescriptor> | Overrides any subset of the built-in message table. Overridden by the workspace's own messages. | components/DockableDesktopProvider.tsx:25 |
modalBodyClass? | string | CSS class for the content area of every modal. | components/DockableDesktopProvider.tsx:31 |
modalClass? | string | CSS class for the outer wrapper of every modal. | components/DockableDesktopProvider.tsx:29 |
popoutUrl? | string | The page a pop-out window opens (7.12.0): a same-origin page of the app, such as /popout.html, with an empty <body>. The library waits for it to load, then moves the panel in. Without it, the window opens blank. A page that can't be read (another origin, or a redirect off this one) or doesn't load within 10 s sends the panel back. Only used with createWorkspace({ popOut: true }). Set it when a third-party embed refuses a blank window: a YouTube player, for one, shows error 153 there. | components/DockableDesktopProvider.tsx:55 |
popoutWrapper? | ComponentType<PopoutWrapperProps> | A component around every panel's content, given the window and document the panel is in (7.12.0): the main ones, then the pop-out's while it is in its own window. For CSS-in-JS: a cache per document, so the panel's styles are inserted where it is shown (a pop-out doesn't get rules inserted with insertRule from the page). Rendered for every panel, for its whole life, while the workspace has popOut: true (none otherwise), so nothing remounts when a panel moves. Pass a stable component (defined outside a render), not an inline function. In a pop-out it is also rendered around the window's frame (the icon and title you give the panel), a context menu and the toasts shown there, with that window: keep one cache per document, not per wrapper. Example import createCache from '@emotion/cache'; import { CacheProvider } from '@emotion/react'; const caches = new WeakMap<Document, ReturnType<typeof createCache>>(); const cacheFor = (doc: Document) => { let c = caches.get(doc); if (!c) { c = createCache({ key: 'pop', container: doc.head }); caches.set(doc, c); } return c; }; const PopoutWrapper = ({ document, children }: PopoutWrapperProps) => <CacheProvider value={cacheFor(document)}>{children}</CacheProvider>; <DockableDesktopProvider workspace={workspace} popoutWrapper={PopoutWrapper}>…</DockableDesktopProvider> | components/DockableDesktopProvider.tsx:83 |
sidePanelBodyClass? | string | CSS class for the content area of the side drawers. | components/DockableDesktopProvider.tsx:35 |
sidePanelClass? | string | CSS class for the outer wrapper of the side drawers. | components/DockableDesktopProvider.tsx:33 |
windowBodyClass? | string | CSS class for the content area of floating windows. | components/DockableDesktopProvider.tsx:39 |
windowClass? | string | CSS class for the outer wrapper of floating windows. | components/DockableDesktopProvider.tsx:37 |
workspace? | Workspace<object> | The workspace to render, from createWorkspace(). Omit it and the provider creates an empty one of its own (register panels through useWorkspace().registry). | components/DockableDesktopProvider.tsx:21 |
zIndexBase? | number | Starting z-index for floating windows and all of the library's chrome overlays, which shift together via --rdd-z-base. Default 1000 | components/DockableDesktopProvider.tsx:44 |
DropTarget
Defined in: types.ts:39
The target leaf and position for a drag-and-drop dock operation.
Properties
| Property | Type | Defined in |
|---|---|---|
leafId | string | types.ts:40 |
position | DropPosition | types.ts:41 |
FloatingWidgetsApi
Defined in: components/panelOverlay/useFloatingWidgets.tsx:44
What useFloatingWidgets() returns.
Methods
close()
close(id): void;Defined in: components/panelOverlay/useFloatingWidgets.tsx:48
Close a named window by ID. No-op if the window is not open.
Parameters
| Parameter | Type |
|---|---|
id | string |
Returns
void
closeAll()
closeAll(): void;Defined in: components/panelOverlay/useFloatingWidgets.tsx:50
Close all managed windows.
Returns
void
isOpen()
isOpen(id): boolean;Defined in: components/panelOverlay/useFloatingWidgets.tsx:52
Returns true if the named window is currently open.
Parameters
| Parameter | Type |
|---|---|
id | string |
Returns
boolean
location()
location(id): WidgetLocation | null;Defined in: components/panelOverlay/useFloatingWidgets.tsx:71
Where a widget is shown (7.11.0), or null if it isn't open. Read when called; it doesn't re-render anything by itself.
Parameters
| Parameter | Type |
|---|---|
id | string |
Returns
WidgetLocation | null
move()
move(id, to): MoveResult;Defined in: components/panelOverlay/useFloatingWidgets.tsx:66
Moves a widget out of its panel or back (7.11.0), without remounting its content: docked beside its owner panel, a tab in the owner's group, a floating window, or back into the panel where it last was. Out of the panel it is a workspace panel of its own, which the user can move, minimise and close like any other; closing it closes the widget. It never goes into a saved layout. Returns a result rather than throwing; a refusal changes nothing.
Parameters
| Parameter | Type |
|---|---|
id | string |
to | WidgetTarget |
Returns
Example
const widgets = useFloatingWidgets();
widgets.move('table', { to: 'docked', position: 'bottom', size: 0.35 });
widgets.move('table', { to: 'panel' });open()
open(id, config): void;Defined in: components/panelOverlay/useFloatingWidgets.tsx:46
Spawn or reconfigure a named window. Safe to call with an already-open ID to update config.
Parameters
| Parameter | Type |
|---|---|
id | string |
config | ManagedWidget |
Returns
void
placement()
placement(id): WidgetPlacement | null;Defined in: components/panelOverlay/useFloatingWidgets.tsx:80
Where a widget is, as plain JSON to save with the rest of your panel's state (7.11.0): in the panel (corner, stretch, free position, size) or out of it (docked, tabbed or floating, and where it goes back to). Give it back to open(id, { placement }) after a reload. null if it isn't open.
Parameters
| Parameter | Type |
|---|---|
id | string |
Returns
WidgetPlacement | null
Example
const saved = widgets.placement('table'); // store it
widgets.open('table', { ...config, placement: saved ?? undefined }); // later: it opens where it waspopOut()
popOut(id): PopOutResult;Defined in: components/panelOverlay/useFloatingWidgets.tsx:96
Moves a widget into its own browser window (7.12.0), for a second monitor, without remounting its content. Synchronous: call it inside the user's click, in the page or in a pop-out window (its owner's, say: 7.12.1). From inside its panel it leaves the panel and goes into the window as one move; from docked, tabbed, floating or minimised, its panel moves. The same result and reasons as workspace.popOutPanel ('not-allowed' without ManagedWidget.canPopOut, or when its owner panel can't hold it out); a refusal changes nothing. While out, location() is 'floating' and useWidget().isPoppedOut is true.
Back: move() to any place returns it first, as one move; closing the window, or its "Back into the panel" button, puts it back into its panel where it was (D17). onWillMove / onMoved run around each, and the panel:popped-out / panel:returned events are sent for its panel.
Parameters
| Parameter | Type |
|---|---|
id | string |
Returns
Example
<button onClick={() => widgets.popOut('table')}>Open in new window</button>Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
openIds | string[] | IDs of all currently open managed windows, wherever they are shown. Changes to this array trigger re-renders. | components/panelOverlay/useFloatingWidgets.tsx:54 |
FloatingWindow
Defined in: types.ts:134
Bounds and depth metadata for floated panel windows.
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
anchor? | FloatAnchor | null | Corner of the workspace this window is pinned to, or null when free-floating. | types.ts:150 |
height | string | number | CSS height value. | types.ts:144 |
id | string | Unique ID of the floating window. | types.ts:136 |
maximized? | boolean | True if the window is currently maximized to full workspace bounds. | types.ts:148 |
width | string | number | CSS width value. | types.ts:142 |
x | string | number | CSS left position offset (supports number/px or percentage strings). | types.ts:138 |
y | string | number | CSS top position offset. | types.ts:140 |
z | number | Rendering depth stack index layer. | types.ts:146 |
HostClasses
Defined in: types.ts:675
Represents custom CSS classes injected into layout parts.
Properties
| Property | Type | Defined in |
|---|---|---|
modalBodyClass? | string | types.ts:677 |
modalClass? | string | types.ts:676 |
sidePanelBodyClass? | string | types.ts:679 |
sidePanelClass? | string | types.ts:678 |
windowBodyClass? | string | types.ts:681 |
windowClass? | string | types.ts:680 |
LayoutGridNode
Defined in: types.ts:89
Grid layout branch node containing nested splits and relative flex sizes.
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
children | LayoutNode[] | Children branches or leaf panels. | types.ts:94 |
orientation | SplitOrientation | Split orientation: horizontal places the children side by side, vertical stacks them. | types.ts:92 |
sizes | number[] | Relative percentage sizes of each child layout block. | types.ts:96 |
type | "branch" | - | types.ts:90 |
LayoutLeafNode
Defined in: types.ts:102
Grid layout leaf node containing active tab groups and panel arrays.
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
activePanelId | string | null | The currently active panel tab ID. | types.ts:109 |
canClose? | boolean | If false, close menu buttons are disabled for this group's tabs. | types.ts:111 |
id | string | Unique leaf identifier. | types.ts:105 |
keepOnEmpty? | boolean | When true, the group persists in the layout even after its last panel is closed. | types.ts:113 |
panels | string[] | Array of panel IDs mounted inside this group. | types.ts:107 |
type | "leaf" | - | types.ts:103 |
ManagedWidget
Defined in: components/panelOverlay/types.ts:47
Configuration for a widget spawned imperatively via useFloatingWidgets().open().
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
anchor? | FloatAnchor | Corner of the panel to dock to on first render. Default 'top-right' | components/panelOverlay/types.ts:61 |
canDock? | boolean | The user may move it out of the panel into a docked panel or a tab (7.11.0): drags of its workspace panel, and what the app offers in ManagedWidget.titleMenu. Restricts the user only; move() always works. Changeable while open: call open() again. Default false | components/panelOverlay/types.ts:77 |
canFloat? | boolean | The user may move it out of the panel into a floating window (7.11.0). As ManagedWidget.canDock: the user only, changeable with another open(). Default false | components/panelOverlay/types.ts:82 |
canPopOut? | boolean | It may move into its own browser window (7.12.0): useFloatingWidgets().popOut(id), or an item the app offers in its ManagedWidget.titleMenu (w.popOut()). Needs a workspace created with popOut: true. Changeable while open: call open() again; a window already open stays open. Default false | components/panelOverlay/types.ts:120 |
content | ReactNode | Window body content. | components/panelOverlay/types.ts:59 |
height? | number | Initial height in pixels. | components/panelOverlay/types.ts:65 |
icon? | ReactNode | Optional icon shown to the left of the title in the header. | components/panelOverlay/types.ts:57 |
placement? | WidgetPlacement | Open at a placement saved earlier with useFloatingWidgets().placement(id) (7.11.0): where it was in the panel, and whether it was docked, tabbed or floating out of it. Used only on the first open of an id, like anchor; a re-open of a live id leaves it where it is. A value this version can't read (another v, or broken fields) falls back to the config's own anchor / width / height / stretch. A valid one is clamped into the panel as it is now; in a panel that has no size yet (a background tab) a free position waits until it has one. If moving out of the panel is refused (the owner isn't docked), the widget stays in the panel. | components/panelOverlay/types.ts:106 |
preserveEmbeds? | boolean | Keep embedded documents and media alive when the widget moves (7.11.0): an <iframe> in it doesn't reload when it moves out of its panel, back, or between docked, tabbed and floating. Uses moveBefore() where the browser has it (Chrome and Edge 133+, Firefox 144+); in the others an iframe reloads as before. As preserveEmbeds on a panel type's defaultOptions. Default false | components/panelOverlay/types.ts:113 |
stretch? | Stretch | Which axes span the panel instead of carrying a fixed size. width/height above still apply to any axis that isn't spanning, and are what a spanning axis returns to when released. See Stretch | components/panelOverlay/types.ts:71 |
title | PanelTitle | Text shown in the window's header bar. Accepts a plain string or an i18n message descriptor. A descriptor is re-resolved on every render, so the header follows a language change without the window being closed and reopened — which a plain string cannot do here, because this config is stored by the overlay rather than re-read from your own render. | components/panelOverlay/types.ts:55 |
titleMenu? | (w) => ContextMenuItem[] | The menu on the widget's title icon (7.11.0), in the app's own words: a "Dock below the map" or "Back into the map" item calls w.move(). With it, the title icon becomes a button that opens these items. Out of the panel, its tab's icon and its floating title-bar icon open them too: they lead the tab's menu (before the built-in Minimize and Close) and the floating window's ⋮ menu (before Close). The built-in Float is left out, because these replace it. Called each time the menu opens, so items can depend on where the widget is. Example titleMenu: w => w.location === 'panel' ? [{ label: 'Dock below the map', action: () => w.move({ to: 'docked', position: 'bottom' }) }] : [{ label: 'Back into the map', action: () => w.move({ to: 'panel' }) }] | components/panelOverlay/types.ts:95 |
width? | number | Initial width in pixels. | components/panelOverlay/types.ts:63 |
MessageDescriptor
Defined in: types.ts:17
Structure representing localizable message descriptors used in context menus.
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
defaultMessage? | string | Fallback label text if translation key is missing. | types.ts:21 |
id | string | Translation dictionary key. | types.ts:19 |
values? | Record<string, string | number> | Values injected into the translated text placeholder. | types.ts:23 |
ModalOptions
Defined in: components/PanelProviderContext.tsx:49
Configuration options applied when opening a Modal.
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
bodyPadding? | string | number | CSS padding for the modal body content — a number (px) or any CSS value/shorthand (e.g. '10px 16px'). Default: 0 (edge-to-edge) — pass 10 to restore the pre-v6.0.0 default, or any value your content needs. | components/PanelProviderContext.tsx:63 |
closable? | boolean | If false, hides the modal backdrop exit click and header close button. | components/PanelProviderContext.tsx:57 |
icon? | ReactNode | Icon displayed in the modal title bar. | components/PanelProviderContext.tsx:53 |
size? | "small" | "auto" | "medium" | "large" | "fullscreen" | Size modifier affecting CSS max-width rules. | components/PanelProviderContext.tsx:55 |
title? | PanelTitle | Display title for the modal header. | components/PanelProviderContext.tsx:51 |
ModalsApi
Defined in: api/index.tsx:260
Returned by useModals.
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
alert | (options) => Promise<void> | Opens an RddAlert and resolves once it is acknowledged or dismissed. | api/index.tsx:277 |
close | (id) => void | - | api/index.tsx:266 |
closeAll | () => void | - | api/index.tsx:267 |
confirm | (options) => Promise<boolean> | Opens an RddConfirm and resolves true when it is confirmed, false when it is cancelled or dismissed (Escape, the backdrop, the ×, or a close by code). | api/index.tsx:275 |
get | (id) => OverlayInstance | undefined | - | api/index.tsx:268 |
open | <P>(component, props, options?) => string | - | api/index.tsx:265 |
setDirty | (id, dirty, options?) => void | - | api/index.tsx:270 |
stack | OverlayInstance[] | Open modals, bottom to top. | api/index.tsx:262 |
topmost | OverlayInstance | null | The top modal, or null. | api/index.tsx:264 |
update | (id, updates) => void | - | api/index.tsx:269 |
OpenPanelOptions
Defined in: types.ts:243
Options accepted by WorkspaceActions.openPanel.
Type Parameters
| Type Parameter | Default type |
|---|---|
P extends object | Record<string, unknown> |
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
anchor? | FloatAnchor | null | Pin the new floating window to a workspace corner on creation. Has no effect when initialTarget is 'docked' or 'tabbed'. | types.ts:250 |
dedupeKey? | string | If set, and another currently-open panel of the same component already has this exact dedupeKey, that existing panel is focused instead of opening a new one — the id/props passed to this call are ignored in that case, the same way re-opening an already-open exact id already focuses it instead of duplicating it. Use this when multiple call sites might not agree on the same literal id for what is semantically the same entity (e.g. "the panel for the document at this path"). See also WorkspaceActions.findPanelId. | types.ts:269 |
dockTo? | { panel: string; position: DropPosition; size?: number; } | Dock the new panel beside an open, docked panel: in that panel's group (position: 'center', as a tab) or in a new group split off on one side of it. size is the new group's share of that split, from 0.1 to 0.9 (the workspace's default split ratio when omitted). Wins over initialTarget. If panel is not docked (not open, floating or minimized), the new panel is placed as usual and a development warning says why. Applies only to a newly opened panel. (7.8.0) Example ws.openPanel('legend', 'legend', { dockTo: { panel: 'chart-1', position: 'right', size: 0.25 } }); | types.ts:282 |
dockTo.panel | string | - | types.ts:282 |
dockTo.position | DropPosition | - | types.ts:282 |
dockTo.size? | number | - | types.ts:282 |
focus? | boolean | Set state.activePanelId to this panel. Default true | types.ts:252 |
initialTarget? | "docked" | "floating" | "tabbed" | Initial placement: 'floating', 'docked' (default when a grid exists), or 'tabbed'. | types.ts:247 |
props? | P | Custom per-instance data spread onto the panel component alongside panelId, matching openModal/openLeftPanel/openRightPanel's already-unconstrained props argument — no type restriction here either. Whether a specific value round-trips through saveLayout() is a runtime fact, not a type-level guarantee: see PanelInfo.serializable and the 'layout:panels-excluded' event. | types.ts:260 |
title? | string | MessageDescriptor | (() => string) | Override the panel tab/window title. Accepts a plain string or an i18n message descriptor. | types.ts:245 |
OverlayInstance
Defined in: components/PanelProviderContext.tsx:69
Represents a rendered instance of a panel or modal in the layout.
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
Component | ComponentType<any> | React Component to mount inside the panel. | components/PanelProviderContext.tsx:74 |
containerType | "modal" | "left-panel" | "right-panel" | The target rendering layout zone. | components/PanelProviderContext.tsx:79 |
dirty? | boolean | True if the form container has unsaved user edits. | components/PanelProviderContext.tsx:83 |
dirtyOptions? | DirtyStateOptions | Custom warning options applied to the automatic unsaved changes modal. | components/PanelProviderContext.tsx:85 |
id | string | Unique ID generated for this instance. | components/PanelProviderContext.tsx:71 |
options | SidePanelOptions | ModalOptions | Configuration metadata settings. | components/PanelProviderContext.tsx:81 |
props | Record<string, any> | Property props passed to the Component. | components/PanelProviderContext.tsx:77 |
OverlayState
Defined in: components/PanelProviderContext.tsx:89
Stores the active layout structures for floating overlays.
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
leftPanel | OverlayInstance | null | The currently open left drawer panel instance, or null. | components/PanelProviderContext.tsx:91 |
modals | OverlayInstance[] | Stack containing all active floating modal instances. | components/PanelProviderContext.tsx:95 |
rightPanel | OverlayInstance | null | The currently open right drawer panel instance, or null. | components/PanelProviderContext.tsx:93 |
PanelContribution
Defined in: components/PanelContributionContext.tsx:29
What a panel publishes via usePanelContribution(). Both fields are optional and independent — a panel may contribute only toolbar items, only sidebar sections, both, or neither. The app decides what "toolbar items" and "sidebar sections" mean for its own domain (map controls, document formatting, anything else).
Properties
| Property | Type | Defined in |
|---|---|---|
sidebarSections? | PanelSidebarSection[] | components/PanelContributionContext.tsx:31 |
toolbarItems? | ToolbarItem[] | components/PanelContributionContext.tsx:30 |
PanelDefinition
Defined in: WorkspaceClient.ts:77
Per-panel definition supplied to createWorkspace({ panels }).
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
component | ComponentType<any> | - | WorkspaceClient.ts:79 |
defaultOptions? | { canClose?: boolean; canDock?: boolean; canDrag?: boolean; canFloat?: boolean; canMinimize?: boolean; canPopOut?: boolean; className?: string; defaultAnchor?: FloatAnchor; disableLivePreview?: boolean; favoritePosition?: { height: string | number; width: string | number; x: string | number; y: string | number; }; icon?: ReactNode; initialTarget?: "docked" | "floating" | "tabbed"; keepAlive?: boolean; preserveEmbeds?: boolean; renderHeaderActions?: (panelId) => ReactNode; tabClassName?: string; title?: | string | { defaultMessage?: string; id: string; values?: Record<string, string | number>; } | (() => string); } | - | WorkspaceClient.ts:80 |
defaultOptions.canClose? | boolean | Enables/disables closing actions for the tab/window. | components/PanelRegistry.ts:39 |
defaultOptions.canDock? | boolean | false: the user can't dock this panel. Dragging it offers no group, tab or edge targets (corners still anchor a floating window), so it stays floating. The app's own docking calls always work; give the type initialTarget: 'floating' so it opens floating. Default true (7.9.0) | components/PanelRegistry.ts:35 |
defaultOptions.canDrag? | boolean | Enables/disables window drag interactions. | components/PanelRegistry.ts:22 |
defaultOptions.canFloat? | boolean | false: the user can't make this panel floating. A tab drag can't end in a floating window (dropped on nothing or on a corner, it stays where it was), and the "Float" and taskbar "Maximize" menu items are hidden. A window the app floated itself can still be moved. The app's own floatPanel always works. Default true (7.9.0) | components/PanelRegistry.ts:29 |
defaultOptions.canMinimize? | boolean | Enables/disables minimizing of the panel instance. | components/PanelRegistry.ts:37 |
defaultOptions.canPopOut? | boolean | true: a panel of this type can move into its own browser window (7.12.0), from its "Open in new window" menu item or workspace.popOutPanel(id). Needs a workspace created with popOut: true. It gates the menu item and new calls only: a window already open stays open when this changes. Default false | components/PanelRegistry.ts:77 |
defaultOptions.className? | string | Class added to each panel of this type, on its own content element (.rdd-panel-content), which moves with the panel between groups, windows and the taskbar preview. (7.8.0) | components/PanelRegistry.ts:50 |
defaultOptions.defaultAnchor? | FloatAnchor | Corner of the workspace to anchor newly-opened floating windows to. | components/PanelRegistry.ts:41 |
defaultOptions.disableLivePreview? | boolean | Disables live WebGL rendering canvas thumbnails inside the taskbar hover popup previews. | components/PanelRegistry.ts:43 |
defaultOptions.favoritePosition? | { height: string | number; width: string | number; x: string | number; y: string | number; } | Custom default bounds applied when the container is floated. | components/PanelRegistry.ts:20 |
defaultOptions.favoritePosition.height | string | number | - | components/PanelRegistry.ts:20 |
defaultOptions.favoritePosition.width | string | number | - | components/PanelRegistry.ts:20 |
defaultOptions.favoritePosition.x | string | number | - | components/PanelRegistry.ts:20 |
defaultOptions.favoritePosition.y | string | number | - | components/PanelRegistry.ts:20 |
defaultOptions.icon? | ReactNode | Icon placed next to title tags. | components/PanelRegistry.ts:16 |
defaultOptions.initialTarget? | "docked" | "floating" | "tabbed" | Initial mounting state inside the desktop layout grid. | components/PanelRegistry.ts:18 |
defaultOptions.keepAlive? | boolean | false unmounts the panel's component while it is hidden (an unselected tab, or minimized) and mounts it afresh when it is shown, to free what a heavy, rarely shown panel holds. Its own state is lost each time; its tab, title and lifecycle continue (onClose is not called), and the taskbar shows a placeholder instead of a live preview. While it is unmounted, a guard it registered with useBeforeClose is not active (its dirty flag still is), and saveLayout() saves its open-time props. Default true: panels stay mounted and keep their state, as they always have. (7.8.0) | components/PanelRegistry.ts:62 |
defaultOptions.preserveEmbeds? | boolean | Keep embedded documents and media alive when the panel moves (7.11.0): an <iframe> doesn't reload when the panel is docked, floated, minimised or restored. The library then moves the panel's element with moveBefore(), which keeps that state, in browsers that have it (Chrome and Edge 133+, Firefox 144+); in the others (Safari) it moves as before and an iframe reloads. Off by default. Default false | components/PanelRegistry.ts:70 |
defaultOptions.renderHeaderActions? | (panelId) => ReactNode | Custom header actions renderer, placing custom components in the window/tab titlebar. | components/PanelRegistry.ts:45 |
defaultOptions.tabClassName? | string | Class added to the tab of each panel of this type. (7.8.0) | components/PanelRegistry.ts:52 |
defaultOptions.title? | | string | { defaultMessage?: string; id: string; values?: Record<string, string | number>; } | (() => string) | Tab and window headers text — plain string or i18n descriptor. | components/PanelRegistry.ts:14 |
PanelDrop
Defined in: types.ts:80
The argument canDrop receives: which panel, of which registered kind, is going where. (7.9.0)
Properties
| Property | Type | Defined in |
|---|---|---|
component | string | types.ts:82 |
panelId | string | types.ts:81 |
to | PanelDropTarget | types.ts:83 |
PanelEvents
Defined in: api/index.tsx:199
Lifecycle callbacks for usePanelEvents. Each is called at the moment it describes.
Properties
| Property | Type | Defined in |
|---|---|---|
onActivate? | () => void | api/index.tsx:200 |
onClose? | () => void | api/index.tsx:204 |
onContainerTypeChange? | (type) => void | api/index.tsx:206 |
onDeactivate? | () => void | api/index.tsx:201 |
onMinimize? | () => void | api/index.tsx:202 |
onResize? | (width, height) => void | api/index.tsx:205 |
onRestore? | () => void | api/index.tsx:203 |
PanelFloatPlacement
Defined in: components/panelOverlay/types.ts:37
Where a docked widget sits: which corner it is anchored to, plus which axes (if any) span the panel. Reported as a unit because a single gesture can change both at once — dropping a full-width bottom strip onto the left edge flips the anchor and the stretched axis together, and reporting those separately would expose a state that is never actually valid.
Properties
| Property | Type | Defined in |
|---|---|---|
anchor | FloatAnchor | components/panelOverlay/types.ts:38 |
stretch | Stretch | null | components/panelOverlay/types.ts:39 |
PanelHandle
Defined in: api/index.tsx:119
What a panel component knows about, and can do to, its own container. See usePanel.
Identity. id and the five functions (close, minimize, setDirty, setTitle, setIcon) never change identity for the panel's lifetime. The handle object itself changes when containerType, isActive, isMinimized, isFloating or isPoppedOut does. So don't list the handle in a dependency array: depend on the function you call, or on the values you write.
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
close | (options?) => void | Asks the container to close, honouring close guards and the dirty flag. | api/index.tsx:136 |
containerType | ContainerType | Where it is rendered. Updates live (a docked panel that is floated re-renders as 'floating-window'). | api/index.tsx:123 |
id | string | This panel's instance id. | api/index.tsx:121 |
isActive | boolean | A workspace panel that is the globally active one. Always false in a modal or drawer. | api/index.tsx:125 |
isFloating | boolean | A workspace panel shown as a floating window. True too while it is in its own browser window. | api/index.tsx:129 |
isMinimized | boolean | A workspace panel that is minimized to the taskbar. | api/index.tsx:127 |
isPoppedOut | boolean | A workspace panel shown in its own browser window (workspace.popOutPanel, 7.12.0). Its window and document are usePanelWindow's. | api/index.tsx:134 |
minimize | () => void | Minimizes a workspace panel. No effect in a modal or drawer. | api/index.tsx:138 |
setDirty | (dirty, options?) => void | Marks the panel as having unsaved changes. | api/index.tsx:140 |
setIcon | (icon) => void | Changes the icon on the panel's tab, floating title bar and taskbar button, or in a modal's or drawer's header. In a workspace panel, null goes back to the registration's defaultOptions.icon. The icon is not saved by saveLayout(). | api/index.tsx:148 |
setTitle | (title) => void | Changes the title shown on the tab, window or modal. | api/index.tsx:142 |
PanelInfo
Defined in: types.ts:156
Stores active runtime properties and status metadata for individual panel instances.
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
component | string | String matching the component registration ID in the workspace's PanelRegistry. | types.ts:162 |
dedupeKey? | string | Optional dedup key. If another open panel of the same component already has this exact key, openPanel focuses that existing panel instead of creating a new one — see WorkspaceActions.openPanel's dedupeKey option and WorkspaceActions.findPanelId. | types.ts:188 |
dirty? | boolean | True if the panel contains unsaved user edits. | types.ts:172 |
dirtyOptions? | DirtyStateOptions | Custom options applied to the automatic unsaved changes modal. | types.ts:174 |
icon? | ReactNode | Icon set at runtime with usePanel().setIcon() or WorkspaceActions.setPanelIcon, shown instead of the registration's defaultOptions.icon. Never saved by saveLayout(); loadLayout() keeps it for a panel that is still open. | types.ts:192 |
id | string | Unique panel identifier. | types.ts:158 |
lastFloatingRect? | { anchor?: FloatAnchor | null; height: number; width: number; x: number; y: number; } | Saved position boundaries used when returning the panel to a floating state. | types.ts:168 |
lastFloatingRect.anchor? | FloatAnchor | null | - | types.ts:168 |
lastFloatingRect.height | number | - | types.ts:168 |
lastFloatingRect.width | number | - | types.ts:168 |
lastFloatingRect.x | number | - | types.ts:168 |
lastFloatingRect.y | number | - | types.ts:168 |
lastLeafId? | string | The leaf group ID this panel was docked in prior to being floated. | types.ts:170 |
owner? | PanelOwner | Set on a panel that shows a managed widget moved out of its owner panel, whose component is the reserved 'rdd:widget'. Runtime only: such a panel is never written by saveLayout(), and the owner panel saves its widgets itself. (7.11.0) | types.ts:198 |
poppedOut? | true | Set while the panel is shown in its own browser window (workspace.popOutPanel). Such a panel is state: 'floating' and keeps its floating window entry, which the workspace does not draw. Runtime only: saveLayout() writes the panel where it would come back to (docked in its place, or floating at its rect), without it, and a loaded layout never has it. (7.12.0) | types.ts:205 |
previousState? | "docked" | "floating" | Last state held before panel was minimized. | types.ts:166 |
props? | Record<string, unknown> | Custom per-instance data passed via openPanel(id, component, { props }). Unconstrained — any value is accepted, but only a value that passes isSerializable is actually included in WorkspaceActions.saveLayout's output. See PanelInfo.serializable. | types.ts:178 |
serializable | boolean | Whether this panel's current props can round-trip through saveLayout()/loadLayout(). Computed automatically — true when no props were passed, or when they were and passed isSerializable. A panel with serializable: false still renders and works normally; it's simply excluded from the next saveLayout() call (and pruned from gridRoot/ floating/minimized in that saved snapshot) rather than corrupting or throwing. | types.ts:184 |
state | "docked" | "floating" | "minimized" | Current workspace placement mode. | types.ts:164 |
title | string | MessageDescriptor | (() => string) | Plain text label or localizable message descriptor. | types.ts:160 |
PanelOwner
Defined in: types.ts:231
Who a hosted panel belongs to: see PanelInfo.owner. (7.11.0)
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
panelId | string | The panel whose overlay opened the widget. | types.ts:233 |
widgetId | string | The widget's id in that overlay (useFloatingWidgets().open(id, …)). | types.ts:235 |
PanelRegistryEntry
Defined in: components/PanelRegistry.ts:7
Represents a registered component configuration template inside the panel catalog registry.
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
Component | ComponentType<any> | The React component type registered. | components/PanelRegistry.ts:10 |
defaultOptions? | { canClose?: boolean; canDock?: boolean; canDrag?: boolean; canFloat?: boolean; canMinimize?: boolean; canPopOut?: boolean; className?: string; defaultAnchor?: FloatAnchor; disableLivePreview?: boolean; favoritePosition?: { height: string | number; width: string | number; x: string | number; y: string | number; }; icon?: ReactNode; initialTarget?: "docked" | "floating" | "tabbed"; keepAlive?: boolean; preserveEmbeds?: boolean; renderHeaderActions?: (panelId) => ReactNode; tabClassName?: string; title?: | string | { defaultMessage?: string; id: string; values?: Record<string, string | number>; } | (() => string); } | Default metadata settings configuration applied on instantiation. | components/PanelRegistry.ts:12 |
defaultOptions.canClose? | boolean | Enables/disables closing actions for the tab/window. | components/PanelRegistry.ts:39 |
defaultOptions.canDock? | boolean | false: the user can't dock this panel. Dragging it offers no group, tab or edge targets (corners still anchor a floating window), so it stays floating. The app's own docking calls always work; give the type initialTarget: 'floating' so it opens floating. Default true (7.9.0) | components/PanelRegistry.ts:35 |
defaultOptions.canDrag? | boolean | Enables/disables window drag interactions. | components/PanelRegistry.ts:22 |
defaultOptions.canFloat? | boolean | false: the user can't make this panel floating. A tab drag can't end in a floating window (dropped on nothing or on a corner, it stays where it was), and the "Float" and taskbar "Maximize" menu items are hidden. A window the app floated itself can still be moved. The app's own floatPanel always works. Default true (7.9.0) | components/PanelRegistry.ts:29 |
defaultOptions.canMinimize? | boolean | Enables/disables minimizing of the panel instance. | components/PanelRegistry.ts:37 |
defaultOptions.canPopOut? | boolean | true: a panel of this type can move into its own browser window (7.12.0), from its "Open in new window" menu item or workspace.popOutPanel(id). Needs a workspace created with popOut: true. It gates the menu item and new calls only: a window already open stays open when this changes. Default false | components/PanelRegistry.ts:77 |
defaultOptions.className? | string | Class added to each panel of this type, on its own content element (.rdd-panel-content), which moves with the panel between groups, windows and the taskbar preview. (7.8.0) | components/PanelRegistry.ts:50 |
defaultOptions.defaultAnchor? | FloatAnchor | Corner of the workspace to anchor newly-opened floating windows to. | components/PanelRegistry.ts:41 |
defaultOptions.disableLivePreview? | boolean | Disables live WebGL rendering canvas thumbnails inside the taskbar hover popup previews. | components/PanelRegistry.ts:43 |
defaultOptions.favoritePosition? | { height: string | number; width: string | number; x: string | number; y: string | number; } | Custom default bounds applied when the container is floated. | components/PanelRegistry.ts:20 |
defaultOptions.favoritePosition.height | string | number | - | components/PanelRegistry.ts:20 |
defaultOptions.favoritePosition.width | string | number | - | components/PanelRegistry.ts:20 |
defaultOptions.favoritePosition.x | string | number | - | components/PanelRegistry.ts:20 |
defaultOptions.favoritePosition.y | string | number | - | components/PanelRegistry.ts:20 |
defaultOptions.icon? | ReactNode | Icon placed next to title tags. | components/PanelRegistry.ts:16 |
defaultOptions.initialTarget? | "docked" | "floating" | "tabbed" | Initial mounting state inside the desktop layout grid. | components/PanelRegistry.ts:18 |
defaultOptions.keepAlive? | boolean | false unmounts the panel's component while it is hidden (an unselected tab, or minimized) and mounts it afresh when it is shown, to free what a heavy, rarely shown panel holds. Its own state is lost each time; its tab, title and lifecycle continue (onClose is not called), and the taskbar shows a placeholder instead of a live preview. While it is unmounted, a guard it registered with useBeforeClose is not active (its dirty flag still is), and saveLayout() saves its open-time props. Default true: panels stay mounted and keep their state, as they always have. (7.8.0) | components/PanelRegistry.ts:62 |
defaultOptions.preserveEmbeds? | boolean | Keep embedded documents and media alive when the panel moves (7.11.0): an <iframe> doesn't reload when the panel is docked, floated, minimised or restored. The library then moves the panel's element with moveBefore(), which keeps that state, in browsers that have it (Chrome and Edge 133+, Firefox 144+); in the others (Safari) it moves as before and an iframe reloads. Off by default. Default false | components/PanelRegistry.ts:70 |
defaultOptions.renderHeaderActions? | (panelId) => ReactNode | Custom header actions renderer, placing custom components in the window/tab titlebar. | components/PanelRegistry.ts:45 |
defaultOptions.tabClassName? | string | Class added to the tab of each panel of this type. (7.8.0) | components/PanelRegistry.ts:52 |
defaultOptions.title? | | string | { defaultMessage?: string; id: string; values?: Record<string, string | number>; } | (() => string) | Tab and window headers text — plain string or i18n descriptor. | components/PanelRegistry.ts:14 |
PanelSidebarSection
Defined in: components/PanelContributionContext.tsx:16
A single named, labeled slot of content a panel contributes to the app's Sidebar while active.
Properties
| Property | Type | Defined in |
|---|---|---|
content | ReactNode | components/PanelContributionContext.tsx:20 |
icon? | ReactNode | components/PanelContributionContext.tsx:19 |
id | string | components/PanelContributionContext.tsx:17 |
label | string | components/PanelContributionContext.tsx:18 |
PanelTitleDescriptor
Defined in: components/PanelProviderContext.tsx:15
Descriptor object for localizable panel titles, supporting context translation systems.
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
defaultMessage? | string | Fallback string if translation key is missing. | components/PanelProviderContext.tsx:19 |
id | string | The translation dictionary key. | components/PanelProviderContext.tsx:17 |
values? | Record<string, string | number> | Parameters to inject into the translated text string. | components/PanelProviderContext.tsx:21 |
PanelWindow
Defined in: components/workspace/panelWindow.tsx:10
The window and document a panel is shown in. See usePanelWindow. (7.12.0)
Extended by
Properties
| Property | Type | Defined in |
|---|---|---|
document | Document | components/workspace/panelWindow.tsx:12 |
window | Window | components/workspace/panelWindow.tsx:11 |
PointerDragConfig
Defined in: components/dragResize.ts:14
Shared pointer-drag-resize primitives.
Extracted from four previously-independent implementations (the workspace grid split resizer, the sidebar drawer resizer, and two floating-window resize-handle implementations) that had quietly drifted apart in exactly the kind of detail (an inline-style property present in one and missing in the other) that once caused a real, user-visible bug. This file is the single place that mechanic now lives, so it can't drift again.
Type Parameters
| Type Parameter |
|---|
TStart |
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
activeClasses? | { classes: string[]; el: HTMLElement; }[] | Classes toggled on the given elements for the duration of the drag. | components/dragResize.ts:33 |
captureStart | () => TStart | Snapshot whatever state the caller needs at drag start (sizes, positions, ...). | components/dragResize.ts:22 |
element | HTMLElement | The element to capture the pointer on — normally the handle the user grabbed. | components/dragResize.ts:16 |
onCancel? | (start) => void | Called instead of onEnd when the drag is cut short: the window loses focus, or the pointer capture is lost (the element was removed mid-drag). Without it, onEnd is called. (7.9.0) | components/dragResize.ts:31 |
onEnd? | (start) => void | Called once when the drag ends (pointerup or pointercancel). | components/dragResize.ts:26 |
onMove | (dx, dy, start) => void | Called on every pointermove with the delta from the drag's start position. | components/dragResize.ts:24 |
pointerId | number | - | components/dragResize.ts:17 |
startClientX | number | The pointerdown event's clientX/clientY, used as the delta origin. | components/dragResize.ts:19 |
startClientY | number | - | components/dragResize.ts:20 |
PopoutWrapperProps
Defined in: components/workspace/panelWindow.tsx:16
The props of <DockableDesktopProvider popoutWrapper>. (7.12.0)
Extends
Properties
| Property | Type | Inherited from | Defined in |
|---|---|---|---|
children | ReactNode | - | components/workspace/panelWindow.tsx:17 |
document | Document | PanelWindow.document | components/workspace/panelWindow.tsx:12 |
window | Window | PanelWindow.window | components/workspace/panelWindow.tsx:11 |
RddAlertProps
Defined in: forms/AlertForm.tsx:10
Props for the RddAlert component.
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
alertType? | "info" | "warning" | "success" | "danger" | Picks the built-in icon and its colour. Defaults to 'info'. | forms/AlertForm.tsx:18 |
icon? | ReactNode | The icon left of the message. Omit it for the built-in icon of alertType, pass null for none, or pass your own node. It is coloured by alertType. | forms/AlertForm.tsx:23 |
message | | string | { defaultMessage?: string; id: string; values?: any; } | Main message text or localizable descriptor to display. | forms/AlertForm.tsx:16 |
okLabel? | | string | { defaultMessage?: string; id: string; values?: any; } | Label of the button. Defaults to the ok predefined message. | forms/AlertForm.tsx:26 |
onSettled? | () => void | Fired exactly once, however the dialog ends: the OK button, Enter, Escape, the backdrop, the × or the modal being closed by code. | forms/AlertForm.tsx:31 |
title? | | string | { defaultMessage?: string; id: string; values?: any; } | (() => string) | Optional custom title text or localizable descriptor for the dialog container. | forms/AlertForm.tsx:13 |
RddConfirmProps
Defined in: forms/ConfirmationForm.tsx:10
Props for the RddConfirm component.
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
alert? | string | Optional auxiliary top alert notification text. | forms/ConfirmationForm.tsx:18 |
alertType? | "info" | "warning" | "success" | "danger" | Type style classification for the alert notice banner. | forms/ConfirmationForm.tsx:20 |
icon? | ReactNode | The icon left of the message. Omit it for the built-in question icon, pass null for none, or pass your own node. It is coloured by alertType. | forms/ConfirmationForm.tsx:36 |
message | | string | { defaultMessage?: string; id: string; values?: any; } | Main message text or localizable descriptor to display. | forms/ConfirmationForm.tsx:16 |
onCancel? | () => void | Callback fired when the user selects the cancel button. | forms/ConfirmationForm.tsx:26 |
onOK? | () => void | Callback fired when the user selects the confirm button. | forms/ConfirmationForm.tsx:24 |
onSettled? | (ok) => void | Fired exactly once, however the dialog ends: true for the confirm button (or Enter), false for the cancel button, Escape, the backdrop, the × or the modal being closed by code. | forms/ConfirmationForm.tsx:31 |
title? | | string | { defaultMessage?: string; id: string; values?: any; } | (() => string) | Optional custom title text or localizable descriptor for the dialog container. | forms/ConfirmationForm.tsx:13 |
useYesNoTitles? | boolean | If true, changes action button labels to 'Yes' and 'No' instead of 'OK' and 'Cancel'. | forms/ConfirmationForm.tsx:22 |
RddDesktopProps
Defined in: components/WindowManager.tsx:52
Props for <RddDesktop>.
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
animations? | boolean | Enables the library's own transitions/animations (tab hover, dock preview, etc.). Never affects the consumer's own page. Default true | components/WindowManager.tsx:66 |
defaultPanelIcon? | ReactNode | Fallback icon shown in panel tabs when no panel-specific icon is provided. | components/WindowManager.tsx:56 |
emptyWorkspace? | ReactNode | What the workspace shows while no panel is docked: a welcome screen, a "pick a file" prompt. It fills the empty group in place of the built-in message; the group stays a drop target, so a floating window can still be docked into it. Floating windows still show over it. (7.8.0) | components/WindowManager.tsx:72 |
renderTabContent? | (tab) => ReactNode | Your own content for each tab in the grid: an icon, the title, a badge, a status dot (7.10.0). It replaces the built-in icon, title and dirty marker; the tab itself (dragging, keyboard, accessibility, its context menu, header actions and close button) stays the library's. Called with the tab's TabContentProps; branch on component for a per-type look. | components/WindowManager.tsx:79 |
skin? | string | Built-in skin name or a custom skin key registered via CSS. Default 'vscode' | components/WindowManager.tsx:54 |
taskbarVisibility? | TaskbarVisibility | Controls taskbar visibility. - 'always' — permanent bar at the bottom - 'compact' — only visible when minimized panels exist, or a panel is in its own window (7.12.0) - 'autohide' — overlay bar with 8 px peek strip (default), shown under the same condition as 'compact' Default 'autohide' | components/WindowManager.tsx:64 |
RddFloatingWidgetProps
Defined in: components/panelOverlay/FloatingWidget.tsx:25
Props for <RddFloatingWidget>.
Methods
onClose()
onClose(): void;Defined in: components/panelOverlay/FloatingWidget.tsx:35
Called when the user clicks the × button. Set open to false in response.
Returns
void
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
children? | ReactNode | - | components/panelOverlay/FloatingWidget.tsx:71 |
defaultAnchor | FloatAnchor | Corner of the panel to dock to on first render. See FloatAnchor | components/panelOverlay/FloatingWidget.tsx:37 |
defaultHeight | number | Initial height in pixels. Ignored on an axis that starts stretched, and restored to when that axis is later released. | components/panelOverlay/FloatingWidget.tsx:43 |
defaultStretch? | Stretch | Which axes span the panel on first render. Uncontrolled: gestures update it from here. See Stretch | components/panelOverlay/FloatingWidget.tsx:48 |
defaultWidth | number | Initial width in pixels. Ignored on an axis that starts stretched, and restored to when that axis is later released. | components/panelOverlay/FloatingWidget.tsx:40 |
icon? | ReactNode | Optional icon shown to the left of the title in the header. | components/panelOverlay/FloatingWidget.tsx:31 |
id | string | Unique identifier within the panel overlay. Used for z-order and stack tracking. | components/panelOverlay/FloatingWidget.tsx:27 |
onPlacementChange? | (placement) => void | Called whenever a gesture changes where the widget sits — a stretched axis released, a re-dock, or a detach. Reports anchor and stretch together, because one gesture can change both at once and reporting them separately would surface a state that is never valid. This is also the only way to persist placement: the library serialises nothing about inner widgets, so store what you receive here and feed it back via defaultAnchor/stretch. | components/panelOverlay/FloatingWidget.tsx:65 |
open | boolean | Whether the window is mounted and visible. Set to false to close/unmount it. | components/panelOverlay/FloatingWidget.tsx:33 |
stretch? | Stretch | null | Controlled stretch state. When provided — including as null — the caller is the single source of truth: gestures report through RddFloatingWidgetProps.onPlacementChange instead of updating internally, and the caller must echo the new value back. Omit entirely (undefined) for uncontrolled behaviour, matching ToolbarToggleItem.active and Sidebar.activeTabId. | components/panelOverlay/FloatingWidget.tsx:56 |
stretchable? | boolean | Whether this widget may span the panel at all. false disables resize-to-stretch snapping, for content that only makes sense at a bounded size. Default true. | components/panelOverlay/FloatingWidget.tsx:70 |
title | PanelTitle | Text shown in the window's header bar. Accepts a plain string or an i18n message descriptor. | components/panelOverlay/FloatingWidget.tsx:29 |
RddPanelOverlayProps
Defined in: components/panelOverlay/PanelOverlayRoot.tsx:56
Props for <RddPanelOverlay>.
Properties
| Property | Type | Defined in |
|---|---|---|
children | ReactNode | components/panelOverlay/PanelOverlayRoot.tsx:57 |
className? | string | components/panelOverlay/PanelOverlayRoot.tsx:58 |
style? | CSSProperties | components/panelOverlay/PanelOverlayRoot.tsx:59 |
RddPanelToolbarProps
Defined in: components/panelOverlay/PanelToolbar.tsx:19
Props for <RddPanelToolbar>.
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
buttonSize? | number | Button size in pixels for all buttons in this toolbar (sets --rdd-panel-toolbar-btn-size). The icon inside follows --rdd-panel-toolbar-icon-size. Falls back to the stylesheet when unset. | components/panelOverlay/PanelToolbar.tsx:27 |
buttonVariant? | ButtonVariant | Default button style inherited by ToolbarButton and ToolbarToggle children. Default 'ghost' | components/panelOverlay/PanelToolbar.tsx:25 |
children? | ReactNode | - | components/panelOverlay/PanelToolbar.tsx:30 |
className? | string | - | components/panelOverlay/PanelToolbar.tsx:29 |
position | ToolbarPosition | Edge of the panel overlay to attach to. See ToolbarPosition | components/panelOverlay/PanelToolbar.tsx:21 |
style? | CSSProperties | - | components/panelOverlay/PanelToolbar.tsx:28 |
variant? | ToolbarVariant | Background style of the toolbar strip. Default 'transparent' | components/panelOverlay/PanelToolbar.tsx:23 |
RddSidebarProps
Defined in: components/Sidebar.tsx:122
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
activeTabId? | string | null | Controlled active tab id. Omit to use internal state. | components/Sidebar.tsx:152 |
children? | ReactNode | Main workspace content rendered alongside the sidebar. | components/Sidebar.tsx:206 |
defaultWidth? | number | Initial drawer width in pixels. Default: 280 | components/Sidebar.tsx:144 |
footerAction? | | SidebarRailEntry | SidebarRailEntry[] | Mirror of headerAction, pinned to the bottom of the tab strip via its own .rdd-sidebar-footer-area — e.g. a "Settings" tab that should always sit at the bottom regardless of tab count. Override --rdd-sidebar-footer-area-padding-top/ --rdd-sidebar-footer-area-padding-bottom (both default 8px) to control its spacing. | components/Sidebar.tsx:142 |
headerAction? | | SidebarRailEntry | SidebarRailEntry[] | One or more non-toggling action buttons and/or real tabs shown above the tabs, in their own .rdd-sidebar-header-area — independent of the tabs' own inter-item gap. Pass a single { icon, label, onClick }/{ render } object (the common case), or an array mixing action buttons, custom renders, and SidebarTab entries — a tab entry here behaves exactly like a main-list tab (mounts, activates, closes through the same lifecycle). Override --rdd-sidebar-header-area-padding-top/--rdd-sidebar-header-area-padding-bottom (both default 8px) to control its spacing/effective height. | components/Sidebar.tsx:135 |
hideDefaultHeader? | boolean | Suppress the library's own drawer header (title + showCloseButton's close button) for every tab, so renderHeader (or each tab's own renderContent) can supply a header, border, and styling instead. Applies uniformly across all tabs — there's no per-tab override. Passing renderHeader by itself has the same suppressing effect even if this is left unset — the two conditions are combined with OR, precisely so that supplying renderHeader alone is never a silent no-op. The close mechanism is unaffected either way: the onClose parameter passed to renderContent/renderHeader, or useSidebarTab().onClose from anywhere in a tab's content tree. Default: false | components/Sidebar.tsx:183 |
maxWidth? | number | Maximum drawer width in pixels during drag-resize. Default: 600 | components/Sidebar.tsx:148 |
minWidth? | number | Minimum drawer width in pixels during drag-resize. Default: 150 | components/Sidebar.tsx:146 |
onActiveTabChange? | (tabId) => void | Called when the active tab changes. | components/Sidebar.tsx:154 |
onStripVisibilityChange? | (visible) => void | Called when showStrip/hideStrip is invoked on the imperative handle. | components/Sidebar.tsx:162 |
onVisibilityChange? | (visible) => void | Called when show/hide/toggle is invoked on the imperative handle. | components/Sidebar.tsx:158 |
onWidthChange? | (px) => void | Called during drag resize and on setWidth() with the new pixel width. | components/Sidebar.tsx:150 |
position? | "left" | "right" | Which side the activity bar and drawer appear on. Default: 'right' | components/Sidebar.tsx:124 |
renderHeader? | (tab, onClose, onOpen) => ReactNode | Custom header renderer used in place of the library's own drawer header. Passing renderHeader is by itself sufficient to suppress the default header, whether or not hideDefaultHeader is also set — the two props are combined with OR. Called once for whichever tab is currently active, so the same header markup (e.g. a hamburger icon, a search field, a close button) is shared uniformly across every tab instead of being repeated inside each tab's own renderContent. Omit renderHeader and set hideDefaultHeader: true to render no header at all and let each tab's renderContent supply its own instead. | components/Sidebar.tsx:198 |
showCloseButton? | boolean | Show an "X" close button in the expanded drawer's header, as an additional way to collapse the sidebar (equivalent to clicking the active tab's own icon again). Opt-in. Default: false. Has no effect once the default header is suppressed — via hideDefaultHeader, or simply by passing renderHeader (either one is sufficient) — since the entire default header, this button included, is skipped for every tab in that case. | components/Sidebar.tsx:170 |
stripVisible? | boolean | Collapse only the activity bar strip, leaving the drawer unaffected. Default: true | components/Sidebar.tsx:160 |
tabs | SidebarTab[] | - | components/Sidebar.tsx:125 |
visible? | boolean | Collapse the entire sidebar (strip + drawer). Default: true | components/Sidebar.tsx:156 |
RddSidePanelsProps
Defined in: api/index.tsx:366
Props for RddSidePanels.
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
defaultWidth? | string | number | Width used when an openLeft/openRight call doesn't give one. Number = px. Default 400 | api/index.tsx:370 |
side? | "left" | "right" | Render only one side's drawer. Omit to render both. | api/index.tsx:368 |
RddToastsProps
Defined in: components/Toast.tsx:58
Props for <RddToasts>. Mount one instance at your app root, alongside <RddModals>.
Example
<RddToasts position="top-right" progressBar />Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
adapter? | ToastAdapter | Delegate all toast.* calls to a custom renderer (Ant Design, MUI, Sonner, etc.). | components/Toast.tsx:78 |
animation? | "none" | "slide" | "fade" | Entry/exit animation style. Default 'slide' | components/Toast.tsx:70 |
defaultClosable? | boolean | Show the × close button on all notifications unless overridden per-toast. Default true | components/Toast.tsx:66 |
defaultDuration? | number | Default auto-dismiss delay in ms. 0 = all notifications sticky. Default 5000 | components/Toast.tsx:64 |
maxVisible? | number | Maximum number of notifications shown simultaneously. Extras are queued. Default 3 | components/Toast.tsx:62 |
newestOnTop? | boolean | When true, newest notification appears at the top of the stack. Default false | components/Toast.tsx:72 |
pauseOnHover? | boolean | Pause the auto-dismiss timer while the cursor is over a notification. Default true | components/Toast.tsx:68 |
position? | ToastPosition | Where notifications appear in the viewport. Default 'top-right' | components/Toast.tsx:60 |
progressBar? | boolean | Show a countdown progress bar at the bottom of each notification. Default false | components/Toast.tsx:74 |
width? | number | Width of each notification card in pixels. Default 320 | components/Toast.tsx:76 |
RddToolbarButtonProps
Defined in: components/panelOverlay/PanelToolbar.tsx:118
Props for <RddToolbarButton>.
Methods
onClick()
onClick(): void;Defined in: components/panelOverlay/PanelToolbar.tsx:122
Click handler.
Returns
void
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
disabled? | boolean | - | components/panelOverlay/PanelToolbar.tsx:123 |
icon | ReactNode | Button icon: an SVG, an icon component or an icon-font glyph. Pass no size: the library sizes it with --rdd-panel-toolbar-icon-size. | components/panelOverlay/PanelToolbar.tsx:120 |
title? | string | Tooltip text and accessible aria-label. | components/panelOverlay/PanelToolbar.tsx:125 |
variant? | ButtonVariant | Visual style override. Falls back to the parent PanelToolbar's buttonVariant. | components/panelOverlay/PanelToolbar.tsx:127 |
RddToolbarProps
Defined in: components/Toolbar.tsx:147
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
className? | string | - | components/Toolbar.tsx:156 |
items | ToolbarItem[] | Ordered list of items to render. | components/Toolbar.tsx:151 |
onVisibilityChange? | (visible) => void | Called when show/hide/toggle is invoked on the imperative handle. | components/Toolbar.tsx:155 |
position? | "left" | "top" | "right" | "bottom" | Side the strip is attached to. Controls strip orientation. Default: 'left' | components/Toolbar.tsx:149 |
style? | CSSProperties | - | components/Toolbar.tsx:157 |
visible? | boolean | Collapse the strip to zero width/height. State is preserved — no unmount. | components/Toolbar.tsx:153 |
RddToolbarSearchProps
Defined in: components/panelOverlay/ToolbarSearch.tsx:27
Props for <RddToolbarSearch>.
Methods
onSearch()
onSearch(query, signal):
| SearchResult[]
| Promise<SearchResult[]>;Defined in: components/panelOverlay/ToolbarSearch.tsx:35
Called with the current query and an AbortSignal each time the input changes (debounced). Return SearchResult[] directly for synchronous sources, or Promise<SearchResult[]> for async. Abort in-flight requests when the signal fires to prevent stale result races.
Parameters
| Parameter | Type |
|---|---|
query | string |
signal | AbortSignal |
Returns
| SearchResult[] | Promise<SearchResult[]>
onSelect()
onSelect(result): void;Defined in: components/panelOverlay/ToolbarSearch.tsx:37
Called when the user selects a result from the dropdown.
Parameters
| Parameter | Type |
|---|---|
result | SearchResult |
Returns
void
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
placeholder? | string | Placeholder text shown in the expanded input field. Default the searchPlaceholder message ('Search…') | components/panelOverlay/ToolbarSearch.tsx:29 |
RddToolbarToggleProps
Defined in: components/panelOverlay/PanelToolbar.tsx:150
Props for <RddToolbarToggle>.
Methods
onToggle()
onToggle(): void;Defined in: components/panelOverlay/PanelToolbar.tsx:156
Called when the button is clicked. Toggle active in response.
Returns
void
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
active | boolean | Whether the toggle is in the active/pressed state. Sets aria-pressed automatically. | components/panelOverlay/PanelToolbar.tsx:154 |
disabled? | boolean | - | components/panelOverlay/PanelToolbar.tsx:157 |
icon | ReactNode | Button icon: an SVG, an icon component or an icon-font glyph. Pass no size: the library sizes it with --rdd-panel-toolbar-icon-size. | components/panelOverlay/PanelToolbar.tsx:152 |
title? | string | Tooltip text and accessible aria-label. | components/panelOverlay/PanelToolbar.tsx:159 |
variant? | ButtonVariant | Visual style override. Falls back to the parent PanelToolbar's buttonVariant. | components/panelOverlay/PanelToolbar.tsx:161 |
ResizeConstraints
Defined in: components/dragResize.ts:89
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
maxH? | number | Upper bound on height — only applies to southward growth (dir includes 's'). | components/dragResize.ts:95 |
maxW? | number | Upper bound on width — only applies to eastward growth (dir includes 'e'). | components/dragResize.ts:93 |
minH | number | - | components/dragResize.ts:91 |
minW | number | - | components/dragResize.ts:90 |
minX? | number | Lower bound on the resulting x — only applies to westward growth (dir includes 'w'). | components/dragResize.ts:97 |
minY? | number | Lower bound on the resulting y — only applies to northward growth (dir includes 'n'). | components/dragResize.ts:99 |
ResizeRect
Defined in: components/dragResize.ts:82
Properties
| Property | Type | Defined in |
|---|---|---|
h | number | components/dragResize.ts:86 |
w | number | components/dragResize.ts:85 |
x | number | components/dragResize.ts:83 |
y | number | components/dragResize.ts:84 |
ResolvedToastOptions
Defined in: components/Toast.tsx:43
Fully-resolved options passed to ToastAdapter.show() and ToastAdapter.update(). All optional ToastOptions fields are resolved against the container defaults.
Properties
| Property | Type | Defined in |
|---|---|---|
closable | boolean | components/Toast.tsx:47 |
content? | ReactNode | components/Toast.tsx:49 |
duration | number | components/Toast.tsx:46 |
icon? | ReactNode | components/Toast.tsx:48 |
id | string | components/Toast.tsx:44 |
onClose? | () => void | components/Toast.tsx:50 |
type | ToastType | components/Toast.tsx:45 |
SearchResult
Defined in: components/panelOverlay/ToolbarSearch.tsx:13
A single result item returned by RddToolbarSearchProps.onSearch.
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
description? | string | Optional secondary text shown below the label in the dropdown. | components/panelOverlay/ToolbarSearch.tsx:19 |
group? | string | Optional group header used to bucket results visually. | components/panelOverlay/ToolbarSearch.tsx:21 |
icon? | ReactNode | Optional icon shown to the left of the label. | components/panelOverlay/ToolbarSearch.tsx:23 |
id | string | Unique identifier for this result — passed to onSelect. | components/panelOverlay/ToolbarSearch.tsx:15 |
label | string | Primary display text. | components/panelOverlay/ToolbarSearch.tsx:17 |
SerializedLayout
Defined in: types.ts:685
The on-disk shape produced by saveLayout() and accepted by loadLayout()/initialState.
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
activePanelId? | string | null | The globally active panel at save time — the one the user was actually looking at. Omitted when nothing was active, and when the active panel didn't survive this snapshot's serializability pruning (see WorkspaceActions.saveLayout) — so it never names a panel absent from this payload's own panels. Absent on every layout saved before this field existed, in which case the restore derives it from gridRoot's own per-leaf selection instead; a present-but-no-longer-valid value falls back to the same derivation. version is deliberately not bumped for this: the field is optional and its absence is a supported, fully-handled case rather than a schema a migration has to branch on. | types.ts:699 |
floating | FloatingWindow[] | - | types.ts:701 |
gridRoot | LayoutNode | - | types.ts:700 |
minimized | { component: string; id: string; title: string | MessageDescriptor | (() => string); }[] | - | types.ts:702 |
panels | Record<string, PanelInfo> | - | types.ts:703 |
version? | number | Schema version — absent on layouts saved before this field was introduced (treated as 0). | types.ts:687 |
ShowContextMenuOptions
Defined in: components/ContextMenu.tsx:58
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
dir? | "rtl" | "ltr" | The menu's direction. By default it is the direction of the element the menu was opened from (the event's target); a workspace's showContextMenu passes its own direction for a menu opened without an event. The menu is portaled to <body>, so it can't inherit either. | components/ContextMenu.tsx:76 |
document? | Document | The document the menu opens in (7.13.0): a pop-out window's, or the page's. Seldom needed. Left out, it is the event's target's; with no event, the window of the panel that called useContextMenu(), else the window the user is in. Ignored when its window has closed. A custom ContextMenuAdapter always receives it, already chosen: portal the menu into its <body>. | components/ContextMenu.tsx:70 |
event? | | MouseEvent | TouchEvent | MouseEvent<Element, MouseEvent> | TouchEvent<Element> | - | components/ContextMenu.tsx:59 |
initialFocus? | "menu" | "first-item" | Where focus goes when the menu opens. 'menu' (the default) focuses the menu itself, with no item highlighted: ArrowDown then reaches the first item and ArrowUp the last. 'first-item' focuses the first enabled item, for a menu opened from the keyboard. When this is left out, a keyboard contextmenu event (the ContextMenu key or Shift+F10, which report no pointer position) opens on the first item and everything else, including a call with no event, on the menu: the same view every time, whatever the user did before. | components/ContextMenu.tsx:85 |
items | ContextMenuItem[] | - | components/ContextMenu.tsx:62 |
x? | number | - | components/ContextMenu.tsx:60 |
y? | number | - | components/ContextMenu.tsx:61 |
SidebarActionButton
Defined in: components/Sidebar.tsx:71
Simple case for RddSidebarProps.headerAction/footerAction: the library renders a default-styled icon button (visually consistent with the regular tab buttons) and forwards the click.
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
disabled? | boolean | - | components/Sidebar.tsx:78 |
icon | ReactNode | - | components/Sidebar.tsx:74 |
id? | string | Only needed when used inside a SidebarRailEntry[] array, for the React key. | components/Sidebar.tsx:73 |
label | string | Tooltip and aria-label — same convention as SidebarTab.label. | components/Sidebar.tsx:76 |
onClick | () => void | - | components/Sidebar.tsx:77 |
SidebarContext
Defined in: components/Sidebar.tsx:229
Value provided by useSidebar(). Available to any component inside the <RddSidebar> React tree, including panels rendered via {children}.
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
closeDrawer | () => void | - | components/Sidebar.tsx:231 |
getActiveTab | () => string | null | - | components/Sidebar.tsx:232 |
isSecondary | boolean | True if this instance is a <RddSecondarySidebar>, false for a primary <RddSidebar>. | components/Sidebar.tsx:236 |
openTab | (tabId) => void | - | components/Sidebar.tsx:230 |
position | "left" | "right" | Which side this Sidebar instance is rendering on. | components/Sidebar.tsx:234 |
SidebarCustomEntry
Defined in: components/Sidebar.tsx:87
Full-control case for RddSidebarProps.headerAction/footerAction: the consumer supplies their own markup (a Material UI IconButton, a Bootstrap Button, a Tailwind-styled <button>, or anything else) wholesale. The library renders exactly what this returns, unwrapped, so the consumer's own hover/active/focus/ripple behavior and click handling are untouched.
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
id? | string | Only needed when used inside a SidebarRailEntry[] array, for the React key. | components/Sidebar.tsx:89 |
render | () => ReactNode | - | components/Sidebar.tsx:90 |
SidebarHandle
Defined in: components/Sidebar.tsx:212
Imperative handle exposed by <RddSidebar ref={...}>.
Properties
| Property | Type | Defined in |
|---|---|---|
closeDrawer | () => void | components/Sidebar.tsx:214 |
getActiveTab | () => string | null | components/Sidebar.tsx:215 |
getWidth | () => number | components/Sidebar.tsx:222 |
hide | () => void | components/Sidebar.tsx:217 |
hideStrip | () => void | components/Sidebar.tsx:220 |
openTab | (tabId) => void | components/Sidebar.tsx:213 |
setWidth | (px) => void | components/Sidebar.tsx:221 |
show | () => void | components/Sidebar.tsx:216 |
showStrip | () => void | components/Sidebar.tsx:219 |
toggle | () => void | components/Sidebar.tsx:218 |
SidebarTab
Defined in: components/Sidebar.tsx:32
Per-tab configuration supplied by the consuming application.
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
eagerMount? | boolean | Mount immediately when the Sidebar first renders, not on first user click. Implies preserveState: true. Default: false | components/Sidebar.tsx:50 |
hidden? | boolean | Omit this tab's rail button entirely — no icon, no click target — while it remains fully openable via openTab() / useSidebar().openTab() / a controlled activeTabId. Use for menu-driven panels with no persistent icon (e.g. a Google-Maps-style hamburger that opens content not otherwise pinned to the rail). Default: false | components/Sidebar.tsx:44 |
icon? | ReactNode | Required unless hidden is true — a hidden tab never renders a rail button, so it has no icon to show. | components/Sidebar.tsx:36 |
id | string | - | components/Sidebar.tsx:33 |
label | string | - | components/Sidebar.tsx:34 |
preserveState? | boolean | Keep the component alive behind display: none when closed instead of unmounting it. Use for panels with expensive local state. Default: false | components/Sidebar.tsx:56 |
renderContent | (tabId, onClose, onOpen) => ReactNode | Called to obtain the drawer content for this tab. | components/Sidebar.tsx:63 |
SidebarTabContext
Defined in: components/Sidebar.tsx:243
Value provided by useSidebarTab(). Available only to components rendered inside a sidebar tab's renderContent tree.
Properties
| Property | Type | Defined in |
|---|---|---|
onClose | () => void | components/Sidebar.tsx:246 |
onOpen | () => void | components/Sidebar.tsx:245 |
openTab | (tabId) => void | components/Sidebar.tsx:247 |
tabId | string | components/Sidebar.tsx:244 |
SidePanelOptions
Defined in: components/PanelProviderContext.tsx:33
Configuration options applied when opening a SidePanel.
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
bodyPadding? | string | number | CSS padding for the panel body content — a number (px) or any CSS value/shorthand (e.g. '10px 16px'). Default: 0 (edge-to-edge) — pass 10 to restore the pre-v6.0.0 default, or any value your content needs. | components/PanelProviderContext.tsx:45 |
icon? | ReactNode | Icon displayed next to the panel title. | components/PanelProviderContext.tsx:37 |
title? | PanelTitle | Display title for the side-panel header. | components/PanelProviderContext.tsx:35 |
width? | string | number | Specific CSS width (e.g. 300, '40%') for the panel container. | components/PanelProviderContext.tsx:39 |
SidePanelsApi
Defined in: api/index.tsx:305
Returned by useSidePanels.
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
close | (id) => void | - | api/index.tsx:310 |
closeAll | () => void | Closes both drawers. | api/index.tsx:312 |
get | (id) => OverlayInstance | undefined | - | api/index.tsx:313 |
left | OverlayInstance | null | - | api/index.tsx:306 |
openLeft | <P>(component, props, options?) => Promise<string | null> | - | api/index.tsx:308 |
openRight | <P>(component, props, options?) => Promise<string | null> | - | api/index.tsx:309 |
right | OverlayInstance | null | - | api/index.tsx:307 |
setDirty | (id, dirty, options?) => void | - | api/index.tsx:315 |
update | (id, updates) => void | - | api/index.tsx:314 |
TabContentProps
Defined in: types.ts:62
What renderTabContent receives for each tab (7.10.0). title is already formatted and icon is the icon the built-in content shows, so the built-in content is one line to re-create: <>{icon} {title}{dirty && ' *'}</>.
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
component | string | The panel's registered kind: branch on it for a per-type look. | types.ts:66 |
dirty | boolean | Has unsaved changes; the built-in content shows *. | types.ts:72 |
focused | boolean | The workspace's active panel. | types.ts:76 |
icon | ReactNode | The icon the built-in content shows: set at runtime, else the registration's, else the default. | types.ts:70 |
panelId | string | The panel's instance id. | types.ts:64 |
selected | boolean | The tab shown in its group. | types.ts:74 |
title | string | The title, formatted: messages resolved, functions called. | types.ts:68 |
ToastAdapter
Defined in: components/Toast.tsx:101
Strategy interface for replacing the built-in toast renderer with an external library. Pass an instance via <RddToasts adapter={...} /> to redirect all toast.* calls without changing any call sites in your application.
See
RddToastsProps.adapter
Methods
dismiss()
dismiss(id?): void;Defined in: components/Toast.tsx:107
Called to dismiss one notification (id provided) or all active notifications (no id).
Parameters
| Parameter | Type |
|---|---|
id? | string |
Returns
void
show()
show(
id,
message,
options): void;Defined in: components/Toast.tsx:103
Called when a new notification is requested.
Parameters
| Parameter | Type |
|---|---|
id | string |
message | ReactNode |
options | ResolvedToastOptions |
Returns
void
update()
update(
id,
message,
options): void;Defined in: components/Toast.tsx:105
Called when an existing notification is updated (e.g. after toast.promise() resolves).
Parameters
| Parameter | Type |
|---|---|
id | string |
message | ReactNode |
options | Partial<ResolvedToastOptions> |
Returns
void
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
Container | | ComponentType<{ position: ToastPosition; }> | null | null means the adapter manages its own DOM and <RddToasts> renders nothing. A component causes <RddToasts> to portal-render it with a position prop. | components/Toast.tsx:112 |
ToastFunction()
Defined in: components/Toast.tsx:186
Type of the toast singleton. Callable directly or via named shorthand methods. Import this type to annotate variables or props that accept the toast object.
Example
function notify(fn: ToastFunction) { fn.success('Done!'); }ToastFunction(msg, opts?): string;Defined in: components/Toast.tsx:188
Show a notification. opts.type defaults to 'info'. Returns the notification ID.
Parameters
| Parameter | Type |
|---|---|
msg | ReactNode |
opts? | ToastOptions |
Returns
string
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
dismiss | (id?) => void | Dismiss a notification by ID, or all active notifications when called with no argument. | components/Toast.tsx:198 |
error | (msg, opts?) => string | Show an error notification. Returns the notification ID. | components/Toast.tsx:196 |
info | (msg, opts?) => string | Show an info notification. Returns the notification ID. | components/Toast.tsx:190 |
promise | <T>(promise, messages, opts?) => Promise<T> | Track a promise through pending → success/error states. Shows a sticky pending notification immediately, then transitions it on settlement. | components/Toast.tsx:204 |
success | (msg, opts?) => string | Show a success notification. Returns the notification ID. | components/Toast.tsx:192 |
warning | (msg, opts?) => string | Show a warning notification. Returns the notification ID. | components/Toast.tsx:194 |
ToastOptions
Defined in: components/Toast.tsx:22
Per-notification options passed to toast(), toast.info(), etc. All fields are optional and fall back to <RddToasts> defaults when unset.
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
closable? | boolean | Show the × close button on this notification. Default from container | components/Toast.tsx:30 |
content? | ReactNode | Replace the string message with arbitrary JSX. | components/Toast.tsx:34 |
duration? | number | Auto-dismiss delay in ms. 0 = sticky (never auto-dismisses). Default from container | components/Toast.tsx:26 |
icon? | ReactNode | Override the built-in type icon with arbitrary content. | components/Toast.tsx:32 |
id? | string | Explicit ID for dedup — calling toast.* with the same id updates the existing card in-place. | components/Toast.tsx:28 |
onClose? | () => void | Called when the notification is dismissed by timer, close button, or toast.dismiss(). | components/Toast.tsx:36 |
type? | ToastType | Visual type. Overridden by the toast.info/success/warning/error shorthands. Default 'info' | components/Toast.tsx:24 |
ToastPromiseMessages
Defined in: components/Toast.tsx:86
Message set for toast.promise(). Each field may be static content or a function that receives the resolved/rejected value and returns renderable content.
Type Parameters
| Type Parameter | Description |
|---|---|
T | The resolved value type of the tracked promise. |
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
error | ReactNode | ((err) => ReactNode) | Shown on rejection. Pass a function to include the error reason. | components/Toast.tsx:92 |
pending | ReactNode | Shown while the promise is pending. | components/Toast.tsx:88 |
success | ReactNode | ((result) => ReactNode) | Shown on fulfillment. Pass a function to include the resolved value. | components/Toast.tsx:90 |
ToolbarActionItem
Defined in: components/Toolbar.tsx:23
A one-shot action button.
Properties
| Property | Type | Defined in |
|---|---|---|
disabled? | boolean | components/Toolbar.tsx:29 |
icon | ReactNode | components/Toolbar.tsx:27 |
id | string | components/Toolbar.tsx:25 |
label | string | components/Toolbar.tsx:26 |
onClick | () => void | components/Toolbar.tsx:28 |
type | "action" | components/Toolbar.tsx:24 |
ToolbarContextValue
Defined in: components/ToolbarContext.tsx:9
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
getActiveInGroup | (group) => string | null | Returns the active item id in a radio group, or null if none. | components/ToolbarContext.tsx:11 |
isModifierActive | (id) => boolean | Returns whether a toggle modifier is currently active. | components/ToolbarContext.tsx:15 |
setActiveInGroup | (group, id) => void | Set the active item in a radio group (pass null to deselect all). | components/ToolbarContext.tsx:13 |
setModifierActive | (id, active) => void | Explicitly set a toggle modifier's active state. | components/ToolbarContext.tsx:17 |
toggleModifier | (id) => void | Flip a toggle modifier between active and inactive. | components/ToolbarContext.tsx:19 |
ToolbarGroupItem
Defined in: components/Toolbar.tsx:112
A collapsed tool-family button that opens a flyout panel listing all sub-tools. Only one sub-tool may be active at a time (radio semantics). The parent button's icon morphs to show the currently active sub-tool.
Supports both uncontrolled mode (omit activeItemId — state lives in ToolbarContext) and controlled mode (provide activeItemId — the caller is the single source of truth and must update the prop in response to onActiveItemChange).
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
activeItemId? | string | null | Controlled active sub-item id. When provided (even as null), the component reads this prop instead of ToolbarContext and fires onActiveItemChange on click instead of updating context. Omit (undefined) for uncontrolled behaviour. | components/Toolbar.tsx:128 |
defaultIcon | ReactNode | Icon shown when no sub-item is active. | components/Toolbar.tsx:119 |
disabled? | boolean | - | components/Toolbar.tsx:121 |
id | string | Serves as both the button ID and the radio group key in ToolbarContext. | components/Toolbar.tsx:115 |
items | ToolbarGroupEntry[] | - | components/Toolbar.tsx:120 |
label | string | Tooltip / aria-label shown when no sub-item is active. | components/Toolbar.tsx:117 |
onActiveItemChange? | (id) => void | Called when the user selects a sub-item in controlled mode. The toolbar does not update itself — the caller must update activeItemId. | components/Toolbar.tsx:133 |
type | "group" | - | components/Toolbar.tsx:113 |
ToolbarGroupSubItem
Defined in: components/Toolbar.tsx:88
A single selectable sub-tool inside a group flyout. All sub-items in the same ToolbarGroupItem share one radio group keyed by the parent ToolbarGroupItem's id.
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
disabled? | boolean | - | components/Toolbar.tsx:94 |
icon | ReactNode | - | components/Toolbar.tsx:91 |
id | string | - | components/Toolbar.tsx:89 |
label | string | - | components/Toolbar.tsx:90 |
onActivate? | (id) => void | Called when this sub-item is selected. | components/Toolbar.tsx:96 |
shortcut? | string | Keyboard shortcut displayed in the flyout panel. | components/Toolbar.tsx:93 |
ToolbarHandle
Defined in: components/Toolbar.tsx:160
Methods
hide()
hide(): void;Defined in: components/Toolbar.tsx:162
Returns
void
show()
show(): void;Defined in: components/Toolbar.tsx:161
Returns
void
toggle()
toggle(): void;Defined in: components/Toolbar.tsx:163
Returns
void
ToolbarRadioItem
Defined in: components/Toolbar.tsx:33
A mutually-exclusive radio button within a named group.
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
disabled? | boolean | - | components/Toolbar.tsx:43 |
group | string | - | components/Toolbar.tsx:36 |
icon | ReactNode | - | components/Toolbar.tsx:38 |
id | string | - | components/Toolbar.tsx:35 |
label | string | - | components/Toolbar.tsx:37 |
onActivate? | (id) => void | Called when this item becomes active. | components/Toolbar.tsx:42 |
shortcut? | string | Keyboard shortcut hint — displayed in the group flyout; reserved for future custom tooltip. | components/Toolbar.tsx:40 |
type | "radio" | - | components/Toolbar.tsx:34 |
ToolbarSeparator
Defined in: components/Toolbar.tsx:75
A visual divider between button groups.
Properties
| Property | Type | Defined in |
|---|---|---|
type | "separator" | components/Toolbar.tsx:76 |
ToolbarToggleItem
Defined in: components/Toolbar.tsx:56
An independent on/off toggle modifier (e.g. snap-to-grid).
Supports both uncontrolled mode (omit rdd-active — state lives in ToolbarContext, keyed by id) and controlled mode (provide rdd-active — the caller is the single source of truth and must update the prop in response to onToggle). Controlled mode is what lets independent instances of the same panel type report independent active state instead of colliding on a shared id.
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
active? | boolean | Controlled active state. When provided (even as false), the component reads this prop instead of ToolbarContext and does not update context on click. Omit (undefined) for uncontrolled behaviour. | components/Toolbar.tsx:68 |
disabled? | boolean | - | components/Toolbar.tsx:71 |
icon | ReactNode | - | components/Toolbar.tsx:60 |
id | string | - | components/Toolbar.tsx:58 |
label | string | - | components/Toolbar.tsx:59 |
onToggle? | (active) => void | Called after the toggle flips; receives the new active state. | components/Toolbar.tsx:70 |
shortcut? | string | Keyboard shortcut hint — reserved for future custom tooltip. | components/Toolbar.tsx:62 |
type | "toggle" | - | components/Toolbar.tsx:57 |
TypedWorkspace
Defined in: api/index.tsx:67
A workspace created from definePanels: the same object, with openPanel typed from the registry. Pass it anywhere a Workspace goes. useWorkspace() stays untyped; keep this one for typed calls.
Extends
Workspace<TEvents>
Type Parameters
| Type Parameter | Default type |
|---|---|
TPanels extends Record<string, PanelDefinition> | - |
TEvents extends object | Record<string, unknown> |
Methods
closeLeafGroup()
closeLeafGroup(leafId, options?): Promise<void>;Defined in: WorkspaceClient.ts:426
Closes a leaf group: each of its tabs is closed through the guarded close path, then the group is removed once empty. A tab whose close guard refuses — or a dirty tab that onConfirm doesn't approve — stays open, and so does its group. Resolves once every close request has been settled.
Parameters
| Parameter | Type |
|---|---|
leafId | string |
options? | { onConfirm?: (opts?) => Promise<boolean>; } |
options.onConfirm? | (opts?) => Promise<boolean> |
Returns
Promise<void>
Inherited from
closePanel()
closePanel(id): void;Defined in: WorkspaceClient.ts:271
Parameters
| Parameter | Type |
|---|---|
id | string |
Returns
void
Inherited from
dockPanel()
dockPanel(...args): void;Defined in: WorkspaceClient.ts:283
Parameters
| Parameter | Type |
|---|---|
...args | [string, string] |
Returns
void
Inherited from
dockPanelToGroup()
dockPanelToGroup(
id,
targetLeafId,
position): void;Defined in: WorkspaceClient.ts:411
Docks a panel into an existing leaf group at the given drop position.
Parameters
| Parameter | Type |
|---|---|
id | string |
targetLeafId | string |
position | DropPosition |
Returns
void
Inherited from
dockPanelToWorkspaceEdge()
dockPanelToWorkspaceEdge(id, position): void;Defined in: WorkspaceClient.ts:478
Docks a panel to one of the workspace's outer edges.
Parameters
| Parameter | Type |
|---|---|
id | string |
position | SplitDirection |
Returns
void
Inherited from
Workspace.dockPanelToWorkspaceEdge
findPanelId()
findPanelId(component, dedupeKey): string | null;Defined in: WorkspaceClient.ts:387
Finds an already-open panel of the given component with a matching dedupeKey (set via openPanel's dedupeKey option). Returns null if none is open.
Parameters
| Parameter | Type |
|---|---|
component | string |
dedupeKey | string |
Returns
string | null
Inherited from
floatPanel()
floatPanel(...args): void;Defined in: WorkspaceClient.ts:279
Parameters
| Parameter | Type |
|---|---|
...args | [string, { height: number; width: number; x: number; y: number; }, FloatAnchor | null] |
Returns
void
Inherited from
focusPanel()
Call Signature
focusPanel(id): void;Defined in: WorkspaceClient.ts:296
Activates the given panel regardless of its current state. For floating panels: raises z-index so the window appears on top. For docked panels: selects the tab within its leaf group. For minimized panels: makes it the active one, but leaves it minimized. For a panel in its own window (7.12.0): also brings that window forward, best effort.
Parameters
| Parameter | Type |
|---|---|
id | string |
Returns
void
Inherited from
Call Signature
focusPanel(id, options): void;Defined in: WorkspaceClient.ts:305
As focusPanel(id); with restore: true, a minimized panel is restored first, with restorePanel's events (7.11.0).
Parameters
| Parameter | Type |
|---|---|
id | string |
options | { restore?: boolean; } |
options.restore? | boolean |
Returns
void
Example
workspace.focusPanel('map-1', { restore: true }); // bring the map forward, wherever it isInherited from
focusPanelWindow()
focusPanelWindow(id): {
ok: boolean;
};Defined in: WorkspaceClient.ts:323
Brings forward the window that holds a panel, and makes it the active panel (7.12.0): its pop-out for a panel in its own window (a widget's panel too), the main window for one in the page. Best effort: a browser may keep another window in front. ok is false for an id that isn't open.
Parameters
| Parameter | Type |
|---|---|
id | string |
Returns
{
ok: boolean;
}| Name | Type | Defined in |
|---|---|---|
ok | boolean | WorkspaceClient.ts:323 |
Example
// From a widget in its own window: bring its owner panel's window forward.
workspace.focusPanelWindow(useWidget()!.ownerPanelId!);Inherited from
getOpenPanelIds()
getOpenPanelIds(): string[];Defined in: WorkspaceClient.ts:383
Returns the IDs of all currently open panels.
Returns
string[]
Inherited from
isOpen()
isOpen(id): boolean;Defined in: WorkspaceClient.ts:380
Returns true if a panel with this ID is currently open.
Parameters
| Parameter | Type |
|---|---|
id | string |
Returns
boolean
Inherited from
loadLayout()
loadLayout(json): boolean;Defined in: WorkspaceClient.ts:393
Parameters
| Parameter | Type |
|---|---|
json | string |
Returns
boolean
Inherited from
maximizePanel()
maximizePanel(id): void;Defined in: WorkspaceClient.ts:287
Parameters
| Parameter | Type |
|---|---|
id | string |
Returns
void
Inherited from
minimizePanel()
minimizePanel(id): void;Defined in: WorkspaceClient.ts:273
Parameters
| Parameter | Type |
|---|---|
id | string |
Returns
void
Inherited from
movePanelOrder()
movePanelOrder(
panelId,
targetLeafId,
targetIndex): void;Defined in: WorkspaceClient.ts:416
Reorders a panel's tab within its leaf group.
Parameters
| Parameter | Type |
|---|---|
panelId | string |
targetLeafId | string |
targetIndex | number |
Returns
void
Inherited from
onLayoutChanged()
onLayoutChanged(callback): () => void;Defined in: WorkspaceClient.ts:534
Subscribe to the coalesced layout-change signal — see BuiltInEvents's 'layout:changed' doc for exactly what it covers (and doesn't).
Parameters
| Parameter | Type |
|---|---|
callback | () => void |
Returns
() => void
Inherited from
onPanelClose()
onPanelClose(callback): () => void;Defined in: WorkspaceClient.ts:512
Subscribe to panel close events.
Parameters
| Parameter | Type |
|---|---|
callback | (id) => void |
Returns
() => void
Inherited from
onPanelMinimize()
onPanelMinimize(callback): () => void;Defined in: WorkspaceClient.ts:519
Subscribe to panel minimize events.
Parameters
| Parameter | Type |
|---|---|
callback | (id) => void |
Returns
() => void
Inherited from
onPanelOpen()
onPanelOpen(callback): () => void;Defined in: WorkspaceClient.ts:504
Subscribe to panel open events. Fires only for newly created panels.
Parameters
| Parameter | Type |
|---|---|
callback | (id, component) => void |
Returns
() => void
Inherited from
onPanelRestore()
onPanelRestore(callback): () => void;Defined in: WorkspaceClient.ts:526
Subscribe to panel restore events.
Parameters
| Parameter | Type |
|---|---|
callback | (id) => void |
Returns
() => void
Inherited from
onPanelsExcluded()
onPanelsExcluded(callback): () => void;Defined in: WorkspaceClient.ts:541
Subscribe to notification that a saveLayout() call excluded one or more panels because their current props weren't serializable — see BuiltInEvents's 'layout:panels-excluded' doc.
Parameters
| Parameter | Type |
|---|---|
callback | (panels) => void |
Returns
() => void
Inherited from
openPanel()
openPanel<K>(
id,
component,
options?): void;Defined in: api/index.tsx:69
openPanel, typed: a registered name, and that panel's props.
Type Parameters
| Type Parameter |
|---|
K extends string |
Parameters
| Parameter | Type |
|---|---|
id | string |
component | K |
options? | OpenPanelOptions<PanelPropsOf<TPanels[K]>> |
Returns
void
Overrides
popOutPanel()
popOutPanel(id): PopOutResult;Defined in: WorkspaceClient.ts:361
Moves a panel into its own browser window (7.12.0), for a second monitor. Nothing remounts: the panel's state, scroll offsets and a canvas's WebGL context go with it. A docked panel remembers its group and goes back into it on return.
Call it inside the user's click or key press: browsers only open a window then. A click in one of the app's pop-out windows counts too (7.12.1). It is synchronous, and says what happened (see PopOutResult); on a refusal the panel stays where it is and nothing is shown to the user, so the app decides what to say. Calling it for a panel that is already out brings its window forward.
Needs createWorkspace({ popOut: true }) and the panel type's defaultOptions.canPopOut. The window opens <DockableDesktopProvider popoutUrl>, or a blank window. When that page can't be used after all (another origin, or it doesn't load within 10 s), the panel comes back and the window closes, after this has returned { ok: true }.
On { ok: true }, panel:popping-out was sent during the call, with the panel still in the page; panel:popped-out follows once it is laid out in the window, or panel:returned when the window fails first.
Parameters
| Parameter | Type |
|---|---|
id | string |
Returns
Example
<button onClick={() => {
const result = workspace.popOutPanel('chart-1');
if (!result.ok && result.reason === 'blocked') alert('Allow pop-ups for this site.');
}}>Pop out</button>Inherited from
publish()
publish<K>(event, data): void;Defined in: WorkspaceClient.ts:487
Type Parameters
| Type Parameter |
|---|
K extends string | number | symbol |
Parameters
| Parameter | Type |
|---|---|
event | K |
data | TEvents & BuiltInEvents[K] |
Returns
void
Inherited from
registerCloseGuard()
registerCloseGuard(id, guard): void;Defined in: WorkspaceClient.ts:431
Registers a guard that can veto closing the given panel.
Parameters
| Parameter | Type |
|---|---|
id | string |
guard | () => boolean | Promise<boolean> |
Returns
void
Inherited from
registerStateProvider()
registerStateProvider(id, provider): void;Defined in: WorkspaceClient.ts:441
Registers a callback reporting a panel's current restorable state, pulled fresh on every saveLayout() call — see BuiltInEvents's 'layout:panels-excluded' doc and FormContainerContract.registerStateProvider.
Parameters
| Parameter | Type |
|---|---|
id | string |
provider | () => unknown |
Returns
void
Inherited from
Workspace.registerStateProvider
requestClosePanel()
requestClosePanel(id, options?): Promise<void>;Defined in: WorkspaceClient.ts:473
Requests that a panel close, honoring any registered close guard and its dirty flag: a dirty panel closes only if onConfirm resolves true (without onConfirm it stays open). force: true skips both. Resolves once the close (or the refusal) has been decided.
Parameters
| Parameter | Type |
|---|---|
id | string |
options? | { force?: boolean; onConfirm?: (opts?) => Promise<boolean>; } |
options.force? | boolean |
options.onConfirm? | (opts?) => Promise<boolean> |
Returns
Promise<void>
Inherited from
restorePanel()
restorePanel(...args): void;Defined in: WorkspaceClient.ts:275
Parameters
| Parameter | Type |
|---|---|
...args | [string, { focus?: boolean; }] |
Returns
void
Inherited from
returnPanel()
returnPanel(id): {
ok: boolean;
};Defined in: WorkspaceClient.ts:377
Brings a panel back from its own window (7.12.0), where it was. A panel that was floating floats at its rect. One that was docked goes, in this order:
- into the group of its tab-mates, among their tabs, when one of them is docked;
- into its own group, when that group was kept and waits empty;
- beside the panels it was next to, on the same side at the same size (the nearest part of its old layout still docked);
- into the grid, when no panel is docked there;
- otherwise floating, or into the first group for a type that can't float.
Panels out at the same time come back, in any order, to the layout they left. The window closes. Closing the window, or its "Return to desktop" button, does the same. ok is false when the panel wasn't in a window.
Parameters
| Parameter | Type |
|---|---|
id | string |
Returns
{
ok: boolean;
}| Name | Type | Defined in |
|---|---|---|
ok | boolean | WorkspaceClient.ts:377 |
Inherited from
saveLayout()
saveLayout(): string;Defined in: WorkspaceClient.ts:391
Returns
string
Inherited from
setDirection()
setDirection(dir): void;Defined in: WorkspaceClient.ts:395
Parameters
| Parameter | Type |
|---|---|
dir | "rtl" | "ltr" |
Returns
void
Inherited from
setPanelDirty()
setPanelDirty(
id,
dirty,
options?): void;Defined in: WorkspaceClient.ts:449
Sets/clears a panel's dirty (unsaved changes) flag.
Parameters
| Parameter | Type |
|---|---|
id | string |
dirty | boolean |
options? | DirtyStateOptions |
Returns
void
Inherited from
setPanelIcon()
setPanelIcon(id, icon): void;Defined in: WorkspaceClient.ts:464
Sets an open panel's tab/window/taskbar icon; null restores its registration's icon. Not saved by saveLayout().
Parameters
| Parameter | Type |
|---|---|
id | string |
icon | ReactNode |
Returns
void
Inherited from
showContextMenu()
showContextMenu(options): void;Defined in: WorkspaceClient.ts:483
Shows a context menu using the app's configured ContextMenuAdapter.
Parameters
| Parameter | Type |
|---|---|
options | ShowContextMenuOptions |
Returns
void
Inherited from
subscribe()
subscribe<K>(event, callback): () => void;Defined in: WorkspaceClient.ts:494
Type Parameters
| Type Parameter |
|---|
K extends string | number | symbol |
Parameters
| Parameter | Type |
|---|---|
event | K |
callback | (data) => void |
Returns
() => void
Inherited from
unregisterCloseGuard()
unregisterCloseGuard(id): void;Defined in: WorkspaceClient.ts:436
Removes a previously registered close guard.
Parameters
| Parameter | Type |
|---|---|
id | string |
Returns
void
Inherited from
Workspace.unregisterCloseGuard
unregisterStateProvider()
unregisterStateProvider(id): void;Defined in: WorkspaceClient.ts:446
Removes a previously registered state provider.
Parameters
| Parameter | Type |
|---|---|
id | string |
Returns
void
Inherited from
Workspace.unregisterStateProvider
updateFloatingPosition()
updateFloatingPosition(id, updates): void;Defined in: WorkspaceClient.ts:403
Updates position/size/anchor of a floating panel.
Parameters
| Parameter | Type |
|---|---|
id | string |
updates | Partial<Pick<FloatingWindow, "x" | "y" | "width" | "height" | "anchor">> |
Returns
void
Inherited from
Workspace.updateFloatingPosition
updatePanelProps()
updatePanelProps(...args): void;Defined in: WorkspaceClient.ts:459
Replaces an open panel's props, or derives them from the current ones (7.11.0). See WorkspaceActions.updatePanelProps.
Parameters
| Parameter | Type |
|---|---|
...args | [string, | Record<string, unknown> | ((prev) => Record<string, unknown>)] |
Returns
void
Inherited from
updatePanelTitle()
updatePanelTitle(id, title): void;Defined in: WorkspaceClient.ts:454
Updates a panel's displayed title.
Parameters
| Parameter | Type |
|---|---|
id | string |
title | string | MessageDescriptor | (() => string) |
Returns
void
Inherited from
updateSplitSizes()
updateSplitSizes(path, sizes): void;Defined in: WorkspaceClient.ts:398
Updates the split-size fractions at the given grid path.
Parameters
| Parameter | Type |
|---|---|
path | number[] |
sizes | number[] |
Returns
void
Inherited from
Properties
| Property | Modifier | Type | Description | Inherited from | Defined in |
|---|---|---|---|---|---|
config | readonly | Pick<WorkspaceClientConfig, | "formatMessage" | "predefinedMessages" | "dir" | "defaultSplitRatio" | "defaultEdgeSplitRatio" | "zIndexBase"> | Non-rendering configuration forwarded to the provider. | Workspace.config | WorkspaceClient.ts:197 |
initialState | readonly | string | null | Serialised layout to restore on mount, or null to start with an empty canvas. | Workspace.initialState | WorkspaceClient.ts:194 |
registry | readonly | PanelRegistry | Scoped panel registry — fully independent from the global singleton. | Workspace.registry | WorkspaceClient.ts:191 |
WidgetHandle
Defined in: components/panelOverlay/widgetContext.ts:14
What useWidget() returns inside a managed widget's content (7.11.0).
usePanel() there is still the owner panel, so content bound to its owner (a table bound to its map) keeps working wherever the widget is. This is the widget's own side.
Methods
onMoved()
onMoved(cb): () => void;Defined in: components/panelOverlay/widgetContext.ts:42
Called once the element is in its new container and has its new size (or, with no size, as when minimised, on the next frames), after every move that called onWillMove. Restore what you saved in onWillMove here. Returns the unsubscribe function.
Parameters
| Parameter | Type |
|---|---|
cb | () => void |
Returns
() => void
onWillMove()
onWillMove(cb): () => void;Defined in: components/panelOverlay/widgetContext.ts:36
Called just before the widget's content element moves to another container: into or out of its panel, between docked, tabbed and floating, minimised or restored. Save what a move would disturb here, such as a map's view. Returns the unsubscribe function.
Parameters
| Parameter | Type |
|---|---|
cb | () => void |
Returns
() => void
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
id | string | The widget's id, as given to useFloatingWidgets().open(). | components/panelOverlay/widgetContext.ts:16 |
isPoppedOut | boolean | It is in its own browser window (useFloatingWidgets().popOut, 7.12.0); location is then 'floating'. Its content's usePanelWindow() gives that window. | components/panelOverlay/widgetContext.ts:30 |
location | WidgetLocation | Where it is shown now. A component that calls useWidget() re-renders when it changes. | components/panelOverlay/widgetContext.ts:25 |
ownerPanelId | string | null | The workspace panel that owns it, or null when its overlay isn't in one. | components/panelOverlay/widgetContext.ts:18 |
panelId | string | null | The id of the widget's own panel while it is out of its owner panel, for workspace calls such as updatePanelTitle; null while it is in the panel (7.11.0). | components/panelOverlay/widgetContext.ts:23 |
WidgetMenuContext
Defined in: components/panelOverlay/types.ts:132
What ManagedWidget.titleMenu is given to build its items from (7.11.0).
Methods
close()
close(): void;Defined in: components/panelOverlay/types.ts:150
Closes the widget, wherever it is.
Returns
void
move()
move(to): MoveResult;Defined in: components/panelOverlay/types.ts:148
useFloatingWidgets().move() for this widget.
Parameters
| Parameter | Type |
|---|---|
to | WidgetTarget |
Returns
popOut()
popOut(): PopOutResult;Defined in: components/panelOverlay/types.ts:146
useFloatingWidgets().popOut() for this widget (7.12.0).
Returns
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
canDock | boolean | Its config's canDock. | components/panelOverlay/types.ts:138 |
canFloat | boolean | Its config's canFloat. | components/panelOverlay/types.ts:140 |
canPopOut | boolean | Its config's canPopOut, on a workspace with popOut (7.12.0). | components/panelOverlay/types.ts:142 |
id | string | The widget's id. | components/panelOverlay/types.ts:134 |
isPoppedOut | boolean | It is in its own browser window now (location is then 'floating'). (7.12.0) | components/panelOverlay/types.ts:144 |
location | WidgetLocation | Where it is now. | components/panelOverlay/types.ts:136 |
Workspace
Defined in: api/index.tsx:36
A workspace: the layout, every action on it, the panel registry and the event bus. It is live from the moment it is created — calls made before any <DockableDesktopProvider> mounts apply immediately.
Extends
WorkspaceClient<TEvents>
Extended by
Type Parameters
| Type Parameter | Default type |
|---|---|
TEvents extends object | Record<string, unknown> |
Methods
closeLeafGroup()
closeLeafGroup(leafId, options?): Promise<void>;Defined in: WorkspaceClient.ts:426
Closes a leaf group: each of its tabs is closed through the guarded close path, then the group is removed once empty. A tab whose close guard refuses — or a dirty tab that onConfirm doesn't approve — stays open, and so does its group. Resolves once every close request has been settled.
Parameters
| Parameter | Type |
|---|---|
leafId | string |
options? | { onConfirm?: (opts?) => Promise<boolean>; } |
options.onConfirm? | (opts?) => Promise<boolean> |
Returns
Promise<void>
Inherited from
WorkspaceClient.closeLeafGroupclosePanel()
closePanel(id): void;Defined in: WorkspaceClient.ts:271
Parameters
| Parameter | Type |
|---|---|
id | string |
Returns
void
Inherited from
WorkspaceClient.closePaneldockPanel()
dockPanel(...args): void;Defined in: WorkspaceClient.ts:283
Parameters
| Parameter | Type |
|---|---|
...args | [string, string] |
Returns
void
Inherited from
WorkspaceClient.dockPaneldockPanelToGroup()
dockPanelToGroup(
id,
targetLeafId,
position): void;Defined in: WorkspaceClient.ts:411
Docks a panel into an existing leaf group at the given drop position.
Parameters
| Parameter | Type |
|---|---|
id | string |
targetLeafId | string |
position | DropPosition |
Returns
void
Inherited from
WorkspaceClient.dockPanelToGroupdockPanelToWorkspaceEdge()
dockPanelToWorkspaceEdge(id, position): void;Defined in: WorkspaceClient.ts:478
Docks a panel to one of the workspace's outer edges.
Parameters
| Parameter | Type |
|---|---|
id | string |
position | SplitDirection |
Returns
void
Inherited from
WorkspaceClient.dockPanelToWorkspaceEdgefindPanelId()
findPanelId(component, dedupeKey): string | null;Defined in: WorkspaceClient.ts:387
Finds an already-open panel of the given component with a matching dedupeKey (set via openPanel's dedupeKey option). Returns null if none is open.
Parameters
| Parameter | Type |
|---|---|
component | string |
dedupeKey | string |
Returns
string | null
Inherited from
WorkspaceClient.findPanelIdfloatPanel()
floatPanel(...args): void;Defined in: WorkspaceClient.ts:279
Parameters
| Parameter | Type |
|---|---|
...args | [string, { height: number; width: number; x: number; y: number; }, FloatAnchor | null] |
Returns
void
Inherited from
WorkspaceClient.floatPanelfocusPanel()
Call Signature
focusPanel(id): void;Defined in: WorkspaceClient.ts:296
Activates the given panel regardless of its current state. For floating panels: raises z-index so the window appears on top. For docked panels: selects the tab within its leaf group. For minimized panels: makes it the active one, but leaves it minimized. For a panel in its own window (7.12.0): also brings that window forward, best effort.
Parameters
| Parameter | Type |
|---|---|
id | string |
Returns
void
Inherited from
WorkspaceClient.focusPanelCall Signature
focusPanel(id, options): void;Defined in: WorkspaceClient.ts:305
As focusPanel(id); with restore: true, a minimized panel is restored first, with restorePanel's events (7.11.0).
Parameters
| Parameter | Type |
|---|---|
id | string |
options | { restore?: boolean; } |
options.restore? | boolean |
Returns
void
Example
workspace.focusPanel('map-1', { restore: true }); // bring the map forward, wherever it isInherited from
WorkspaceClient.focusPanelfocusPanelWindow()
focusPanelWindow(id): {
ok: boolean;
};Defined in: WorkspaceClient.ts:323
Brings forward the window that holds a panel, and makes it the active panel (7.12.0): its pop-out for a panel in its own window (a widget's panel too), the main window for one in the page. Best effort: a browser may keep another window in front. ok is false for an id that isn't open.
Parameters
| Parameter | Type |
|---|---|
id | string |
Returns
{
ok: boolean;
}| Name | Type | Defined in |
|---|---|---|
ok | boolean | WorkspaceClient.ts:323 |
Example
// From a widget in its own window: bring its owner panel's window forward.
workspace.focusPanelWindow(useWidget()!.ownerPanelId!);Inherited from
WorkspaceClient.focusPanelWindowgetOpenPanelIds()
getOpenPanelIds(): string[];Defined in: WorkspaceClient.ts:383
Returns the IDs of all currently open panels.
Returns
string[]
Inherited from
WorkspaceClient.getOpenPanelIdsisOpen()
isOpen(id): boolean;Defined in: WorkspaceClient.ts:380
Returns true if a panel with this ID is currently open.
Parameters
| Parameter | Type |
|---|---|
id | string |
Returns
boolean
Inherited from
WorkspaceClient.isOpenloadLayout()
loadLayout(json): boolean;Defined in: WorkspaceClient.ts:393
Parameters
| Parameter | Type |
|---|---|
json | string |
Returns
boolean
Inherited from
WorkspaceClient.loadLayoutmaximizePanel()
maximizePanel(id): void;Defined in: WorkspaceClient.ts:287
Parameters
| Parameter | Type |
|---|---|
id | string |
Returns
void
Inherited from
WorkspaceClient.maximizePanelminimizePanel()
minimizePanel(id): void;Defined in: WorkspaceClient.ts:273
Parameters
| Parameter | Type |
|---|---|
id | string |
Returns
void
Inherited from
WorkspaceClient.minimizePanelmovePanelOrder()
movePanelOrder(
panelId,
targetLeafId,
targetIndex): void;Defined in: WorkspaceClient.ts:416
Reorders a panel's tab within its leaf group.
Parameters
| Parameter | Type |
|---|---|
panelId | string |
targetLeafId | string |
targetIndex | number |
Returns
void
Inherited from
WorkspaceClient.movePanelOrderonLayoutChanged()
onLayoutChanged(callback): () => void;Defined in: WorkspaceClient.ts:534
Subscribe to the coalesced layout-change signal — see BuiltInEvents's 'layout:changed' doc for exactly what it covers (and doesn't).
Parameters
| Parameter | Type |
|---|---|
callback | () => void |
Returns
() => void
Inherited from
WorkspaceClient.onLayoutChangedonPanelClose()
onPanelClose(callback): () => void;Defined in: WorkspaceClient.ts:512
Subscribe to panel close events.
Parameters
| Parameter | Type |
|---|---|
callback | (id) => void |
Returns
() => void
Inherited from
WorkspaceClient.onPanelCloseonPanelMinimize()
onPanelMinimize(callback): () => void;Defined in: WorkspaceClient.ts:519
Subscribe to panel minimize events.
Parameters
| Parameter | Type |
|---|---|
callback | (id) => void |
Returns
() => void
Inherited from
WorkspaceClient.onPanelMinimizeonPanelOpen()
onPanelOpen(callback): () => void;Defined in: WorkspaceClient.ts:504
Subscribe to panel open events. Fires only for newly created panels.
Parameters
| Parameter | Type |
|---|---|
callback | (id, component) => void |
Returns
() => void
Inherited from
WorkspaceClient.onPanelOpenonPanelRestore()
onPanelRestore(callback): () => void;Defined in: WorkspaceClient.ts:526
Subscribe to panel restore events.
Parameters
| Parameter | Type |
|---|---|
callback | (id) => void |
Returns
() => void
Inherited from
WorkspaceClient.onPanelRestoreonPanelsExcluded()
onPanelsExcluded(callback): () => void;Defined in: WorkspaceClient.ts:541
Subscribe to notification that a saveLayout() call excluded one or more panels because their current props weren't serializable — see BuiltInEvents's 'layout:panels-excluded' doc.
Parameters
| Parameter | Type |
|---|---|
callback | (panels) => void |
Returns
() => void
Inherited from
WorkspaceClient.onPanelsExcludedopenPanel()
openPanel(...args): void;Defined in: WorkspaceClient.ts:269
Parameters
| Parameter | Type |
|---|---|
...args | [string, string, OpenPanelOptions<object>] |
Returns
void
Inherited from
WorkspaceClient.openPanelpopOutPanel()
popOutPanel(id): PopOutResult;Defined in: WorkspaceClient.ts:361
Moves a panel into its own browser window (7.12.0), for a second monitor. Nothing remounts: the panel's state, scroll offsets and a canvas's WebGL context go with it. A docked panel remembers its group and goes back into it on return.
Call it inside the user's click or key press: browsers only open a window then. A click in one of the app's pop-out windows counts too (7.12.1). It is synchronous, and says what happened (see PopOutResult); on a refusal the panel stays where it is and nothing is shown to the user, so the app decides what to say. Calling it for a panel that is already out brings its window forward.
Needs createWorkspace({ popOut: true }) and the panel type's defaultOptions.canPopOut. The window opens <DockableDesktopProvider popoutUrl>, or a blank window. When that page can't be used after all (another origin, or it doesn't load within 10 s), the panel comes back and the window closes, after this has returned { ok: true }.
On { ok: true }, panel:popping-out was sent during the call, with the panel still in the page; panel:popped-out follows once it is laid out in the window, or panel:returned when the window fails first.
Parameters
| Parameter | Type |
|---|---|
id | string |
Returns
Example
<button onClick={() => {
const result = workspace.popOutPanel('chart-1');
if (!result.ok && result.reason === 'blocked') alert('Allow pop-ups for this site.');
}}>Pop out</button>Inherited from
WorkspaceClient.popOutPanelpublish()
publish<K>(event, data): void;Defined in: WorkspaceClient.ts:487
Type Parameters
| Type Parameter |
|---|
K extends string | number | symbol |
Parameters
| Parameter | Type |
|---|---|
event | K |
data | TEvents & BuiltInEvents[K] |
Returns
void
Inherited from
WorkspaceClient.publishregisterCloseGuard()
registerCloseGuard(id, guard): void;Defined in: WorkspaceClient.ts:431
Registers a guard that can veto closing the given panel.
Parameters
| Parameter | Type |
|---|---|
id | string |
guard | () => boolean | Promise<boolean> |
Returns
void
Inherited from
WorkspaceClient.registerCloseGuardregisterStateProvider()
registerStateProvider(id, provider): void;Defined in: WorkspaceClient.ts:441
Registers a callback reporting a panel's current restorable state, pulled fresh on every saveLayout() call — see BuiltInEvents's 'layout:panels-excluded' doc and FormContainerContract.registerStateProvider.
Parameters
| Parameter | Type |
|---|---|
id | string |
provider | () => unknown |
Returns
void
Inherited from
WorkspaceClient.registerStateProviderrequestClosePanel()
requestClosePanel(id, options?): Promise<void>;Defined in: WorkspaceClient.ts:473
Requests that a panel close, honoring any registered close guard and its dirty flag: a dirty panel closes only if onConfirm resolves true (without onConfirm it stays open). force: true skips both. Resolves once the close (or the refusal) has been decided.
Parameters
| Parameter | Type |
|---|---|
id | string |
options? | { force?: boolean; onConfirm?: (opts?) => Promise<boolean>; } |
options.force? | boolean |
options.onConfirm? | (opts?) => Promise<boolean> |
Returns
Promise<void>
Inherited from
WorkspaceClient.requestClosePanelrestorePanel()
restorePanel(...args): void;Defined in: WorkspaceClient.ts:275
Parameters
| Parameter | Type |
|---|---|
...args | [string, { focus?: boolean; }] |
Returns
void
Inherited from
WorkspaceClient.restorePanelreturnPanel()
returnPanel(id): {
ok: boolean;
};Defined in: WorkspaceClient.ts:377
Brings a panel back from its own window (7.12.0), where it was. A panel that was floating floats at its rect. One that was docked goes, in this order:
- into the group of its tab-mates, among their tabs, when one of them is docked;
- into its own group, when that group was kept and waits empty;
- beside the panels it was next to, on the same side at the same size (the nearest part of its old layout still docked);
- into the grid, when no panel is docked there;
- otherwise floating, or into the first group for a type that can't float.
Panels out at the same time come back, in any order, to the layout they left. The window closes. Closing the window, or its "Return to desktop" button, does the same. ok is false when the panel wasn't in a window.
Parameters
| Parameter | Type |
|---|---|
id | string |
Returns
{
ok: boolean;
}| Name | Type | Defined in |
|---|---|---|
ok | boolean | WorkspaceClient.ts:377 |
Inherited from
WorkspaceClient.returnPanelsaveLayout()
saveLayout(): string;Defined in: WorkspaceClient.ts:391
Returns
string
Inherited from
WorkspaceClient.saveLayoutsetDirection()
setDirection(dir): void;Defined in: WorkspaceClient.ts:395
Parameters
| Parameter | Type |
|---|---|
dir | "rtl" | "ltr" |
Returns
void
Inherited from
WorkspaceClient.setDirectionsetPanelDirty()
setPanelDirty(
id,
dirty,
options?): void;Defined in: WorkspaceClient.ts:449
Sets/clears a panel's dirty (unsaved changes) flag.
Parameters
| Parameter | Type |
|---|---|
id | string |
dirty | boolean |
options? | DirtyStateOptions |
Returns
void
Inherited from
WorkspaceClient.setPanelDirtysetPanelIcon()
setPanelIcon(id, icon): void;Defined in: WorkspaceClient.ts:464
Sets an open panel's tab/window/taskbar icon; null restores its registration's icon. Not saved by saveLayout().
Parameters
| Parameter | Type |
|---|---|
id | string |
icon | ReactNode |
Returns
void
Inherited from
WorkspaceClient.setPanelIconshowContextMenu()
showContextMenu(options): void;Defined in: WorkspaceClient.ts:483
Shows a context menu using the app's configured ContextMenuAdapter.
Parameters
| Parameter | Type |
|---|---|
options | ShowContextMenuOptions |
Returns
void
Inherited from
WorkspaceClient.showContextMenusubscribe()
subscribe<K>(event, callback): () => void;Defined in: WorkspaceClient.ts:494
Type Parameters
| Type Parameter |
|---|
K extends string | number | symbol |
Parameters
| Parameter | Type |
|---|---|
event | K |
callback | (data) => void |
Returns
() => void
Inherited from
WorkspaceClient.subscribeunregisterCloseGuard()
unregisterCloseGuard(id): void;Defined in: WorkspaceClient.ts:436
Removes a previously registered close guard.
Parameters
| Parameter | Type |
|---|---|
id | string |
Returns
void
Inherited from
WorkspaceClient.unregisterCloseGuardunregisterStateProvider()
unregisterStateProvider(id): void;Defined in: WorkspaceClient.ts:446
Removes a previously registered state provider.
Parameters
| Parameter | Type |
|---|---|
id | string |
Returns
void
Inherited from
WorkspaceClient.unregisterStateProviderupdateFloatingPosition()
updateFloatingPosition(id, updates): void;Defined in: WorkspaceClient.ts:403
Updates position/size/anchor of a floating panel.
Parameters
| Parameter | Type |
|---|---|
id | string |
updates | Partial<Pick<FloatingWindow, "x" | "y" | "width" | "height" | "anchor">> |
Returns
void
Inherited from
WorkspaceClient.updateFloatingPositionupdatePanelProps()
updatePanelProps(...args): void;Defined in: WorkspaceClient.ts:459
Replaces an open panel's props, or derives them from the current ones (7.11.0). See WorkspaceActions.updatePanelProps.
Parameters
| Parameter | Type |
|---|---|
...args | [string, | Record<string, unknown> | ((prev) => Record<string, unknown>)] |
Returns
void
Inherited from
WorkspaceClient.updatePanelPropsupdatePanelTitle()
updatePanelTitle(id, title): void;Defined in: WorkspaceClient.ts:454
Updates a panel's displayed title.
Parameters
| Parameter | Type |
|---|---|
id | string |
title | string | MessageDescriptor | (() => string) |
Returns
void
Inherited from
WorkspaceClient.updatePanelTitleupdateSplitSizes()
updateSplitSizes(path, sizes): void;Defined in: WorkspaceClient.ts:398
Updates the split-size fractions at the given grid path.
Parameters
| Parameter | Type |
|---|---|
path | number[] |
sizes | number[] |
Returns
void
Inherited from
WorkspaceClient.updateSplitSizesProperties
| Property | Modifier | Type | Description | Inherited from | Defined in |
|---|---|---|---|---|---|
config | readonly | Pick<WorkspaceClientConfig, | "formatMessage" | "predefinedMessages" | "dir" | "defaultSplitRatio" | "defaultEdgeSplitRatio" | "zIndexBase"> | Non-rendering configuration forwarded to the provider. | WorkspaceClient.config | WorkspaceClient.ts:197 |
initialState | readonly | string | null | Serialised layout to restore on mount, or null to start with an empty canvas. | WorkspaceClient.initialState | WorkspaceClient.ts:194 |
registry | readonly | PanelRegistry | Scoped panel registry — fully independent from the global singleton. | WorkspaceClient.registry | WorkspaceClient.ts:191 |
WorkspaceActions
Defined in: types.ts:333
Every layout action, the event bus, and layout serialization — the methods of a workspace.
Call them on the workspace from useWorkspace() inside a component, or on the object createWorkspace() returned, from anywhere.
Example
function OpenMapButton() {
const { openPanel } = useWorkspace();
return <button onClick={() => openPanel('map-1', 'map')}>Open Map</button>;
}Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
closeLeafGroup | (leafId, options?) => Promise<void> | Closes a leaf group: each of its panels is closed through the guarded close path (as if by its own tab ×), then the group is removed once empty. A close guard that refuses, or a dirty panel that onConfirm doesn't approve, keeps that panel — and therefore the group. A group with canClose: false is left alone. | types.ts:527 |
closePanel | (id) => void | Closes a panel immediately, bypassing dirty-state close guards. For guarded close, use WorkspaceActions.requestClosePanel. | types.ts:368 |
dockPanel | (id, targetLeafId?) => void | Returns a floating window to a docked grid tab group. | types.ts:395 |
dockPanelToGroup | (id, targetLeafId, position) => void | Splits an existing leaf group and docks a panel to the given side. | types.ts:510 |
dockPanelToWorkspaceEdge | (id, position) => void | Docks a floating panel to a workspace edge, creating a full-width or full-height column/row. | types.ts:606 |
findPanelId | (component, dedupeKey) => string | null | Finds the ID of an already-open panel of the given component with a matching dedupeKey (set via openPanel's dedupeKey option). Uses a synchronous stateRef read — safe to call outside of render. | types.ts:458 |
floatPanel | (id, rect?, anchor?) => void | Detaches a docked panel, converting it to a resizable floating window. | types.ts:389 |
focusPanel | (id) => void | Activates the given panel regardless of its current state. - Floating panel: raises z-index so the window appears on top of others. - Docked panel: selects the tab within its leaf group. - Minimized panel: makes it the active one but leaves it minimized. To restore it as well, call focusPanel(id, { restore: true }) on the workspace (useWorkspace(), 7.11.0). Example // Ensure a panel is visible before updating its content: if (actions.isOpen('map-1')) actions.focusPanel('map-1'); | types.ts:428 |
getOpenPanelIds | () => string[] | Returns the IDs of all currently open panels (docked, floating, and minimized). Uses a synchronous stateRef read — safe to call outside of render. | types.ts:449 |
isOpen | (id) => boolean | Returns true if a panel with the given ID is currently open (docked, floating, or minimized). Uses a synchronous stateRef read — safe to call outside of render. Example if (!actions.isOpen('map-1')) { actions.openPanel('map-1', 'map'); } else { actions.focusPanel('map-1'); } | types.ts:443 |
loadLayout | (layoutJson) => boolean | Restores a previously serialized workspace from a JSON string. Replaces the entire current layout — all panels not in the snapshot are closed. state.activePanelId is resolved from the snapshot's own activePanelId when that panel is still visible in it, and otherwise from the first leaf's selected tab (which is also the path layouts saved before that field existed take). It is never seeded from an arbitrary entry in panels. | types.ts:482 |
maximizePanel | (id) => void | Maximizes a floating window to cover the entire workspace viewport. | types.ts:402 |
minimizePanel | (id) => void | Minimizes a panel to the bottom taskbar dock, preserving its layout position. | types.ts:373 |
movePanelOrder | (panelId, targetLeafId, targetIndex) => void | Reorders a panel's tab index within a docked leaf group. | types.ts:517 |
openPanel | <P>(id, component, options?) => void | Opens a registered panel into the workspace. If the panel ID is already open, the panel is focused instead of duplicated. Becomes state.activePanelId by default — pass options.focus: false to open without stealing focus from whatever is currently active. Default true Example // Open floating and pin to the top-right corner: actions.openPanel('layers', 'layertree', { initialTarget: 'floating', anchor: 'top-right' }); // Open in the background without stealing focus: actions.openPanel('prefetch', 'report', { focus: false }); // Open with per-instance data, deduped by document path: actions.openPanel(crypto.randomUUID(), 'document', { props: { path: '/notes/todo.md' }, dedupeKey: '/notes/todo.md', }); | types.ts:362 |
publish | (event, data) => void | Publishes an event to the inter-panel pub/sub event bus. | types.ts:489 |
registerCloseGuard | (id, guard) => void | Registers a close guard that can intercept and cancel panel close requests. | types.ts:533 |
registerStateProvider | (id, provider) => void | Registers a callback reporting a docked/floating panel's current restorable state, pulled fresh every saveLayout() call — for panels whose props alone can't capture state they accumulate after opening (scroll position, an in-progress edit, a view-mode toggle). A panel that registers nothing keeps its static open-time props (or none). The returned value goes through the same isSerializable check as static props, re-evaluated on every save — a provider-backed panel's serializability can flip over its lifetime. | types.ts:550 |
requestClosePanel | (id, options?) => Promise<void> | Closes a panel the way its tab's × does: registered close guards run first, and a dirty panel closes only if onConfirm resolves true — without onConfirm, a dirty panel stays open. (The tab's own ×, which passes an onConfirm, is what shows the built-in unsaved-changes dialog.) | types.ts:600 |
restorePanel | (id, options?) => void | Restores a minimized panel back to its last docked or floating position. Default true | types.ts:379 |
saveLayout | () => string | Serializes the entire workspace state to a JSON string. Includes grid layout, floating window positions, minimized panels, panel metadata, and the globally active panel (see SerializedLayout.activePanelId). Example localStorage.setItem('layout', actions.saveLayout()); | types.ts:469 |
setDirection | (dir) => void | Overrides the workspace layout direction. | types.ts:611 |
setPanelDirty | (id, dirty, options?) => void | Marks a panel as dirty (has unsaved changes). Dirty panels show a visual indicator and the built-in close guard prompts the user before closing. | types.ts:563 |
setPanelIcon | (id, icon) => void | Sets the icon shown on an open panel's tab, floating title bar and taskbar button, in place of its registration's defaultOptions.icon. null restores the registration's icon. The icon lives only in memory: saveLayout() never writes it. | types.ts:590 |
showContextMenu | (options) => void | Imperatively shows the workspace context menu at the given position. Uses the workspace's context menu (the contextMenuAdapter given to <DockableDesktopProvider>, or an enclosing <RddContextMenu>). | types.ts:617 |
subscribe | (event, callback) => () => void | Subscribes a callback to the inter-panel pub/sub event bus. Example useEffect(() => actions.subscribe('map:zoom', ({ level }) => setZoom(level)), []); | types.ts:501 |
unregisterCloseGuard | (id) => void | Removes a previously registered close guard. | types.ts:538 |
unregisterStateProvider | (id) => void | Removes a previously registered state provider. | types.ts:555 |
updateFloatingPosition | (id, updates) => void | Updates the position or size of a floating window. | types.ts:414 |
updatePanelProps | (id, props) => void | Replaces the props an open panel was opened with (7.11.0), or derives them from the current ones. The panel re-renders with them, serializable is re-checked (see PanelInfo.serializable), and layout:changed is published. Does nothing for a panel that isn't open, or for a managed widget's own panel (it has no props of its own). Example workspace.updatePanelProps('section-1', prev => ({ ...prev, line: newLine })); | types.ts:582 |
updatePanelTitle | (id, title) => void | Updates the display title of an open panel. | types.ts:569 |
updateSplitSizes | (path, sizes) => void | Resizes the flex split proportions of a branch node's children. | types.ts:408 |
WorkspaceConfig
Defined in: api/index.tsx:25
Configuration for createWorkspace().
Extends
Omit<WorkspaceClientConfig,"predefinedMessages">
Properties
| Property | Type | Description | Inherited from | Defined in |
|---|---|---|---|---|
canDrop? | (drop) => boolean | Veto where users can move panels (7.9.0). Called for each place a dragged panel could go, and for the built-in "Float" and "Maximize" menu items: return false and that target isn't offered (its drop zone doesn't appear) and the move doesn't happen. It runs after the panel type's own canFloat / canDock, and only for what the user does: the app's own calls (floatPanel, dockPanelToGroup, openPanel) always work. Keep it fast and pure; it runs while the pointer moves. Example createWorkspace({ panels, // Nothing but tool panels in the left group. canDrop: ({ component, to }) => !(to.kind === 'group' && to.leafId === 'tools' && component !== 'tool'), }); | Omit.canDrop | WorkspaceClient.ts:139 |
defaultEdgeSplitRatio? | number | Fraction of the workspace the new panel takes when dropped on the workspace outer edge. Range 0.1–0.9. Default: 0.2. | Omit.defaultEdgeSplitRatio | WorkspaceClient.ts:114 |
defaultSplitRatio? | number | Fraction of the target panel the new panel takes when dropped on a panel's top/bottom/left/right cross target. Range 0.1–0.9. Default: 0.5. | Omit.defaultSplitRatio | WorkspaceClient.ts:109 |
dir? | "rtl" | "ltr" | Initial layout direction. | Omit.dir | WorkspaceClient.ts:104 |
formatMessage? | MessageFormatter | Custom i18n formatter for all internal strings. | Omit.formatMessage | WorkspaceClient.ts:100 |
initialState? | string | null | Serialised layout produced by a previous saveLayout() call. Pass null or omit to start with an empty canvas. Parsed synchronously before the first render. The restored activePanelId is the one the snapshot recorded, or — for layouts saved before that was persisted — the selected tab of the first leaf in the grid. | Omit.initialState | WorkspaceClient.ts:98 |
messages? | Record<string, MessageDescriptor> | Overrides any subset of the built-in message table. | - | api/index.tsx:27 |
panels? | Record<string, PanelDefinition> | Declarative panel catalog. Replaces imperative globalPanelRegistry.register() calls. Keys are the component identifiers used in openPanel() and serialised layouts. | Omit.panels | WorkspaceClient.ts:89 |
popOut? | boolean | Lets panels move into their own browser window, for a second monitor (7.12.0): a panel type opts in with defaultOptions.canPopOut, and the user opens it with "Open in new window" or the app with workspace.popOutPanel(id). Set once, here. With false, nothing of it runs: no menu item, and popOutPanel returns { ok: false, reason: 'disabled' }. Default false Example const workspace = createWorkspace({ popOut: true, panels: { chart: { component: ChartPanel, defaultOptions: { canPopOut: true } } }, }); | Omit.popOut | WorkspaceClient.ts:154 |
zIndexBase? | number | Starting z-index for floating windows and the library's own chrome overlays (context menu, toolbar flyout, modal stack, toast, workspace edge zones), all of which shift together via --rdd-z-base. Set this above/below a host app's own modal z-index range to control stacking against it. Default: 1000. | Omit.zIndexBase | WorkspaceClient.ts:121 |
WorkspaceState
Defined in: types.ts:288
Global window manager state tree representing grid nodes, windows, and panels.
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
activePanelId | string | null | The ID of the active/focused panel — the one contributions are read from (see useActiveContribution) and the one drawn with focused chrome. Always a panel the user can actually see: the selected tab of its leaf, or a floating window. Never a minimized panel, except when an app explicitly calls focusPanel() on one. Restored layouts resolve it from the saved snapshot's own activePanelId, falling back to the first leaf's selected tab — never to an arbitrary entry in panels. | types.ts:308 |
dir | "rtl" | "ltr" | Current layout direction ('ltr' or 'rtl') | types.ts:310 |
draggedPanelId | string | null | The ID of the panel tab currently being dragged. | types.ts:298 |
edgeSplitRatio | number | Split ratio for workspace outer-edge drops (0.1–0.9). Default 0.2. | types.ts:316 |
floating | FloatingWindow[] | Array of active floated windows. | types.ts:292 |
gridRoot | LayoutNode | Root branch node representing the grid. | types.ts:290 |
isRtl | boolean | Convenient boolean flag indicating RTL direction | types.ts:312 |
minimized | { component: string; id: string; title: string | MessageDescriptor | (() => string); }[] | Array of minimized panels waiting in the taskbar dock. | types.ts:294 |
panels | Record<string, PanelInfo> | Map indexing panel metadata descriptors. | types.ts:296 |
splitRatio | number | Split ratio for panel cross-target drops (0.1–0.9). Default 0.5. | types.ts:314 |
Type Aliases
ButtonVariant
type ButtonVariant = "ghost" | "soft" | "outlined" | "filled";Defined in: components/panelOverlay/PanelToolbar.tsx:16
Visual style applied to ToolbarButton and ToolbarToggle components.
ContainerType
type ContainerType =
| "left-panel"
| "right-panel"
| "modal"
| "dockable-panel"
| "floating-window"
| "standalone";Defined in: components/FormContainerContext.ts:14
Represents the type of container context a panel/form is currently rendered inside.
ContextMenuItem
type ContextMenuItem =
| ContextMenuSimpleItem
| ContextMenuSeparator
| ContextMenuSubMenu;Defined in: components/ContextMenu.tsx:54
ContextMenuLabel
type ContextMenuLabel = string | MessageDescriptor;Defined in: components/contextMenuTypes.ts:8
DropPosition
type DropPosition = SplitDirection | "center";Defined in: types.ts:36
All possible drop positions — cardinal directions plus center (same group).
FloatAnchor
type FloatAnchor = "top-left" | "top-right" | "bottom-left" | "bottom-right";Defined in: types.ts:129
Corner of the workspace a floating window can be pinned to.
When anchor is set on a FloatingWindow, the window is positioned relative to that corner using CSS right/left + top/bottom and stacks with other windows sharing the same anchor (8 px gap, uncapped). Dragging a window away from its corner clears the anchor and returns it to free-float mode. The value is RTL-aware — 'top-left' always means the logical start corner regardless of document direction.
LayoutNode
type LayoutNode = LayoutGridNode | LayoutLeafNode;Defined in: types.ts:117
Union type representing either a branch or a leaf node in the layout grid.
MenuItemAction
type MenuItemAction = () => void;Defined in: components/contextMenuTypes.ts:9
Returns
void
MessageFormatter
type MessageFormatter = (msg) => string;Defined in: types.ts:27
Function type interface responsible for resolving localizable messages to flat strings.
Parameters
| Parameter | Type |
|---|---|
msg | MessageDescriptor |
Returns
string
MessageKey
type MessageKey = keyof typeof defaultMessages;Defined in: components/predefinedMessages.ts:74
Union of every key in defaultMessages.
Import this type in your i18n message tables to get a compile-time guarantee that all keys are present and no typos exist:
import type { MessageKey } from 'react-dockable-desktop';
const myMessages: Record<MessageKey, string> = { ... };
MoveResult
type MoveResult =
| {
ok: true;
}
| {
ok: false;
reason: | "not-open"
| "owner-not-docked"
| "owner-not-kept-alive"
| "no-workspace";
};Defined in: components/panelOverlay/types.ts:183
What move() did (7.11.0). A refusal changes nothing:
not-open: no widget with that id is open in this overlay;owner-not-docked:'docked'and'tabbed'need the owner panel in the grid (a floating or minimised owner can still move a widget to'floating');owner-not-kept-alive: the owner's panel type haskeepAlive: false, so it unmounts while hidden and would take the widget with it;no-workspace: the overlay isn't in a workspace panel (noDockableDesktopProvider, or a modal or drawer), so there is nowhere to move to.
OverlayId
type OverlayId = string;Defined in: components/PanelProviderContext.tsx:10
Unique string identifier for panel/modal instances.
PanelDropTarget
type PanelDropTarget =
| {
kind: "group";
leafId: string;
position: DropPosition;
}
| {
kind: "edge";
side: SplitDirection;
}
| {
anchor: FloatAnchor | null;
kind: "float";
};Defined in: types.ts:52
Where a user is about to move a panel, as canDrop sees it (7.9.0). Positions are the ones the move applies: under RTL, a drop on the zone drawn on the screen's right is 'left'.
group: into a group, on one side (a new split) or'center'(as a tab, also between tabs);edge: along a workspace edge, as a full-width or full-height strip;float: into a floating window, pinned to a corner, or free (anchor: null, a tab dropped on nothing).
PanelMap
type PanelMap<TPanels> = TPanels & {
[panelsBrand]: true;
};Defined in: api/index.tsx:42
A panel map marked by definePanels, so createWorkspace types openPanel from it (7.10.0).
Type Declaration
| Name | Type | Defined in |
|---|---|---|
[panelsBrand] | true | api/index.tsx:42 |
Type Parameters
| Type Parameter | Default type |
|---|---|
TPanels extends Record<string, PanelDefinition> | Record<string, PanelDefinition> |
PanelPropsOf
type PanelPropsOf<TDefinition> = TDefinition extends {
component: React.ComponentType<infer P>;
} ? Omit<P, "panelId"> : never;Defined in: api/index.tsx:45
The props openPanel passes to a registered panel: its component's props, without panelId.
Type Parameters
| Type Parameter |
|---|
TDefinition |
PanelState
type PanelState = PanelInfo["state"];Defined in: api/index.tsx:109
The state of a workspace panel: where it is.
PanelTitle
type PanelTitle =
| string
| PanelTitleDescriptor
| (() => string);Defined in: components/PanelProviderContext.tsx:30
A panel, window, drawer or modal title: a plain string, a localizable descriptor, or (7.4.0) a function returning the text — called each time the title is rendered, so a title built with the app's own translation function follows a language change. A function title is not saved in a layout: a restored panel takes its registered default title.
PopOutResult
type PopOutResult =
| {
ok: true;
}
| {
ok: false;
reason: | "disabled"
| "not-open"
| "not-allowed"
| "no-gesture"
| "blocked"
| "no-window";
};Defined in: types.ts:226
What workspace.popOutPanel(id) did (7.12.0): { ok: true } when its window opened (or was already open; the panel moves in at once, or once popoutUrl has loaded), otherwise why not, checked in this order:
'disabled': the workspace was created withoutpopOut: true;'not-open': no open panel has this id;'not-allowed': the panel's type has nocanPopOut(for a widget's panel, the widget's rules decide);- (a panel already out stops here: its window comes forward,
{ ok: true }); 'no-gesture': the call did not come from a user's activation (a click or key press, or soon after one), so no window may open;'no-window': no<DockableDesktopProvider>is mounted to show it;'blocked': the browser's pop-up blocker refused the window;'no-window': the window closed or could not be used before the panel moved in;'not-allowed': a widget that could not leave its panel after all (its window closes again).
The panel stays where it was on every refusal.
RddContextMenuProps
type RddContextMenuProps = ContextMenuProps & {
adapter?: ContextMenuAdapter;
children?: React.ReactNode;
};Defined in: api/index.tsx:381
Props for RddContextMenu.
Type Declaration
| Name | Type | Description | Defined in |
|---|---|---|---|
adapter? | ContextMenuAdapter | With children: the context-menu implementation for them. Default the built-in menu | api/index.tsx:383 |
children? | React.ReactNode | With children, RddContextMenu provides a context menu to them (useContextMenu() inside shows it) — for a surface outside <DockableDesktopProvider>, or to override the menu for a subtree. Without children, it is a single menu you drive through its ref. | api/index.tsx:389 |
RddSecondarySidebarProps
type RddSecondarySidebarProps = Omit<RddSidebarProps, "position" | "isSecondary">;Defined in: components/Sidebar.tsx:783
Props for RddSecondarySidebar — identical to RddSidebarProps except position (always the opposite of whatever primary Sidebar it's nested inside) and isSecondary (always true) are not settable.
ResizeDir
type ResizeDir = "n" | "ne" | "e" | "se" | "s" | "sw" | "w" | "nw";Defined in: components/dragResize.ts:80
SidebarHeaderAction
type SidebarHeaderAction =
| SidebarActionButton
| SidebarCustomEntry;Defined in: components/Sidebar.tsx:99
A single, non-toggling action button shown above the tab strip (e.g. a hamburger menu). Unlike SidebarTab, it never affects activeTabId or the drawer — the library only renders it and forwards the click; what happens next (opening a side panel, a modal, anything else) is entirely up to the consumer.
SidebarRailEntry
type SidebarRailEntry =
| SidebarTab
| SidebarActionButton
| SidebarCustomEntry;Defined in: components/Sidebar.tsx:107
A single entry inside RddSidebarProps.headerAction/footerAction when used as an array: either a non-toggling action button/custom render (see SidebarHeaderAction), or a real SidebarTab that behaves exactly like a main-list tab — it mounts, activates, and closes through the same lifecycle, so e.g. a "Settings" entry pinned to the footer can expand like any other tab.
SplitDirection
type SplitDirection = "left" | "right" | "top" | "bottom";Defined in: types.ts:33
The four cardinal directions a panel can be docked relative to another.
SplitOrientation
type SplitOrientation = "horizontal" | "vertical";Defined in: types.ts:30
Orientation modifier indicating split directions.
Stretch
type Stretch = "width" | "height" | "both";Defined in: components/panelOverlay/types.ts:29
Which of a docked widget's axes span the host panel instead of carrying a fixed size.
A docked widget normally pins one end of each axis and carries an explicit size. A stretched axis pins both ends and carries no size at all, so the widget tracks the panel as it resizes — with no ResizeObserver and no JS, because CSS already does exactly this.
'width'— spans the panel's inline axis; height still fixed. A status or timeline strip.'height'— spans the block axis; width still fixed. A full-height side column.'both'— fills the panel, the inner-widget equivalent of maximizing a floating window.
TaskbarVisibility
type TaskbarVisibility = "always" | "compact" | "autohide";Defined in: components/WindowManager.tsx:49
Controls when the minimized-panel taskbar is visible.
ToastPosition
type ToastPosition = "top-left" | "top-right" | "bottom-left" | "bottom-right";Defined in: components/Toast.tsx:16
Corner position of the <RddToasts> relative to the viewport.
ToastType
type ToastType = "info" | "success" | "warning" | "error";Defined in: components/Toast.tsx:13
Visual type of a toast notification. Determines the icon and accent color.
ToolbarGroupEntry
type ToolbarGroupEntry =
| ToolbarGroupSubItem
| {
type: "separator";
};Defined in: components/Toolbar.tsx:100
An entry inside a group flyout — either a sub-item or a separator.
ToolbarItem
type ToolbarItem =
| ToolbarActionItem
| ToolbarRadioItem
| ToolbarToggleItem
| ToolbarGroupItem
| ToolbarSeparator;Defined in: components/Toolbar.tsx:136
ToolbarPosition
type ToolbarPosition = "top" | "bottom" | "left" | "right";Defined in: components/panelOverlay/types.ts:16
Edge of a panel to which a PanelToolbar attaches.
ToolbarVariant
type ToolbarVariant = "transparent" | "frosted" | "solid";Defined in: components/panelOverlay/PanelToolbar.tsx:13
Background style of a PanelToolbar.
WidgetLocation
type WidgetLocation = "panel" | "docked" | "tabbed" | "floating" | "minimized";Defined in: components/panelOverlay/types.ts:158
Where a managed widget is shown (7.11.0). 'panel' is inside its owner panel, as a floating widget; the others are a workspace panel of its own, beside its owner ('docked'), a tab in its owner's group ('tabbed'), a floating window ('floating'), or minimised to the taskbar.
WidgetPlacement
type WidgetPlacement = {
v: 1;
} & Record<string, unknown>;Defined in: components/panelOverlay/types.ts:129
Where a managed widget is, as plain JSON (7.11.0): from useFloatingWidgets().placement(id), back to open(id, { placement }). Opaque: store it as it is (JSON-serialisable) and don't read its fields; they may change between versions, and v says which. The same in the Vue and Angular editions (vue-dockable-desktop, angular-dockable-desktop).
Type Declaration
| Name | Type | Defined in |
|---|---|---|
v | 1 | components/panelOverlay/types.ts:129 |
WidgetTarget
type WidgetTarget =
| {
to: "panel";
}
| {
position: "left" | "right" | "top" | "bottom";
size?: number;
to: "docked";
}
| {
to: "tabbed";
}
| {
rect?: {
height: number;
width: number;
x: number;
y: number;
};
to: "floating";
};Defined in: components/panelOverlay/types.ts:167
Where to move a managed widget with useFloatingWidgets().move() (7.11.0). Its owner panel is always the reference: 'docked' splits the owner's group on that side (size is the new panel's share, 0.1–0.9, as in openPanel's dockTo), 'tabbed' adds a tab to the owner's group. 'floating' opens a floating window at rect (workspace pixels), or, without one, where the widget is on screen, at its size. 'panel' brings it back to where it last was inside the panel.
Variables
defaultMessages
const defaultMessages: {
alertTitle: {
defaultMessage: "Information";
id: "dockable-desktop-alertTitle";
};
backIntoPanel: {
defaultMessage: "Back into the panel";
id: "dockable-desktop-backIntoPanel";
};
cancel: {
defaultMessage: "Cancel";
id: "dockable-desktop-cancel";
};
close: {
defaultMessage: "Close";
id: "dockable-desktop-close";
};
closeEmptyGroup: {
defaultMessage: "Close empty split group";
id: "dockable-desktop-closeEmptyGroup";
};
closeNotification: {
defaultMessage: "Close notification";
id: "dockable-desktop-closeNotification";
};
closePanel: {
defaultMessage: "Close Panel";
id: "dockable-desktop-closePanel";
};
closePanelTooltip: {
defaultMessage: "Close panel";
id: "dockable-desktop-closePanelTooltip";
};
closeSearch: {
defaultMessage: "Close search";
id: "dockable-desktop-closeSearch";
};
closeTab: {
defaultMessage: "Close Tab";
id: "dockable-desktop-closeTab";
};
closeTooltip: {
defaultMessage: "Close";
id: "dockable-desktop-closeTooltip";
};
componentKey: {
defaultMessage: "Key: {key}";
id: "dockable-desktop-componentKey";
};
componentUnregistered: {
defaultMessage: "Component Unregistered";
id: "dockable-desktop-componentUnregistered";
};
discardChanges: {
defaultMessage: "Discard Changes";
id: "dockable-desktop-discardChanges";
};
dockWindow: {
defaultMessage: "Dock Window";
id: "dockable-desktop-dockWindow";
};
emptyGrid: {
defaultMessage: "Grid Empty";
id: "dockable-desktop-emptyGrid";
};
emptyGroup: {
defaultMessage: "Empty Workspace Section";
id: "dockable-desktop-emptyGroup";
};
floatWindow: {
defaultMessage: "Float Window";
id: "dockable-desktop-floatWindow";
};
inOwnWindow: {
defaultMessage: "in its own window";
id: "dockable-desktop-inOwnWindow";
};
maximize: {
defaultMessage: "Maximize";
id: "dockable-desktop-maximize";
};
maximizePanel: {
defaultMessage: "Maximize Panel";
id: "dockable-desktop-maximizePanel";
};
minimize: {
defaultMessage: "Minimize";
id: "dockable-desktop-minimize";
};
minimizePanel: {
defaultMessage: "Minimize Panel";
id: "dockable-desktop-minimizePanel";
};
modalTitle: {
defaultMessage: "Confirmation";
id: "dockable-desktop-modalTitle";
};
moreActions: {
defaultMessage: "More actions";
id: "dockable-desktop-moreActions";
};
no: {
defaultMessage: "No";
id: "dockable-desktop-no";
};
notifications: {
defaultMessage: "Notifications";
id: "dockable-desktop-notifications";
};
ok: {
defaultMessage: "OK";
id: "dockable-desktop-ok";
};
popOutBlocked: {
defaultMessage: "The browser blocked the new window. Allow pop-ups for this site and try again.";
id: "dockable-desktop-popOutBlocked";
};
popOutWindow: {
defaultMessage: "Open in new window";
id: "dockable-desktop-popOutWindow";
};
restorePanel: {
defaultMessage: "Restore Panel";
id: "dockable-desktop-restorePanel";
};
restoreSize: {
defaultMessage: "Restore Size";
id: "dockable-desktop-restoreSize";
};
returnToDesktop: {
defaultMessage: "Return to desktop";
id: "dockable-desktop-returnToDesktop";
};
scrollTabsLeft: {
defaultMessage: "Scroll tabs left";
id: "dockable-desktop-scrollTabsLeft";
};
scrollTabsRight: {
defaultMessage: "Scroll tabs right";
id: "dockable-desktop-scrollTabsRight";
};
scrollTaskbarLeft: {
defaultMessage: "Scroll taskbar left";
id: "dockable-desktop-scrollTaskbarLeft";
};
scrollTaskbarRight: {
defaultMessage: "Scroll taskbar right";
id: "dockable-desktop-scrollTaskbarRight";
};
search: {
defaultMessage: "Search";
id: "dockable-desktop-search";
};
searchPlaceholder: {
defaultMessage: "Search…";
id: "dockable-desktop-searchPlaceholder";
};
unsavedChangesMessage: {
defaultMessage: "\"{title}\" has unsaved changes. Do you want to discard your changes and close?";
id: "dockable-desktop-unsavedChangesMessage";
};
unsavedChangesTitle: {
defaultMessage: "Unsaved Changes";
id: "dockable-desktop-unsavedChangesTitle";
};
untitledPanel: {
defaultMessage: "Panel";
id: "dockable-desktop-untitledPanel";
};
yes: {
defaultMessage: "Yes";
id: "dockable-desktop-yes";
};
};Defined in: components/predefinedMessages.ts:13
Type Declaration
| Name | Type | Default value | Defined in |
|---|---|---|---|
alertTitle | { defaultMessage: "Information"; id: "dockable-desktop-alertTitle"; } | - | components/predefinedMessages.ts:48 |
alertTitle.defaultMessage | "Information" | 'Information' | components/predefinedMessages.ts:48 |
alertTitle.id | "dockable-desktop-alertTitle" | 'dockable-desktop-alertTitle' | components/predefinedMessages.ts:48 |
backIntoPanel | { defaultMessage: "Back into the panel"; id: "dockable-desktop-backIntoPanel"; } | - | components/predefinedMessages.ts:60 |
backIntoPanel.defaultMessage | "Back into the panel" | 'Back into the panel' | components/predefinedMessages.ts:60 |
backIntoPanel.id | "dockable-desktop-backIntoPanel" | 'dockable-desktop-backIntoPanel' | components/predefinedMessages.ts:60 |
cancel | { defaultMessage: "Cancel"; id: "dockable-desktop-cancel"; } | - | components/predefinedMessages.ts:29 |
cancel.defaultMessage | "Cancel" | 'Cancel' | components/predefinedMessages.ts:29 |
cancel.id | "dockable-desktop-cancel" | 'dockable-desktop-cancel' | components/predefinedMessages.ts:29 |
close | { defaultMessage: "Close"; id: "dockable-desktop-close"; } | - | components/predefinedMessages.ts:24 |
close.defaultMessage | "Close" | 'Close' | components/predefinedMessages.ts:24 |
close.id | "dockable-desktop-close" | 'dockable-desktop-close' | components/predefinedMessages.ts:24 |
closeEmptyGroup | { defaultMessage: "Close empty split group"; id: "dockable-desktop-closeEmptyGroup"; } | - | components/predefinedMessages.ts:25 |
closeEmptyGroup.defaultMessage | "Close empty split group" | 'Close empty split group' | components/predefinedMessages.ts:25 |
closeEmptyGroup.id | "dockable-desktop-closeEmptyGroup" | 'dockable-desktop-closeEmptyGroup' | components/predefinedMessages.ts:25 |
closeNotification | { defaultMessage: "Close notification"; id: "dockable-desktop-closeNotification"; } | - | components/predefinedMessages.ts:37 |
closeNotification.defaultMessage | "Close notification" | 'Close notification' | components/predefinedMessages.ts:37 |
closeNotification.id | "dockable-desktop-closeNotification" | 'dockable-desktop-closeNotification' | components/predefinedMessages.ts:37 |
closePanel | { defaultMessage: "Close Panel"; id: "dockable-desktop-closePanel"; } | - | components/predefinedMessages.ts:19 |
closePanel.defaultMessage | "Close Panel" | 'Close Panel' | components/predefinedMessages.ts:19 |
closePanel.id | "dockable-desktop-closePanel" | 'dockable-desktop-closePanel' | components/predefinedMessages.ts:19 |
closePanelTooltip | { defaultMessage: "Close panel"; id: "dockable-desktop-closePanelTooltip"; } | - | components/predefinedMessages.ts:33 |
closePanelTooltip.defaultMessage | "Close panel" | 'Close panel' | components/predefinedMessages.ts:33 |
closePanelTooltip.id | "dockable-desktop-closePanelTooltip" | 'dockable-desktop-closePanelTooltip' | components/predefinedMessages.ts:33 |
closeSearch | { defaultMessage: "Close search"; id: "dockable-desktop-closeSearch"; } | - | components/predefinedMessages.ts:44 |
closeSearch.defaultMessage | "Close search" | 'Close search' | components/predefinedMessages.ts:44 |
closeSearch.id | "dockable-desktop-closeSearch" | 'dockable-desktop-closeSearch' | components/predefinedMessages.ts:44 |
closeTab | { defaultMessage: "Close Tab"; id: "dockable-desktop-closeTab"; } | - | components/predefinedMessages.ts:16 |
closeTab.defaultMessage | "Close Tab" | 'Close Tab' | components/predefinedMessages.ts:16 |
closeTab.id | "dockable-desktop-closeTab" | 'dockable-desktop-closeTab' | components/predefinedMessages.ts:16 |
closeTooltip | { defaultMessage: "Close"; id: "dockable-desktop-closeTooltip"; } | - | components/predefinedMessages.ts:34 |
closeTooltip.defaultMessage | "Close" | 'Close' | components/predefinedMessages.ts:34 |
closeTooltip.id | "dockable-desktop-closeTooltip" | 'dockable-desktop-closeTooltip' | components/predefinedMessages.ts:34 |
componentKey | { defaultMessage: "Key: {key}"; id: "dockable-desktop-componentKey"; } | - | components/predefinedMessages.ts:52 |
componentKey.defaultMessage | "Key: {key}" | 'Key: {key}' | components/predefinedMessages.ts:52 |
componentKey.id | "dockable-desktop-componentKey" | 'dockable-desktop-componentKey' | components/predefinedMessages.ts:52 |
componentUnregistered | { defaultMessage: "Component Unregistered"; id: "dockable-desktop-componentUnregistered"; } | - | components/predefinedMessages.ts:51 |
componentUnregistered.defaultMessage | "Component Unregistered" | 'Component Unregistered' | components/predefinedMessages.ts:51 |
componentUnregistered.id | "dockable-desktop-componentUnregistered" | 'dockable-desktop-componentUnregistered' | components/predefinedMessages.ts:51 |
discardChanges | { defaultMessage: "Discard Changes"; id: "dockable-desktop-discardChanges"; } | - | components/predefinedMessages.ts:28 |
discardChanges.defaultMessage | "Discard Changes" | 'Discard Changes' | components/predefinedMessages.ts:28 |
discardChanges.id | "dockable-desktop-discardChanges" | 'dockable-desktop-discardChanges' | components/predefinedMessages.ts:28 |
dockWindow | { defaultMessage: "Dock Window"; id: "dockable-desktop-dockWindow"; } | - | components/predefinedMessages.ts:20 |
dockWindow.defaultMessage | "Dock Window" | 'Dock Window' | components/predefinedMessages.ts:20 |
dockWindow.id | "dockable-desktop-dockWindow" | 'dockable-desktop-dockWindow' | components/predefinedMessages.ts:20 |
emptyGrid | { defaultMessage: "Grid Empty"; id: "dockable-desktop-emptyGrid"; } | - | components/predefinedMessages.ts:50 |
emptyGrid.defaultMessage | "Grid Empty" | 'Grid Empty' | components/predefinedMessages.ts:50 |
emptyGrid.id | "dockable-desktop-emptyGrid" | 'dockable-desktop-emptyGrid' | components/predefinedMessages.ts:50 |
emptyGroup | { defaultMessage: "Empty Workspace Section"; id: "dockable-desktop-emptyGroup"; } | - | components/predefinedMessages.ts:49 |
emptyGroup.defaultMessage | "Empty Workspace Section" | 'Empty Workspace Section' | components/predefinedMessages.ts:49 |
emptyGroup.id | "dockable-desktop-emptyGroup" | 'dockable-desktop-emptyGroup' | components/predefinedMessages.ts:49 |
floatWindow | { defaultMessage: "Float Window"; id: "dockable-desktop-floatWindow"; } | - | components/predefinedMessages.ts:14 |
floatWindow.defaultMessage | "Float Window" | 'Float Window' | components/predefinedMessages.ts:14 |
floatWindow.id | "dockable-desktop-floatWindow" | 'dockable-desktop-floatWindow' | components/predefinedMessages.ts:14 |
inOwnWindow | { defaultMessage: "in its own window"; id: "dockable-desktop-inOwnWindow"; } | - | components/predefinedMessages.ts:58 |
inOwnWindow.defaultMessage | "in its own window" | 'in its own window' | components/predefinedMessages.ts:58 |
inOwnWindow.id | "dockable-desktop-inOwnWindow" | 'dockable-desktop-inOwnWindow' | components/predefinedMessages.ts:58 |
maximize | { defaultMessage: "Maximize"; id: "dockable-desktop-maximize"; } | - | components/predefinedMessages.ts:22 |
maximize.defaultMessage | "Maximize" | 'Maximize' | components/predefinedMessages.ts:22 |
maximize.id | "dockable-desktop-maximize" | 'dockable-desktop-maximize' | components/predefinedMessages.ts:22 |
maximizePanel | { defaultMessage: "Maximize Panel"; id: "dockable-desktop-maximizePanel"; } | - | components/predefinedMessages.ts:18 |
maximizePanel.defaultMessage | "Maximize Panel" | 'Maximize Panel' | components/predefinedMessages.ts:18 |
maximizePanel.id | "dockable-desktop-maximizePanel" | 'dockable-desktop-maximizePanel' | components/predefinedMessages.ts:18 |
minimize | { defaultMessage: "Minimize"; id: "dockable-desktop-minimize"; } | - | components/predefinedMessages.ts:21 |
minimize.defaultMessage | "Minimize" | 'Minimize' | components/predefinedMessages.ts:21 |
minimize.id | "dockable-desktop-minimize" | 'dockable-desktop-minimize' | components/predefinedMessages.ts:21 |
minimizePanel | { defaultMessage: "Minimize Panel"; id: "dockable-desktop-minimizePanel"; } | - | components/predefinedMessages.ts:15 |
minimizePanel.defaultMessage | "Minimize Panel" | 'Minimize Panel' | components/predefinedMessages.ts:15 |
minimizePanel.id | "dockable-desktop-minimizePanel" | 'dockable-desktop-minimizePanel' | components/predefinedMessages.ts:15 |
modalTitle | { defaultMessage: "Confirmation"; id: "dockable-desktop-modalTitle"; } | - | components/predefinedMessages.ts:46 |
modalTitle.defaultMessage | "Confirmation" | 'Confirmation' | components/predefinedMessages.ts:46 |
modalTitle.id | "dockable-desktop-modalTitle" | 'dockable-desktop-modalTitle' | components/predefinedMessages.ts:46 |
moreActions | { defaultMessage: "More actions"; id: "dockable-desktop-moreActions"; } | - | components/predefinedMessages.ts:42 |
moreActions.defaultMessage | "More actions" | 'More actions' | components/predefinedMessages.ts:42 |
moreActions.id | "dockable-desktop-moreActions" | 'dockable-desktop-moreActions' | components/predefinedMessages.ts:42 |
no | { defaultMessage: "No"; id: "dockable-desktop-no"; } | - | components/predefinedMessages.ts:31 |
no.defaultMessage | "No" | 'No' | components/predefinedMessages.ts:31 |
no.id | "dockable-desktop-no" | 'dockable-desktop-no' | components/predefinedMessages.ts:31 |
notifications | { defaultMessage: "Notifications"; id: "dockable-desktop-notifications"; } | - | components/predefinedMessages.ts:36 |
notifications.defaultMessage | "Notifications" | 'Notifications' | components/predefinedMessages.ts:36 |
notifications.id | "dockable-desktop-notifications" | 'dockable-desktop-notifications' | components/predefinedMessages.ts:36 |
ok | { defaultMessage: "OK"; id: "dockable-desktop-ok"; } | - | components/predefinedMessages.ts:32 |
ok.defaultMessage | "OK" | 'OK' | components/predefinedMessages.ts:32 |
ok.id | "dockable-desktop-ok" | 'dockable-desktop-ok' | components/predefinedMessages.ts:32 |
popOutBlocked | { defaultMessage: "The browser blocked the new window. Allow pop-ups for this site and try again."; id: "dockable-desktop-popOutBlocked"; } | - | components/predefinedMessages.ts:61 |
popOutBlocked.defaultMessage | "The browser blocked the new window. Allow pop-ups for this site and try again." | 'The browser blocked the new window. Allow pop-ups for this site and try again.' | components/predefinedMessages.ts:61 |
popOutBlocked.id | "dockable-desktop-popOutBlocked" | 'dockable-desktop-popOutBlocked' | components/predefinedMessages.ts:61 |
popOutWindow | { defaultMessage: "Open in new window"; id: "dockable-desktop-popOutWindow"; } | - | components/predefinedMessages.ts:55 |
popOutWindow.defaultMessage | "Open in new window" | 'Open in new window' | components/predefinedMessages.ts:55 |
popOutWindow.id | "dockable-desktop-popOutWindow" | 'dockable-desktop-popOutWindow' | components/predefinedMessages.ts:55 |
restorePanel | { defaultMessage: "Restore Panel"; id: "dockable-desktop-restorePanel"; } | - | components/predefinedMessages.ts:17 |
restorePanel.defaultMessage | "Restore Panel" | 'Restore Panel' | components/predefinedMessages.ts:17 |
restorePanel.id | "dockable-desktop-restorePanel" | 'dockable-desktop-restorePanel' | components/predefinedMessages.ts:17 |
restoreSize | { defaultMessage: "Restore Size"; id: "dockable-desktop-restoreSize"; } | - | components/predefinedMessages.ts:23 |
restoreSize.defaultMessage | "Restore Size" | 'Restore Size' | components/predefinedMessages.ts:23 |
restoreSize.id | "dockable-desktop-restoreSize" | 'dockable-desktop-restoreSize' | components/predefinedMessages.ts:23 |
returnToDesktop | { defaultMessage: "Return to desktop"; id: "dockable-desktop-returnToDesktop"; } | - | components/predefinedMessages.ts:56 |
returnToDesktop.defaultMessage | "Return to desktop" | 'Return to desktop' | components/predefinedMessages.ts:56 |
returnToDesktop.id | "dockable-desktop-returnToDesktop" | 'dockable-desktop-returnToDesktop' | components/predefinedMessages.ts:56 |
scrollTabsLeft | { defaultMessage: "Scroll tabs left"; id: "dockable-desktop-scrollTabsLeft"; } | - | components/predefinedMessages.ts:38 |
scrollTabsLeft.defaultMessage | "Scroll tabs left" | 'Scroll tabs left' | components/predefinedMessages.ts:38 |
scrollTabsLeft.id | "dockable-desktop-scrollTabsLeft" | 'dockable-desktop-scrollTabsLeft' | components/predefinedMessages.ts:38 |
scrollTabsRight | { defaultMessage: "Scroll tabs right"; id: "dockable-desktop-scrollTabsRight"; } | - | components/predefinedMessages.ts:39 |
scrollTabsRight.defaultMessage | "Scroll tabs right" | 'Scroll tabs right' | components/predefinedMessages.ts:39 |
scrollTabsRight.id | "dockable-desktop-scrollTabsRight" | 'dockable-desktop-scrollTabsRight' | components/predefinedMessages.ts:39 |
scrollTaskbarLeft | { defaultMessage: "Scroll taskbar left"; id: "dockable-desktop-scrollTaskbarLeft"; } | - | components/predefinedMessages.ts:40 |
scrollTaskbarLeft.defaultMessage | "Scroll taskbar left" | 'Scroll taskbar left' | components/predefinedMessages.ts:40 |
scrollTaskbarLeft.id | "dockable-desktop-scrollTaskbarLeft" | 'dockable-desktop-scrollTaskbarLeft' | components/predefinedMessages.ts:40 |
scrollTaskbarRight | { defaultMessage: "Scroll taskbar right"; id: "dockable-desktop-scrollTaskbarRight"; } | - | components/predefinedMessages.ts:41 |
scrollTaskbarRight.defaultMessage | "Scroll taskbar right" | 'Scroll taskbar right' | components/predefinedMessages.ts:41 |
scrollTaskbarRight.id | "dockable-desktop-scrollTaskbarRight" | 'dockable-desktop-scrollTaskbarRight' | components/predefinedMessages.ts:41 |
search | { defaultMessage: "Search"; id: "dockable-desktop-search"; } | - | components/predefinedMessages.ts:43 |
search.defaultMessage | "Search" | 'Search' | components/predefinedMessages.ts:43 |
search.id | "dockable-desktop-search" | 'dockable-desktop-search' | components/predefinedMessages.ts:43 |
searchPlaceholder | { defaultMessage: "Search…"; id: "dockable-desktop-searchPlaceholder"; } | - | components/predefinedMessages.ts:45 |
searchPlaceholder.defaultMessage | "Search…" | 'Search…' | components/predefinedMessages.ts:45 |
searchPlaceholder.id | "dockable-desktop-searchPlaceholder" | 'dockable-desktop-searchPlaceholder' | components/predefinedMessages.ts:45 |
unsavedChangesMessage | { defaultMessage: ""{title}" has unsaved changes. Do you want to discard your changes and close?"; id: "dockable-desktop-unsavedChangesMessage"; } | - | components/predefinedMessages.ts:27 |
unsavedChangesMessage.defaultMessage | ""{title}" has unsaved changes. Do you want to discard your changes and close?" | '"{title}" has unsaved changes. Do you want to discard your changes and close?' | components/predefinedMessages.ts:27 |
unsavedChangesMessage.id | "dockable-desktop-unsavedChangesMessage" | 'dockable-desktop-unsavedChangesMessage' | components/predefinedMessages.ts:27 |
unsavedChangesTitle | { defaultMessage: "Unsaved Changes"; id: "dockable-desktop-unsavedChangesTitle"; } | - | components/predefinedMessages.ts:26 |
unsavedChangesTitle.defaultMessage | "Unsaved Changes" | 'Unsaved Changes' | components/predefinedMessages.ts:26 |
unsavedChangesTitle.id | "dockable-desktop-unsavedChangesTitle" | 'dockable-desktop-unsavedChangesTitle' | components/predefinedMessages.ts:26 |
untitledPanel | { defaultMessage: "Panel"; id: "dockable-desktop-untitledPanel"; } | - | components/predefinedMessages.ts:53 |
untitledPanel.defaultMessage | "Panel" | 'Panel' | components/predefinedMessages.ts:53 |
untitledPanel.id | "dockable-desktop-untitledPanel" | 'dockable-desktop-untitledPanel' | components/predefinedMessages.ts:53 |
yes | { defaultMessage: "Yes"; id: "dockable-desktop-yes"; } | - | components/predefinedMessages.ts:30 |
yes.defaultMessage | "Yes" | 'Yes' | components/predefinedMessages.ts:30 |
yes.id | "dockable-desktop-yes" | 'dockable-desktop-yes' | components/predefinedMessages.ts:30 |
File
predefinedMessages.ts
Description
Provides the default localizable message catalogs and translation keys utilized by Dockable Desktop's context menus, headers, and tooltips.
Each value's id is the react-intl message ID that the consumer should define in their IntlProvider messages table. The defaultMessage is used as a fallback when no external formatter is provided.
Pass a partial or full override as createWorkspace({ messages }) or <DockableDesktopProvider messages={…}> to customise labels without replacing the whole table.
DockableDesktopProvider
const DockableDesktopProvider: React.FC<DockableDesktopProviderProps>;Defined in: components/DockableDesktopProvider.tsx:103
The one provider. Place it above everything from this library: <RddDesktop>, <RddSidebar>, <RddToolbar>, <RddSidePanels>, <RddModals>.
Example
const workspace = createWorkspace({ panels: { map: { component: MapPanel } } });
<DockableDesktopProvider workspace={workspace}>
<RddSidebar tabs={tabs}>
<RddDesktop />
</RddSidebar>
<RddSidePanels />
<RddModals />
</DockableDesktopProvider>RddAlert
const RddAlert: React.FC<RddAlertProps>;Defined in: forms/AlertForm.tsx:38
RddAlert shows a message with a single OK button. Open it with useModals().open or useModals().alert().
RddConfirm
const RddConfirm: React.FC<RddConfirmProps>;Defined in: forms/ConfirmationForm.tsx:43
RddConfirm component renders a standard dialog content layout, allowing users to confirm actions or abort them. Exposes action callbacks.
RddContextMenu
const RddContextMenu: React.ForwardRefExoticComponent<RddContextMenuProps & React.RefAttributes<ContextMenuHandle>>;Defined in: api/index.tsx:396
A context menu. Inside <DockableDesktopProvider> one is already provided — use useContextMenu() or showContextMenu() and you need no RddContextMenu at all.
RddDesktop
const RddDesktop: React.FC<RddDesktopProps>;Defined in: components/WindowManager.tsx:100
The desktop itself: the docked grid of tab groups, the floating windows, the taskbar of minimized panels, and the drop targets while a panel is dragged. Render it inside <DockableDesktopProvider>, in a container that gives it a size (rdd-fill-viewport fills the page), and import react-dockable-desktop/styles.css once.
Exported as RddDesktop.
Example
<DockableDesktopProvider workspace={workspace}>
<div className="rdd-fill-viewport">
<RddDesktop skin="vscode" taskbarVisibility="autohide" />
</div>
<RddModals />
</DockableDesktopProvider>RddModals
const RddModals: React.FC;Defined in: components/ModalStackRenderer.tsx:159
Renders the modals opened through useModals(), stacked, topmost last. Mount one, inside <DockableDesktopProvider>.
RddSecondarySidebar
const RddSecondarySidebar: React.ForwardRefExoticComponent<RddSecondarySidebarProps & React.RefAttributes<SidebarHandle>>;Defined in: components/Sidebar.tsx:795
A second, independent Sidebar instance for the opposite edge of the screen — same component, same behavior, zero forked code. Must be rendered inside a primary Sidebar's children; automatically takes whichever side that primary isn't using, so the side is never specified directly.
Throws
Error if rendered without an ancestor Sidebar, or nested inside another RddSecondarySidebar — this library supports exactly one primary and one secondary, nothing deeper.
RddSidebar
const RddSidebar: React.ForwardRefExoticComponent<RddSidebarProps & React.RefAttributes<SidebarHandle>>;Defined in: components/Sidebar.tsx:465
RddToolbar
const RddToolbar: React.ForwardRefExoticComponent<RddToolbarProps & React.RefAttributes<ToolbarHandle>>;Defined in: components/Toolbar.tsx:456
toast
const toast: ToastFunction;Defined in: components/Toast.tsx:215
Imperative notification singleton. Call from anywhere — inside or outside React. Mount <RddToasts> once at your app root to activate the renderer.
Example
toast.success('File saved.');
toast.error('Upload failed.', { duration: 0 }); // sticky
toast.promise(saveFile(), { pending: 'Saving…', success: 'Saved!', error: 'Failed.' });