Complete interface

Elements

React UI for NodeSandbox, three ways in: Sandbox, a complete sandbox in one tag; any of its parts as a standalone component; or the shell's regions, composed the way shadcn components are.

$npm i @nodesandbox-ai/elements @nodesandbox-ai/react react react-dom

Drop in a sandbox

Import the stylesheet once at your app's entry, then render Sandbox. It brings the runtime provider and the whole shell: a sidenav with your agents, a left panel, a header, the preview and code views, and a bottom panel with the server output, a terminal, the console and the ports.

app.tsx
'use client';
import '@nodesandbox-ai/elements/styles.css';
import { Sandbox } from '@nodesandbox-ai/elements';

export default function App() {
  return (
    <Sandbox
      apiKey={import.meta.env.VITE_NODESANDBOX_API_KEY}
      source={{
        type: 'files',
        files: {
          'package.json': JSON.stringify({
            scripts: { dev: 'vite --host 0.0.0.0' },
            dependencies: { vite: '8.1.3' },
          }),
          'index.html': '<h1>Hello from NodeSandbox</h1>',
        },
      }}
      style={{ height: 640 }}
    />
  );
}

Pass a public API key whose allowed origins include the page embedding the sandbox, or hostUrl for a local or self-hosted runtime. Git and ZIP sources work too. The defaults are installCommand={['npm', ['install']]} and startCommand={['npm', ['run', 'dev']]}.

Runtime included, engine not bundled.

react and react-dom are peer dependencies. The runtime's lifecycle belongs to React, which initializes the hosted Node runtime through Client; Elements supplies UI.

Sandbox props

Besides the React provider's options (apiKey, source, plugins, projectId and the rest), Sandbox's props are grouped the way the shell's regions are:

project.tsx
<Sandbox
  apiKey={apiKey}
  source={source}
  plugins={plugins}
  theme="dark"
  logo={{ icon: <AcmeMark />, href: 'https://acme.example', label: 'Acme' }}
  sidenavItems={[
    { id: 'claude', label: 'Claude Code', icon: <ClaudeCodeIcon />, render: <SandboxTerminal command="claude" /> },
    { id: 'history', label: 'History', icon: <History />, render: <VersionHistory /> },
    { type: 'separator', position: 'bottom' },
    { id: 'account', position: 'bottom', element: <AccountMenu /> },
  ]}
  header={{ title: 'Acme storefront', titleMenu, endActions: <DeployButton />, onSave }}
  previewHeader={{ endActions: <PointerButton />, reloadItems }}
  leftPanelHeader={{ menu: [{ label: 'Clear', onSelect: clear }] }}
  bottomPanel={{ tabs: ['server', 'terminal', 'console'] }}
  attribution={false}
/>
APIBehavior
theme?: light | darkLight or dark. Terminals and compatible agent TUIs follow changes without restarting.
palette?: neutral | inheritDefault neutral pins stock grays; inherit takes the host page's tokens. See Theme and palette.
logo?: SandboxLogo | falseThe mark at the top of the sidenav, NodeSandbox's by default. { icon, href?, label }; without href it is not a link. false leaves it out.
defaultTab?: string | nullThe sidenav item whose tab is open at the start. Default the first one; null opens none, and the left panel starts on its list of what can be opened.
sidenavItems?: SandboxSidenavItem[]The sidenav, top to bottom. Without them there is no sidenav. See Sidenav and agents.
header?: SandboxHeaderOptionstitle, titleMenu, startActions, endActions and onSave. See Header.
previewHeader?: SandboxPreviewHeaderOptionsstartActions after back and forward, endActions after the mobile/desktop and fullscreen toggles, and reloadItems after Reload and Restart in the reload menu.
leftPanelHeader?: SandboxLeftPanelHeaderOptionsmenu entries come before Reload agent and Stop agent in the ⋯ menu, and endActions before the expand button and the ⋯.
newTab?: SandboxNewTabOptionsThe left panel with every tab closed: title, the items listed, or your own content. See Left panel.
bottomPanel?: { tabs }The bottom panel's tabs. See Bottom panel.
attribution?: booleanThe "Made with NodeSandbox" badge over the preview. Default true.
defaultIsMobile?: booleanDraw the phone form until the sandbox has measured its width, as on the server. Default false. See Phones.
mobile?: { agent?, preview? }The sides a phone shows, both by default. See Phones.
className?, style?On the shell's root. style may set theme tokens, such as --ring.

