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 eachstream
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.