@vscode-shell/ui
v0.4.0
Published
VS Code–style desktop chrome for React (Workbench, tokens, theme helpers)
Downloads
264
Readme
@vscode-shell/ui
VS Code–style desktop chrome for React (Workbench, ActivityBar, Sidebar, PageTabs, StatusBar, TitleBar) plus --vscode-* design tokens and theme helpers.
Install
pnpm add @vscode-shell/ui
# peers
pnpm add react react-domQuick start
import {
Workbench,
TitleBar,
ActivityBar,
Sidebar,
PageTabs,
StatusBar,
setTheme,
} from '@vscode-shell/ui';
import '@vscode-shell/ui/styles.css';
setTheme('dark'); // or 'light' — toggles `.dark` on <html>
export function App() {
return (
<Workbench
titleBar={<TitleBar center={<span>My App</span>} />}
activityBar={<ActivityBar items={[]} activeId="" onChange={() => {}} />}
sidebar={<Sidebar items={[]} activeId="" onChange={() => {}} />}
tabs={<PageTabs tabs={[]} activeId="" onSelect={() => {}} />}
statusBar={<StatusBar left={<span>Ready</span>} />}
>
<div>Editor</div>
</Workbench>
);
}Optional bottom panel slot:
<Workbench panel={<YourLogPanel />}>{/* editor */}</Workbench>Styles
Import once at the app entry:
import '@vscode-shell/ui/styles.css';Tokens live as CSS variables (--vscode-editor-bg, --vscode-text-primary, …). Light defaults are on :root; dark overrides under .dark.
New primitives (Tailwind at build time)
Chrome (Workbench, bars, Scrollbar) stays hand-written .vsc-* CSS.
New shared controls are authored with Tailwind 4 utilities in this package and compiled into styles.css at build time. Apps still import only @vscode-shell/ui/styles.css. The package does not enable Tailwind preflight and does not use the Tailwind color palette — use var(--vscode-*).
ResizeHandle
Splitter. direction="row" is a horizontal bar (drag on Y). direction="column" is a vertical bar (drag on X). onDrag receives a pixel delta.
import { ResizeHandle } from '@vscode-shell/ui';
<ResizeHandle direction="row" onDrag={(delta) => setHeight((h) => h + delta)} />InfiniteScroll
Wraps Scrollbar (default vertical). Calls onLoadMore when the viewport reaches the end and hasMore is true.
import { InfiniteScroll } from '@vscode-shell/ui';
<InfiniteScroll hasMore={hasMore} onLoadMore={loadMore}>
{rows}
</InfiniteScroll>Theme helpers
| API | Description |
|-----|-------------|
| setTheme('light' \| 'dark') | Toggle document.documentElement.classList .dark |
| getTheme() | Read current mode from the class list |
Tauri note
Window drag regions and custom window controls stay in the application (see the starter app). This package does not depend on @tauri-apps/*.
Docs
- Repo: https://github.com/deskkit/vscode-shell
- Design: vscode-shell design
- Tailwind primitives: build-time Tailwind + ResizeHandle
License
MIT
