Skip to content

[appkit plugin] [7/x] Add custom UI elements (+playground) to @databricks/appkit-agent #395

Open
hubertzub-db wants to merge 16 commits intodatabricks:mainfrom
hubertzub-db:stack/agent-plugin-p8
Open

[appkit plugin] [7/x] Add custom UI elements (+playground) to @databricks/appkit-agent #395
hubertzub-db wants to merge 16 commits intodatabricks:mainfrom
hubertzub-db:stack/agent-plugin-p8

Conversation

@hubertzub-db
Copy link
Copy Markdown

@hubertzub-db hubertzub-db commented Mar 25, 2026

🥞 Stacked PR


Signed-off-by: Hubert Zub hubert.zub@databricks.com

Summary

  • Introduces a headless React library exported from @databricks/appkit-agent/react — hooks and renderless components that let users build fully custom chat UIs with their own styling.
  • Refactors the existing client (client/) to delegate core logic (chat streaming, history, session, config) to the new library, reducing duplication while preserving full backward compatibility.
  • Adds a playground/custom-ui/ example app demonstrating the headless library end-to-end: sidebar with chat history, streaming chat, input — all in plain CSS, no component library.
  • Documents the custom UI API in the README (provider, hooks, headless components, full example).

Build changes

  • tsdown.config.ts now has two entries: server (platform: "node") and React library (platform: "neutral", externalized React/SWR/AI SDK).
  • package.json adds "./react" export pointing to dist/react/index.{mjs,cjs}, plus peerDependencies for react, react-dom, swr, @ai-sdk/react.

Client refactoring

The existing client hooks (use-chat-stream, use-chat-history, use-session, use-config, useChatData) now wrap the library's hooks, adding only client-specific concerns (toast notifications, router navigation). ChatProvider wraps ChatAgentProvider while keeping the window.__CHAT_CONFIG__ bridge for backward compatibility.

Demo of the custom UI

Screen.Recording.2026-03-25.at.15.24.23.mov

Test plan

  • pnpm run build in appkit-agent/ succeeds — produces dist/react/, dist/chat-client/, server bundles
  • playground/custom-ui/ starts with pnpm run dev — Vite HMR on port 8000, sidebar lists chats, can send messages, can click existing chats to load history
  • playground/default-ui/ starts and serves the bundled chat UI at http://localhost:8000

Move agent plugin source code into src/agent-plugin/ subfolder for
better organization when hosting multiple plugins.
Signed-off-by: Hubert Zub <hubert.zub@databricks.com>
Signed-off-by: Hubert Zub <hubert.zub@databricks.com>
Signed-off-by: Hubert Zub <hubert.zub@databricks.com>
Signed-off-by: Hubert Zub <hubert.zub@databricks.com>
Signed-off-by: Hubert Zub <hubert.zub@databricks.com>
Add per-package pnpm-lock.yaml and CI/release workflows with
explicit pnpm version and cache-dependency-path.
Signed-off-by: Hubert Zub <hubert.zub@databricks.com>
Signed-off-by: Hubert Zub <hubert.zub@databricks.com>
Signed-off-by: Hubert Zub <hubert.zub@databricks.com>
Signed-off-by: Hubert Zub <hubert.zub@databricks.com>
Signed-off-by: Hubert Zub <hubert.zub@databricks.com>
Signed-off-by: Hubert Zub <hubert.zub@databricks.com>
- Import ChatProvider + ChatPanel from @databricks/appkit-agent/chat-ui
  instead of building from scratch
- Add react-router-dom and swr as custom-ui playground dependencies
- Add ./chat-ui/styles.css export to package.json for CSS import
- Simplify main.tsx entry point
Signed-off-by: Hubert Zub <hubert.zub@databricks.com>
Signed-off-by: Hubert Zub <hubert.zub@databricks.com>
@hubertzub-db hubertzub-db force-pushed the stack/agent-plugin-p8 branch from 54d6f8e to aa3223a Compare March 25, 2026 15:29
@hubertzub-db hubertzub-db changed the title Custom UI [appkit plugin] [7/x] Add custom UI elements (+playground) for @databricks/appkit-agent Mar 26, 2026
@hubertzub-db hubertzub-db changed the title [appkit plugin] [7/x] Add custom UI elements (+playground) for @databricks/appkit-agent [appkit plugin] [7/x] Add custom UI elements (+playground) to @databricks/appkit-agent Mar 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant