Desk Window

@sushindustries/ui

A window you can drag, resize, close and stack, without re-rendering its contents every frame.

6 min read
View as MarkdownEdit on GitHub

Props

PropTypeDefaultDoes
titleReactNode-
childrenReactNode-
xnumber-Left edge in pixels within the desk. Clamped so 80px always stays reachable.
ynumber-Top edge in pixels within the desk. Clamped so the title bar cannot leave it.
znumber-Stacking order, applied as zIndex. The desk decides which window is highest.
w?number-Set once resized. Absent uses the CSS default.
h?number-Set once resized, never below 160. Absent uses the CSS default.
label?string-

Notes

onResize doubles as the flag for whether resizing is offered at all: leave it unset and no resize corner renders, w and h are then read from CSS defaults, and the window can only be moved. Pass it to get both the corner and the 240×160 minimum enforced during the drag.

x and y are clamped during the drag to keep the title bar reachable, but that clamp is relative to the window's own parent at drag time - resizing the parent after mounting does not retroactively pull an off-screen window back in.

UsesIconIconThe glyph set, generated from a Markdown table where every drawing carries its reason. One component, typed names, no icon font.@sushindustries/ui · content
Used byFolder ShelfFolder ShelfA desktop of folders that open into draggable windows, several at once, remembered between visits.@sushindustries/ui · layout