Skip to content

feat(ui): introduce flexible UI configuration system with theme and branding support #117

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ckemmler
Copy link

✨ What’s Included
• New uiConfig system:
• Centralized configuration in src/lib/ui-config.ts
• Local overrides via custom-ui-config.ts
• Safe merge logic via get-ui-config.ts
• React Context Provider (UIConfigProvider):
• Makes config and current theme available throughout the app
• Handles dynamic dark/light mode switching
• Applies CSS variables for brand-specific theming
• New custom hook useUIConfig for easy access
• UI enhancements:
• Optional dark mode toggle button (configurable via showThemeToggle)
• Support for custom branding header (brandHeaderWelcome) via injected React component
• Layout adjustments:
• Header now reads from config and supports fallback
• Minor updates to thread component for theme consistency

⚙️ Benefits
• Makes the UI customizable without forking
• Keeps core layout stable and update-friendly
• Easy to theme per brand or deployment
• Does not require a Node server or rebuild to change look and feel

…mponents

- Added new files under `lib/` and `hooks/` to manage and provide UI configuration
- Updated layout and dark mode switcher to use the new UI config
- Tweaked thread component for compatibility
Copy link

vercel bot commented Apr 23, 2025

@ckemmler is attempting to deploy a commit to the LangChain Team on Vercel.

A member of the Team first needs to authorize it.

@ckemmler
Copy link
Author

Hi! I’ve submitted this PR for review. I see that some workflow approvals are pending. Let me know if there’s anything I can fix in the meantime—happy to address any feedback!

@dan-n94
Copy link

dan-n94 commented May 8, 2025

Hi! I really like the additional config options!
I noticed a small issue with dark mode: it looks like the thread history background in the sidebar doesn't update correctly and stays white. Just wanted to flag it in case it's helpful!

<div className="sticky bottom-0 flex flex-col items-center gap-8">
{!chatStarted && config.brand.brandHeaderWelcome ? (
config.brand.brandHeaderWelcome()
) : !config.layout?.hideBrandHeaderAboveChatBox ? (
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be really nice to display my custom brandHeader above the chat when it started as well. I configured something like this, but this could probably be simplified:

{!chatStarted && config.brand.brandHeaderWelcome ? (
  config.brand.brandHeaderWelcome()
) : !config.layout?.hideBrandHeaderAboveChatBox ? (
  config.brand.brandHeaderWelcome ? (
    config.brand.brandHeaderWelcome()
  ) : (
    <div className="flex items-center gap-3">
      <LangGraphLogoSVG className="h-8 flex-shrink-0" />
      <h1 className="text-2xl font-semibold tracking-tight">
        Agent Chat
      </h1>
    </div>
  )
) : null}

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.

2 participants