With a SandboxProvider of your own (a chat beside the sandbox, sharing it), render SandboxShell under it: the same shell and the same props, without the provider.

workspace.tsx
import { SandboxProvider, SandboxShell, useSandbox } from '@nodesandbox-ai/elements';

function Chat() {
  const { sandbox } = useSandbox();
  // Your agent and the shell operate on the same runtime.
  return <aside>…</aside>;
}

export function Workspace({ apiKey, source }) {
  return (
    <SandboxProvider apiKey={apiKey} source={source} theme="dark">
      <div style={{ display: 'flex', height: 640 }}>
        <Chat />
        <SandboxShell header={{ title: 'My project' }} />
      </div>
    </SandboxProvider>
  );
}

Sidenav and agents

Install the agents you want and pass their definitions to Sandbox.plugins: the plugins provide the commands, credentials and downloads. The sidenav is yours. It shows exactly the sidenavItems you pass, and registering a plugin adds no button by itself. Elements exports ClaudeCodeIcon, OpenCodeIcon, CodexIcon and PiIcon for the buttons.

Terminal
npm i @nodesandbox-ai/elements @nodesandbox-ai/react react react-dom
npm i @nodesandbox-ai/plugin-opencode @nodesandbox-ai/plugin-claude @nodesandbox-ai/plugin-codex @nodesandbox-ai/plugin-pi
agent-workspace.tsx
'use client';
import { useMemo } from 'react';
import '@nodesandbox-ai/elements/styles.css';
import {
  ClaudeCodeIcon, CodexIcon, OpenCodeIcon, PiIcon,
  Sandbox, SandboxTerminal, type SandboxProps, type SandboxSidenavItem,
} from '@nodesandbox-ai/elements';
import { opencodePlugin } from '@nodesandbox-ai/plugin-opencode';
import { claudeCodePlugin } from '@nodesandbox-ai/plugin-claude';
import { codexPlugin } from '@nodesandbox-ai/plugin-codex';
import { piPlugin } from '@nodesandbox-ai/plugin-pi';

type Props = Pick<SandboxProps, 'apiKey' | 'source' | 'theme'>;

// One button per agent, each opening a tab running its plugin's command.
const sidenavItems: SandboxSidenavItem[] = [
  { id: 'opencode', label: 'OpenCode', icon: <OpenCodeIcon />, render: <SandboxTerminal command="opencode" /> },
  { id: 'claude', label: 'Claude Code', icon: <ClaudeCodeIcon />, render: <SandboxTerminal command="claude" /> },
  { id: 'codex', label: 'Codex', icon: <CodexIcon />, render: <SandboxTerminal command="codex" /> },
  { id: 'pi', label: 'Pi', icon: <PiIcon />, render: <SandboxTerminal command="pi" /> },
];

export function AgentWorkspace({ apiKey, source, theme = 'light' }: Props) {
  const plugins = useMemo(() => [
    opencodePlugin(),
    claudeCodePlugin(),
    codexPlugin({
      codexRelayHost: 'https://codex.example.com',
      async authorizeRelay(sessionId, signal) {
        const response = await fetch('/api/codex/relay-token', {
          method: 'POST',
          headers: { 'Content-Type': 'application/json' },
          body: JSON.stringify({ sessionId }),
          signal,
        });
        if (!response.ok) throw new Error('Relay authorization failed');
        return response.json(); // { token: string }
      },
    }),
    piPlugin(),
  ], []);

  return (
    <Sandbox
      apiKey={apiKey}
      source={source}
      plugins={plugins}
      sidenavItems={sidenavItems}
      theme={theme}
      style={{ height: 640 }}
    />
  );
}

Pass your sandbox API key and project source to this component. Replace the example Codex relay origin and implement the authenticated ticket endpoint as described in the Codex guide; Codex also requires cross-origin isolation. Omit the factory, import and button for any agent you do not need.

Keep definitions stable across renders. The plugin set is fixed when a sandbox is created; create a new sandbox to change it. Configure credentials and optional HTTP proxies through the OpenCode and Claude Code factories, or use the Pi factory. All support the shared agent options. Add playwrightPlugin() to the same array and Claude Code, OpenCode and Pi can open the dev server's pages through Playwright's MCP tools; it needs no button.

