Skip to content

Conversation

@hannahblair
Copy link
Collaborator

@hannahblair hannahblair commented Dec 18, 2025

Description

The way Chatbot passes props to gr.HTML means we need to create a wrapper around HTML to get it working. This PR adds a wrapper around gr.HTML and changes the export path to that in package.json

Closes: #12595

demo:

import gradio as gr

with gr.Blocks() as demo:
    chatbot = gr.Chatbot()
    msg_textbox = gr.Textbox()

    demo.load(
        lambda: gr.update(value=[{"role": "assistant", "content": gr.HTML("<h1>Hello world!</h1>")}]),
        None,
        [chatbot]
    )

demo.launch()

AI Disclosure

We encourage the use of AI tooling in creating PRs, but the any non-trivial use of AI needs be disclosed. E.g. if you used Claude to write a first draft, you should mention that. Trivial tab-completion doesn't need to be disclosed. You should self-review all PRs, especially if they were generated with AI.

  • I used AI to... [fill here]
  • I did not use AI

🎯 PRs Should Target Issues

Before your create a PR, please check to see if there is an existing issue for this change. If not, please create an issue before you create this PR, unless the fix is very small.

Not adhering to this guideline will result in the PR being closed.

Testing and Formatting Your Code

  1. PRs will only be merged if tests pass on CI. We recommend at least running the backend tests locally, please set up your Gradio environment locally and run the backed tests: bash scripts/run_backend_tests.sh

  2. Please run these bash scripts to automatically format your code: bash scripts/format_backend.sh, and (if you made any changes to non-Python files) bash scripts/format_frontend.sh

@gradio-pr-bot
Copy link
Collaborator

gradio-pr-bot commented Dec 18, 2025

🪼 branch checks and previews

Name Status URL
Spaces ready! Spaces preview
🦄 Changes detected! Details

Install Gradio from this PR

pip install https://gradio-pypi-previews.s3.amazonaws.com/856dd886a715dd4caa378b930860afe3c7dc4fc0/gradio-6.1.0-py3-none-any.whl

Install Gradio Python Client from this PR

pip install "gradio-client @ git+https://github.com/gradio-app/gradio@856dd886a715dd4caa378b930860afe3c7dc4fc0#subdirectory=client/python"

Install Gradio JS Client from this PR

npm install https://gradio-npm-previews.s3.amazonaws.com/856dd886a715dd4caa378b930860afe3c7dc4fc0/gradio-client-2.0.0.tgz

@gradio-pr-bot
Copy link
Collaborator

🦄 change detected

This Pull Request includes changes to the following packages.

Package Version
@gradio/html patch
gradio patch

  • Ensure HTML renders in gr.Chatbot

‼️ Changeset not approved. Ensure the version bump is appropriate for all packages before approving.

  • Maintainers can approve the changeset by checking this checkbox.

Something isn't right?

  • Maintainers can change the version label to modify the version bump.
  • If the bot has failed to detect any changes, or if this pull request needs to update multiple packages to different versions or requires a more comprehensive changelog entry, maintainers can update the changelog file directly.

Copy link
Collaborator

@freddyaboulton freddyaboulton left a comment

Choose a reason for hiding this comment

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

Looks good but can you explain why the current approach doesn't work? The chatbot (should) load BaseHTML from @gradio/html. And here we're wrapping BaseHTML. Could we instead just change how the chatbot passes props to the html component in Component.svelte?

@freddyaboulton freddyaboulton mentioned this pull request Dec 18, 2025
2 tasks
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.

gr.HTML no longer renders in gr.Chatbot in gradio version 6+

4 participants