Contents

Panels · Components

Window

A window that drags, resizes, folds, maximizes and tiles, and works from the keyboard.

$ pnpm dlx shadcn@latest add @nynxz/window

Usage

A Window renders the workspace window with the same id. It must sit inside a <Desktop>, which it's positioned against.

<Desktop className="h-96">
  <Window id="notes" icon={<NoteIcon />}>
    <Notes />
  </Window>
</Desktop>

Most apps don't render windows by hand: <AppWindows /> (see Desktop) renders one per open app.

Props

PropType
idstringthe window's id in the workspace
iconReactNodeshown before the title
actionsReactNodeextra header controls, before minimize / fold / maximize / close
featuresWindowFeaturesswitch behaviour off; see Window features
classNamestringmerged onto the window's root

Keyboard

The title bar is focusable (Tab to it). Screen readers announce these keys from its description.

KeysDoes
arrowsmove (Shift: bigger steps)
Alt + arrowsresize
Ctrl + ← / →tile on that side
Ctrl + ↑ / ↓maximize · float or minimize
Escapecancel a drag in progress

Built from

useWindowFrame(id, features) from @nynxz/react-panels does the work: geometry, gestures, focus, the drop preview and keyboard. The component is markup and classes over it, so restyle freely.