APIBehavior
{ id, label, icon, render }Each click opens a new tab of the left panel showing render, and the item is in the tab bar's + menu. <SandboxTerminal command="claude" /> runs an agent plugin's command (opencode, claude, codex, pi) or any other the sandbox runs, such as bash: a new session per tab. Any other element is your own content.
{ id, label, icon, onClick }An action. onClick also runs alongside render.
{ id, element }Drawn as is: a control with its own trigger, such as an account menu. The sidenav is 48px wide.
{ type: 'separator' }A rule between items. One with nothing above or below it, or next to another, is left out.
position: 'bottom'Pins any item to the bottom of the sidenav.

The first item with render opens beside the preview when the sandbox loads. Switching tabs or hiding the panel keeps every session running; closing a tab ends its session. useSandboxTabs() gives the open tabs and addTab(item), selectTab(id) and removeTab(id). A terminal takes focus when you show it, never on first load. Elements manages terminal input, output, resizing and cleanup, so you make no terminals.create() calls.

Left panel

The left panel takes 45% of the space beside the sidenav: at least 280px, at most half the sandbox. Drag its edge, or use the arrow keys on it, to resize it; the browser remembers the size. The left panel toggle in the header closes and reopens it, returning to the last selected tab.

Its header shows the open tabs, each with its item's icon and label; hovering a tab turns its icon into a close button, and the + after them opens a new tab for any item. Its ⋯ menu has your leftPanelHeader.menu entries and, for a terminal, Reload agent, which restarts only that terminal, and Stop agent, which ends its process until you press Start. The expand button gives the left panel the whole sandbox, hiding the sidenav and the preview; the preview stays mounted, so it is as you left it when you restore the panel.

With every tab closed, the header goes and the panel lists what can be opened: by default every sidenav item with render, under "Open a new tab". newTab changes it. title replaces the heading (null leaves it out); items is the list, where { id } of a sidenav item opens its tab with its label and icon, and { id, label, icon, onClick } is your own entry; content replaces both.

new-tab.tsx
<Sandbox
  apiKey={apiKey}
  source={source}
  sidenavItems={sidenavItems}
  newTab={{
    title: 'Start a session',
    items: [
      { id: 'claude' },
      { id: 'docs', label: 'Read the docs', icon: <BookIcon />, onClick: () => window.open('/docs') },
    ],
  }}
/>

Bottom panel

The bottom panel sits under the preview, with tabs for the dev server's output, a shell terminal, the preview's console and the ports the sandbox listens on. bottomPanel.tabs picks and orders them, and adds your own:

project.tsx
<Sandbox
  apiKey={apiKey}
  source={source}
  bottomPanel={{
    tabs: [
      'server',
      'terminal',
      { id: 'deploy', label: 'Deploy', icon: <Rocket />, content: <DeployLog /> },
    ],
  }}
/>

The built-in ids are 'server', 'terminal', 'console' and 'ports', all four by default. Its bar can maximize the panel over the preview, and its top edge resizes it. Its height and whether it is open are remembered.

Code view

