Experimental AI Chat Component for Vaadin

We’ve recently published a Maven package featuring experimental components, including a Chat for user – AI assistant interactions.
To try it out, add the following dependency to your project:

<dependency>
  <groupId>org.vaadin</groupId>
  <artifactId>experimental-components</artifactId>
  <version>0.0.2</version>
</dependency>

The Chat component can be used in both React/Hilla and Java/Flow views:

React/Hilla:

<Chat chatId={chatId} service={Assistant} acceptedFiles="image/*,text/*,application/pdf" options={value} renderer={renderer} />

Java/Flow:

add(new Chat(service, chatId, "image/*,text/*,application/pdf"))
  • chatId - Indentifies the conversation instance.
  • service - defines methods to be implemented by the application logic, stream being the most important one.
  • acceptedFiles - Specifies the file types allowed as attachments.
  • options (React only) - Contains custom properties sent to the service on each stream request.
  • renderer (React only) - Defines a custom renderer for AI-generated content (e.g., charts).

For an example use case, see spring-ai-vaadin/src/main/frontend/views/@index.tsx at main · spring-ai-community/spring-ai-vaadin · GitHub

The package also includes a Markdown component, which renders content written in Markdown syntax. This is the same component used for displaying messages in Chat.

var markdown = new Markdown();

markdown.setContent(
    "# Markdown Example\n\n"
        + "This is a simple example of using the Markdown component.\n\n"
        + "## Features\n\n"
        + "- **Bold Text**\n"
        + "- *Italic Text*\n"
        + "- [Link](https://vaadin.com)\n");

As the name and version suggest, these components are experimental and intended for testing purposes only — not for production use.

2 Likes

Do you prefer issues / suggestions here or on Github? :)

Feel free to submit issues to https://github.com/vaadin/experimental-components/issues

But as mentioned, these components are experimental and primarily intended for testing purposes. We’ve intentionally made trade-offs, so they don’t meet the same quality standards as official Vaadin components, including those behind feature flags.

Similar official components may be developed in the future, but they will likely be re-implemented from scratch, possibly drawing inspiration from this package.

1 Like