Coming up with a great name for a new UI component can be surprisingly tough. You want something clear, unique, and short that fits into the context and explains what the component is about. But reality shows that the components first get a simple, quick, non-sense name, possibly an infinite incrementing index, or even worse, an endless cascade of names from view, section, orientation, and domain object. As seen with PersonManagerSubTeamFilterCrudGrid
, RootLayout14
, or ShowButton
.
Even worse, you've got a solid list of candidates—but choosing between them feels like picking a baby name under pressure.
The solution: AI meets random chance (and confetti)
Why not let modern technology handle it?
We built a small tool that combines artificial intelligence with SpringAI, randomness with a Spin Wheel component, Lottie confetti to celebrate the process, and a shiny UI to help you find the perfect component name—while keeping your hands free for what matters most: writing code.
Here’s how it works:
- Let’s create a simple UI with a
TextArea
to paste the source code, a number field for the amount of requested name suggestions, and a “Generate” button to send the input parameters to the AI Service. - Behind the scenes, we use a carefully crafted prompt that includes:
- a system message with naming rules, suggestions, and output format,
- and your component code as the input parameter.
- The AI service is implemented with SpringAI and a simple chat client. The
Service
replies with a list of possible component names in clean JSON format. - We transform that list into a
Markdown Message
from the famous Viritin addon. - The user can pick the name you like best—or let our spinning wheel of fortune do it for you.
- Once a choice is made, confetti rains down. Joy happens. A new component name is born! 🎉
Live demo
Take a look at how it works – or try it out for yourself!
👉 Get the source code on GitHub:
https://github.com/SebastianKuehnau/component-name-generator-app
TL;DR
Stop wasting time on naming. Stay in the flow. Let AI and randomness handle the hard part. The only thing you’ll need to decide is whether to hit “spin” or “select.”
Happy coding – and happy April 1st! 😉