Packages
Surfaces UI is 33 packages on npm, released together at one version, so any two of them always work together. Most apps install two to six of them; the rest come along as dependencies, or are parts of the server.
What an app installs
| You want | Install |
|---|---|
| Components over your own backend (grid, chart, pivot, editor, explorers, forms) | @surfaces-ui/components @surfaces-ui/data |
| Pages and views an agent describes | add @surfaces-ui/spec |
| A chat thread with an agent | add @surfaces-ui/chat, and an agent backend |
| The reference server (DuckDB, Teradata, DataFusion) | @surfaces-ui/client-connect in the app, @surfaces-ui/dev-server beside it |
| SQL in the browser with no server | @surfaces-ui/datasource-duckdb-wasm and @duckdb/duckdb-wasm |
| All of it, set up | npx create-surfaces my-app |
React 18 or 19 is a peer of every package that draws: your app provides it.
Each package below links to its own README, with how to install and use it. "Brings" lists the other Surfaces UI packages a package depends on directly, and its larger third-party dependencies; peers are what your app provides.
Start here
What an app installs itself. Each brings the foundations it needs.
| Package | What it is | Brings | Peers |
|---|---|---|---|
@surfaces-ui/components | The components themselves: grids that stay fast at any size, charts, pivots, the SQL editor, schema and catalog browsing, data modelling, filters and the theme. | data, icons, proto, tokens, trace, protobuf-es, CodeMirror, Apache Arrow, echarts | react, react-dom |
@surfaces-ui/data | The interfaces every component uses (DataSource, Discovery, Pipelines, Semantics, StateStorage), Arrow helpers, the plain filter form, and in-memory implementations for tests and demos. | proto, protobuf-es, Apache Arrow | none |
@surfaces-ui/spec | Agent-generated UI: the component catalog, the A2UI surface model, the agent prompt generated from the catalog, and SurfaceView, which draws what an agent sends after checking it against the catalog. | components, data, icons, proto, tokens, trace, protobuf-es, zod | react, react-dom |
@surfaces-ui/chat | Chat threads whose replies hold live components: streaming text, tool steps, approvals, and any catalog component drawn inline. | agent, components, icons, proto, spec, state, trace, protobuf-es | react, react-dom |
@surfaces-ui/state | State services with no React or DOM dependency: stores, derived values, undo, persistence to any StateStorage, URL sync, the shared view state behind cross-filtering, and query runs. | data, proto, protobuf-es | react (optional) |
@surfaces-ui/devtools | Developer tools for agent-generated UI: one component around your app records messages, components, problems, state, events, agent turns and service calls, with time travel. | components, data, spec, trace | react, react-dom |
@surfaces-ui/client-connect | The client side of the dev server's services over Connect: connectDataSource, connectDiscovery, connectAgent and the rest, each implementing the matching interface from @surfaces-ui/data or @surfaces-ui/agent. | data, proto, Connect | none |
@surfaces-ui/dev-server | A Connect server for your data: DuckDB (files, Delta, Iceberg, object stores, Postgres), Teradata and DataFusion behind one set of read-only services, with search, pipelines and an agent. | agent, data, discovery, engine, engine-datafusion, engine-mcp, engine-duckdb, engine-service, engine-teradata, pipelines, pipelines-dbt, proto, seeds, sql, protobuf-es, Connect, Apache Arrow | none |
create-surfaces | Starts a new app: a dashboard page, a chat that draws live components, and a data server with six sample datasets. | nothing | none |
Agent backends
One of these turns a model into an AgentBackend for Chat, PageStudio or the dev server. Install the one you use.
| Package | What it is | Brings | Peers |
|---|---|---|---|
@surfaces-ui/agent | The AgentBackend interface (one send is one turn), event helpers, a scripted agent for tests, toolCallingAgent for any model with tool calls, and dataTools, which lets a model list and describe tables (never their values). | data, proto, protobuf-es | none |
@surfaces-ui/agent-anthropic | An AgentBackend over Claude through the official Anthropic SDK, which you install alongside it. | agent | @anthropic-ai/sdk |
@surfaces-ui/agent-openai | An AgentBackend over any OpenAI-compatible /chat/completions endpoint: OpenAI, Ollama, vLLM or LM Studio. | agent | none |
@surfaces-ui/agent-loom | An AgentBackend that talks to a running Loom server over its HTTP gateway. | agent, proto, protobuf-es | none |
Other places to show it
For an MCP host, a Next.js app, a plain HTML page, or SQL in the browser with no server.
| Package | What it is | Brings | Peers |
|---|---|---|---|
@surfaces-ui/mcp | MCP Apps delivery: registers tools that show grids, charts, pivots, dashboards and agent-drawn surfaces inside an MCP host, and a stdio server over surfaces.config.ts. | agent, components, data, dev-server, proto, spec, tokens, protobuf-es, MCP SDK, Apache Arrow, react, react-dom, zod | none |
@surfaces-ui/next | Serve Surfaces UI pages from a Next.js app: routes, metadata and server-rendered pages, with Next.js doing the routing, building and hosting | components, spec, tokens | next, react, react-dom |
@surfaces-ui/page | Surfaces UI pages as one script and one stylesheet, for a plain HTML page with no build step (an app's web view). | nothing | none |
@surfaces-ui/datasource-duckdb-wasm | A DataSource that runs DuckDB in the browser: real SQL over Parquet with no server. | data, engine, engine-service, proto, sql, Apache Arrow | @duckdb/duckdb-wasm |
Inside the server
@surfaces-ui/dev-server installs these itself. Install one directly only to build a server of your own.
| Package | What it is | Brings | Peers |
|---|---|---|---|
@surfaces-ui/engine | The Engine interface the server's engine adapters implement. | proto, protobuf-es, Apache Arrow | none |
@surfaces-ui/engine-service | The query, catalog and source services over engine adapters, usable in Node or a browser. | client-connect, data, engine, proto, sql, protobuf-es, Connect, Apache Arrow | none |
@surfaces-ui/engine-duckdb | DuckDB as an engine (Node, ADBC): Parquet, CSV and JSON files, Delta and Iceberg tables, time travel, and file access locked to the registered tables. | engine, proto, DuckDB (native, through ADBC), protobuf-es, Apache Arrow | none |
@surfaces-ui/engine-teradata | Teradata as an engine, through Teradata Query Service or a driver connection you supply. | engine, proto, sql, protobuf-es, Apache Arrow | none |
@surfaces-ui/engine-datafusion | Apache DataFusion as an engine, over a server's HTTP SQL endpoint (ROAPI), reading Arrow. | engine, proto, sql, protobuf-es, Apache Arrow | none |
@surfaces-ui/engine-mcp | A database's own MCP server as an engine: the Teradata MCP server, or a Postgres, MySQL or DuckDB one. | engine, engine-teradata, proto, sql, protobuf-es, MCP SDK, Apache Arrow | none |
@surfaces-ui/sql | Turns a view (sort, filter, page, group, aggregate, bucket) into SQL for each engine's dialect, with every value bound as a parameter, plus read-only checks. | data, proto, protobuf-es, @polyglot-sql/sdk | none |
@surfaces-ui/discovery | The reference discovery backend: keyword and semantic search over tables and columns, profiles, inferred joins and context packs for agents, on any DataSource. | data, proto, protobuf-es, Apache Arrow | none |
@surfaces-ui/embedder-local | A small embedding model run on your machine for semantic search. | discovery, Transformers.js | none |
@surfaces-ui/pipelines | The reference pipeline runner: builds datasets from one another on an engine, in dependency order, with row rules and checks over what was built. | data, engine, proto, sql, protobuf-es | none |
@surfaces-ui/pipelines-dbt | A dbt project as a pipeline: datasets, tests, runs and semantic models read from dbt's artifacts. | data, proto, protobuf-es | none |
@surfaces-ui/seeds | Six synthetic industry datasets (retail, healthcare, fraud, telco, transportation, manufacturing) with keys, descriptions, planted data problems, pipelines, starter pages and written conversations. | data, spec | none |
Foundations
Shared by the packages above and installed with them. You import from them (a theme, a trace), but rarely add them yourself.
| Package | What it is | Brings | Peers |
|---|---|---|---|
@surfaces-ui/tokens | The theme contract, eight presets, colour derivation tested for contrast, and the CSS variables (--sf-*) every component is styled with. | nothing | none |
@surfaces-ui/icons | One set of outline icons: everyday actions from Lucide and Surfaces UI's own drawings for data work (joins, lineage, pivots, schema drift), at one line weight. | nothing | react |
@surfaces-ui/proto | TypeScript generated from the protobuf contracts that cross process boundaries (queries, catalogs, agents, pipelines). | protobuf-es | none |
@surfaces-ui/trace | The recorder behind the developer tools. | nothing | react (optional) |
Worth knowing
- The data layer is optional.
components,spec,chatand the other packages that draw depend only on theDataSourceinterface in@surfaces-ui/data, never on an engine, a driver, a Connect client or the server (pnpm check:boundariesholds this). An app on its own backend implementsDataSourceand installs nothing from the server side. @surfaces-ui/dev-serverbrings every engine. It depends on the DuckDB, Teradata and DataFusion adapters, the pipeline runner and dbt support, so a server that only reads Teradata still installs DuckDB's native library.- Icons come one at a time. Importing
undoIconfrom@surfaces-ui/iconsbrings that drawing alone; see icons.md. - No Teradata driver is installed.
@surfaces-ui/engine-teradatatalks to Teradata Query Service overfetch, or to a driver connection your server opens with a driver you install yourself. - Before the first release (0.2.0), each package was checked on its own: packed as npm publishes it, installed alone into an empty project, and every JavaScript entry imported; the app
create-surfaceswrites was then installed from those packages, built, and its data server started and answered. Releasing is described in releasing.md.