Code shows the Explorer beside an editor that looks and types like VS Code's: line numbers, fold chevrons, indent guides, bracket pair colours, a minimap and VS Code's find widget and key bindings. Selecting a file opens it in a tab; tabs keep their undo history and scroll position, and a dot marks unsaved changes. Search files from the Explorer header or with Ctrl/Cmd+P. With no file open, the editor offers Search files, and Toggle Terminal (Ctrl+`) when the bottom panel has a terminal. It lays out by its own width: the tree beside the editor from 48rem, a Files bar above it below that.

Edits save to the sandbox half a second after you stop typing, or at once with Ctrl/Cmd+S. A file an agent or a command changes reloads in its tab unless it has unsaved edits.

The editor is CodeMirror. It loads the first time a file opens, and each language's highlighting the first time a file of it opens, so a preview-only embed fetches neither. There are no workers to host and nothing to configure.

Phones

Below 720px of the sandbox's own width, with something in the left panel, the sandbox takes its phone form. This works for a narrow embed on a desktop page too; no prop is needed.

A top bar replaces the sidenav. Its ☰ menu lists the sidenav's buttons, the header sits beside it, and your sidenav elements (an account menu) keep their place at its end. Under it, [selected tab] | Preview tabs switch between the left panel and the preview; choosing a button in the menu opens a new tab for it, and switching views shows the preview.

Three round buttons sit centred under an agent's terminal. The first slides open the keys a TUI needs that a phone keyboard lacks: Esc, /, Backspace, Up, Down and Enter. The second shows or hides the keyboard. The third opens a prompt box over the terminal: its message is pasted into the agent and Enter is pressed. Images attached to it are written under /tmp/attachments, and their paths go into the message. A SandboxTerminal in a tab draws these buttons by itself; under any other terminal, pass <SandboxTerminalControls terminal={ref} /> as its footer.

All of it is CSS on the same tree: terminals and the preview stay mounted across tab switches and across the breakpoint, so no session restarts.

A phone cannot hold an agent and a dev server at once, so the phone form runs one at a time. Showing an agent's tab stops the dev server, which frees its memory and the preview's page, then starts that agent and stops any other. The Preview tab stops the agents and starts the server again with the same command, without reinstalling; it comes back on the page it showed. A stopped agent starts afresh the next time its tab shows. Leaving the phone form starts the server; stopped agents wait for their Start button. An agent starts only once its tab shows, never on load. A shell you compose gets the same behavior from <SandboxPhoneSwap /> inside SandboxLayout.

mobile chooses the sides: mobile={{ agent: false }} shows only the preview, with no tabs and no agents in the ☰ menu; mobile={{ preview: false }} shows only the agent, and the dev server does not run on the phone. Wider than the phone form, both sides show as usual.

The sandbox measures its width once it mounts, so the server and the first paint draw the desktop form. A host that knows it is on a phone (from the user agent, or sec-ch-ua-mobile) passes defaultIsMobile, so the first paint is already the phone form; the measured width decides after that.

page.tsx
import { headers } from 'next/headers';

export default async function Page() {
  const mobile = (await headers()).get('sec-ch-ua-mobile') === '?1';
  return <Workspace defaultIsMobile={mobile} />;
}

Theme and palette

Pass the current light/dark mode to Sandbox.theme (or SandboxProvider.theme). Elements updates terminal colours and notifies compatible running TUIs without restarting their sessions. OpenCode's default theme matches Elements, with its session sidebar and tab strip hidden; its TUI follows host changes unless the user has locked a mode inside OpenCode. To customize one instance, inject a complete theme and cli.json through opencodePlugin({ files: ... }); see the theme example. Settings, skills and MCP files belong in each plugin's files option.

palette="neutral" (the default) pins stock grays, so the sandbox looks the same on any page. palette="inherit" takes the host page's shadcn tokens (--background, --foreground, --card, --muted, --border, --ring, …) instead. Either way, tokens set in style override the palette, and menus, dialogs and tooltips, which open outside the sandbox's box, carry them too:

brand.tsx
<Sandbox
  apiKey={apiKey}
  source={source}
  // The focus ring, in your brand's colour.
  style={{ '--ring': 'oklch(0.55 0.22 263)' } as React.CSSProperties}
/>

Standalone components

Every part works on its own inside a SandboxProvider, in any box. An agent is just a terminal running its command:

split.tsx
import { SandboxProvider, SandboxTerminal, SandboxPreview } from '@nodesandbox-ai/elements';

<SandboxProvider apiKey={apiKey} source={source} plugins={plugins}>
  <div style={{ height: 400 }}><SandboxTerminal command="claude" /></div>
  <SandboxPreview />
</SandboxProvider>
APIBehavior
SandboxTerminalA terminal. command runs a program ("claude"); without it, a shell. footer draws under it. In a tab it is that tab's own session. Its ref offers restart(), stop(), write(data) and focus().
SandboxPreviewThe dev server's page, with its startup and error states over it.
SandboxPreviewURLBarThe preview's address and reload menu (reloadItems). SandboxPreviewBack and SandboxPreviewForward are its history.
SandboxIDEExplorer, editor tabs, CodeMirror and file search.
SandboxConsoleThe preview's console.
SandboxServerOutputThe dev server's output, ANSI colours included.
SandboxPortsThe ports the sandbox's servers listen on.

A component starts its expensive work (a process, a poll, a large module) only once its box has a size, so a hidden one costs nothing until it is shown. Missing data shows its empty state, and outside a provider a component is drawn and inert.

Compose the shell

Sandbox is the shell's regions with their defaults. Compose them yourself for more than props allow. A region with no children draws its default, props extend the default, and children replace it.

custom-shell.tsx
<SandboxProvider apiKey={apiKey} source={source} plugins={plugins}>
  <SandboxLayoutProvider defaultState={{ leftPanel: 'claude', leftPanelOpen: true }}>
    <SandboxLayout>
      <SandboxSidenav>
        <SandboxSidenavLogo href="/" label="Acme"><Logo /></SandboxSidenavLogo>
        <SandboxSidenavGroup>
          <SandboxSidenavTrigger panel="claude" label="Claude Code"><ClaudeCodeIcon /></SandboxSidenavTrigger>
          <SandboxSidenavTrigger panel="notes" label="Notes"><NotebookIcon /></SandboxSidenavTrigger>
        </SandboxSidenavGroup>
        <SandboxSidenavSeparator />
        <SandboxSidenavFooter>
          <ThemeToggle />
          <AccountMenu />
        </SandboxSidenavFooter>
      </SandboxSidenav>

      <SandboxLeftPanel>
        <SandboxLeftPanelHeader />
        <SandboxTerminal processId="claude" command="claude" />
        <SandboxPanel id="notes" label="Notes"><Notes /></SandboxPanel>
      </SandboxLeftPanel>

      <SandboxMain>
        <SandboxHeader title="Acme" endActions={<DeployButton />} />
        <SandboxView value="preview">
          <SandboxPreviewHeader>
            <SandboxPreviewHeaderStart>
              <SandboxPreviewBack />
              <SandboxPreviewForward />
            </SandboxPreviewHeaderStart>
            <SandboxPreviewURLBar reloadItems={[{ label: 'Clear cache', onSelect: clearCache }]} />
            <SandboxPreviewHeaderEnd>
              <SandboxMobileDesktopToggle />
              <SandboxFullscreenToggle />
              <PointerButton />
            </SandboxPreviewHeaderEnd>
          </SandboxPreviewHeader>
          <SandboxPreview />
        </SandboxView>
        <SandboxView value="code"><SandboxIDE /></SandboxView>
        <SandboxBottomPanel>
          <SandboxBottomPanelHeader endActions={<NewTerminalButton />} />
          <SandboxServerOutput />
          <SandboxTerminal processId="shell" />
          <SandboxConsole />
          <SandboxPorts />
          <SandboxPanel id="deploy" label="Deploy"><DeployLog /></SandboxPanel>
        </SandboxBottomPanel>
      </SandboxMain>
    </SandboxLayout>
  </SandboxLayoutProvider>
</SandboxProvider>

Panels. A panel region's children (SandboxLeftPanel's and SandboxBottomPanel's) are its panels: any component, or SandboxPanel with your content. Each registers its id, label and icon, and the region's tabs, the left panel's header and the sidenav triggers come from them; a SandboxSidenavTrigger opens the panel with its panel id. One panel shows at a time. The others stay mounted and hidden, so terminal sessions survive switching. Removing a child unmounts it.

Tabs. Give SandboxSidenav its items, and put SandboxTabPanels in the left panel: each click on an item with render opens a SandboxTab showing it, and SandboxLeftPanelHeader draws the tabs and the + menu. A SandboxTerminal in a tab is that tab's own session. useSandboxTabs() opens, selects and closes tabs from your own controls.

Headers. SandboxHeader, SandboxPreviewHeader, SandboxLeftPanelHeader and SandboxBottomPanelHeader take startActions and endActions beside their built-in controls, menus as data (titleMenu, reloadItems, menu), or children built from their parts.

Views. SandboxMain shows the SandboxView whose value matches the layout's view: preview, code, or one of your own. The header's toggle switches between Preview and Code.

Your own panel content. A component of yours in a region can call usePanel({ id, label, icon }, ref) to register itself and learn whether it is showing, as the built-in views do.

Layout state

SandboxLayoutProvider holds the layout: which panels are open and showing, their sizes, the view, the preview's device, fullscreen, and the phone form's pane. It is controlled (state and onStateChange) or uncontrolled (defaultState). Uncontrolled, the sizes and the bottom panel's open state persist in localStorage. SandboxLayout brings its own provider when there is none above it.

APIBehavior
tabs: { id, item }[]The left panel's open tabs, in order: each a session of the sidenav item item. Its first tab's id is the item's, then claude-2 and so on.
leftPanel: string | nullThe left panel's showing panel, or null for its first.
leftPanelOpen: booleanDefault false.
leftPanelSize: numberPercent of the space beside the sidenav. Default 45.
leftPanelExpanded: booleanThe left panel takes the whole sandbox; the sidenav and main area hide.
view: stringpreview (default), code, or your own view.
bottomPanel: string | nullThe bottom panel's showing panel, or null for its first.
bottomPanelOpen, bottomPanelExpandedWhether it is open, and whether it takes the whole main area.
bottomPanelSize: numberPixels. Default 300.
device: desktop | mobileThe size the preview is drawn at.
fullscreen: booleanThe preview takes the window.
mobilePane: left | mainIn the phone form, the tab showing.

useSandboxLayout(), anywhere under the provider, returns the state, isMobile, the showing leftPanel and bottomPanel, and actions: openLeftPanel(id), toggleLeftPanel(), setLeftPanelExpanded(), setView(), openBottomPanel(id), setBottomPanelOpen(), setDevice(), setFullscreen() and the rest. useSandboxTabs() returns the open tabs, the items a tab can be opened for, the activeTab, and addTab(item) (a new tab and session, returning its id), selectTab(id) and removeTab(id).

open-terminal.tsx
function OpenTerminalButton() {
  const layout = useSandboxLayout();
  return <Button onClick={() => layout.openBottomPanel('terminal')}>Terminal</Button>;
}

Views on another runtime

Each standalone component is a view, driven only by props, bound to a feed: an optional context the provider fills from NodeSandbox. SandboxTerminal is TerminalView on the terminal feed, SandboxPreview is PreviewFrame on the preview feed, and so on: IDEView, ConsoleView, ServerOutputView, PortsView, PreviewURLBar.

Another runtime can pass the views props directly, or fill the feeds (TerminalFeedProvider, PreviewFeedProvider, FileSystemFeedProvider, ServerOutputFeedProvider, ConsoleFeedProvider, PortsFeedProvider) so the Sandbox… components and the shell's defaults run on it. Their contracts are exported: TerminalSession, CreateTerminalSession, StreamChunk, ConsoleEntry, PortEntry, PreviewNavigation and FileSystem.

my-terminal.tsx
import { TerminalView, type CreateTerminalSession } from '@nodesandbox-ai/elements';

// Called at the view's first visible size. Keep it stable: a new function starts a new session.
const createSession: CreateTerminalSession = async (size, signal) => {
  const pty = await myRuntime.spawn('bash', { cols: size.cols, rows: size.rows, signal });
  return {
    onOutput: (listener) => pty.onData(listener), // returns { dispose() }
    write: (data) => pty.write(data),
    resize: ({ cols, rows }) => pty.resize(cols, rows),
    kill: () => pty.kill(),
    onExit: (listener) => pty.onExit(listener), // optional
  };
};

<TerminalView createSession={createSession} onExit={(code) => console.log('exited', code)} />
APIBehavior
TerminalViewcreateSession(size, signal) starts the session at the view's first visible size, and may return a promise. onDropFiles(files) stores dropped files and resolves to their paths, which the view types in, shell-quoted. onExit(code) reports the process's exit.
ServerOutputView, ConsoleViewTake items carrying a seq that only increases. The views append what is new, start over when it goes back, and keep a fixed maximum on screen.
IDEViewfs, selectedPath, onSelectedPathChange and theme.
PreviewFrameThe page at url, or a runtime's own frame as children, with loading and error states over it.
PreviewURLBarpath, onNavigate, onReload and reloadItems. Without onNavigate the address is read-only.
PortsViewports, a list of PortEntry.

Every view renders in full whatever it is given: missing data shows its empty state, and a missing function shows its control disabled.

Public components

Everything is exported from the package root. @nodesandbox-ai/elements/editor keeps the editor's pieces separate, and @nodesandbox-ai/elements/styles.css is the compiled stylesheet.

APIBehavior
Sandbox, SandboxShellThe complete sandbox, with or without its provider.
SandboxProvider, useSandboxThe React runtime provider plus theme and editor state, and its hook.
SandboxLayoutProvider, SandboxLayout, useSandboxLayoutThe layout state and the shell's root.
SandboxSidenav, SandboxSidenavLogo, SandboxSidenavGroup, SandboxSidenavTrigger, SandboxSidenavButton, SandboxSidenavSeparator, SandboxSidenavFooterThe sidenav and its parts.
SandboxLeftPanel, SandboxLeftPanelHeader, SandboxLeftPanelExpand, SandboxLeftPanelToggleThe left panel, its header and its controls.
SandboxMain, SandboxView, SandboxViewToggleThe main area and its views.
SandboxHeader, SandboxPreviewHeader, SandboxMobileDesktopToggle, SandboxFullscreenToggleThe headers and their controls.
SandboxBottomPanel, SandboxBottomPanelHeader, SandboxBottomPanelToggleThe bottom panel, its bar and its toggle.
SandboxPanel, usePanelYour own content as a panel in a region.
SandboxTabPanels, SandboxTab, useSandboxTabsThe left panel's tabs: one per open tab, each a session of a sidenav item with render, and the actions on them.
SandboxTerminal, SandboxPreview, SandboxIDE, SandboxConsole, SandboxServerOutput, SandboxPortsThe standalone components.
SandboxTerminalControls, writeAttachments, ATTACHMENTS_DIRA phone's keys, keyboard and prompt buttons under a terminal, and the attachments they write under /tmp/attachments.
SandboxFileTree, SandboxCodeEditorThe Explorer and the editor on their own.
TerminalView, PreviewFrame, IDEView, ConsoleView, ServerOutputView, PortsViewThe views, driven by props.
ClaudeCodeIcon, OpenCodeIcon, CodexIcon, PiIconAgent marks for sidenav buttons.

Migrating

This release replaces the earlier chrome with the shell. To move an existing integration:

APIBehavior
title, titleMenu, onSave, headerActionsMove into header; headerActions becomes header.endActions.
toolbarActionsBecomes previewHeader.endActions.
ui flagsGone. Leave a part out of a composed shell instead. ui.showAttribution becomes attribution, and the bottom panel's tabs are bottomPanel.tabs.
SandboxChromeReplaced by SandboxShell and the shell's regions.
SandboxHeaderNow the shell's header: startActions, endActions, titleMenu and onSave(), or parts as children.
SandboxAgentPanelReplaced by SandboxTerminal in a SandboxLeftPanel, under SandboxLeftPanelHeader.
SandboxIDETakes no sandbox prop. SandboxFileTree and SandboxCodeEditor take fs. The IDE lays out by its own width, not the page's.
SandboxConsoleIs the console panel, not a drawer.
/console, /terminal, /runtime subpathsGone. RuntimeTerminal, RuntimeServerOutput and the line-discipline terminal are replaced by the views above.
Left panel widthStored under a new key, as a percentage, so saved widths reset once.

Workbench IDE

The workbench IDE at @nodesandbox-ai/elements/ide accepts agent and command plugins through runtimePlugins. Its plugins prop is for IDE panels and other UI extensions.

APIBehavior
Sandbox.pluginsRegister agents and commands; sidenavItems buttons with render: <SandboxTerminal command="…" /> open them in tabs of the left panel.
SandboxProvider.pluginsRegister agents on a shared runtime, for SandboxShell or your own composition.
IDE.runtimePluginsRegister compute plugins in the workbench. IDE.plugins configures workbench UI extensions.
IdeProvider.pluginsRegister compute plugins when composing the workbench manually. IdeShell.plugins configures UI extensions.
ide.tsx
'use client';
import { useMemo } from 'react';
import '@nodesandbox-ai/elements/styles.css';
import { IDE } from '@nodesandbox-ai/elements/ide';
import { claudeCodePlugin } from '@nodesandbox-ai/plugin-claude';
import { opencodePlugin } from '@nodesandbox-ai/plugin-opencode';

export function Workspace({ apiKey, source }) {
  const runtimePlugins = useMemo(() => [
    claudeCodePlugin(),
    opencodePlugin({ preload: true }),
  ], []);
  return (
    <IDE
      apiKey={apiKey}
      source={source}
      runtimePlugins={runtimePlugins}
      theme="dark"
    />
  );
}

IDE.onReady and IdeProvider.onReady receive the IDE controller. For the sandbox's early readiness callback, use the React SandboxProvider with an IdeWorkspace inside it. Agent readiness stays on the agent plugin.