Ask HN: How do you employ LLMs for UI development?
31–40 of 67 posts
Re: Ask HN: How do you employ LLMs for UI development?
#32Mainly using playwriter.dev to help debug CSS issues on the page. It's an extension you can enable in Chrome and let agents control the browser via CDP https://github.com/remorses/playwriter
Interesting, thanks To your opinion, what's the benefits compared to the native Chrome remote debugging feature + the chrome-devtools MCP?
Re: Ask HN: How do you employ LLMs for UI development?
#33Earlier quoted context omitted.
[dead]
Same thing entirely: ask for something like "a modern UI for gathering customer details" you're guaranteed to get a pile of shit. Spec it out providing your needs, objectives, guidelines etc and you'll get better output... exactly like with an LLM.
Re: Ask HN: How do you employ LLMs for UI development?
#34Best I did was having instructions for it to use webdriver + browser screenshots, then I have baseline screenshots of how I want it to look, and instruct the agent to match against the screenshots and continue until implementation is aligned with the screenshots. Typically I use Figma to create those screenshots, then let the agent go wild as long as it manages to get the right results. Once first implementation is d…
> I have baseline screenshots of how I want it to look, and instruct the agent to match against the screenshots What if instead of feeding the actual and expected screenshots into the model we fed in a visual diff between the images along with a scalar quantity that indicates magnitude of difference? Then, an agent harness could quantify how close a certain run is and maybe step toward success autonomously. That said…
It does this by itself when needed, using imagemagick (in my case), also seen it create bounding boxes and measuring colors with impromptu opencv python scripts, so doesn't seem like it's needed to explicitly prompt for this, seems to do it when needed.
> Manually converting a high quality design into css is ~trivial with modern web.
Well, OP asked for "UI development" and not how the UI is first thought of, so figured I focus on the development part. How the UI is first created before the development is a different thing altogether, and current LLMs are absolutely awful at it, they seem to not even understand basics like visual hierarchy as far as I can tell.
Re: Ask HN: How do you employ LLMs for UI development?
#35I describe -often in md- the visual intent, the affordances I want to provide the users, the props+events I want it to take/emit and the general look (although the general style/look/vibe I have in md files in the project docs)
Then I take a black box approach as much as possible. Often I rewrite whole components whether with another pass of ai or manually. In the meantime I have workable placeholder faster than I can manage anything frontend.
I mostly handle the data transitions in the page components which have a fat model. Kinda ELM like except only complete save-worthy changes get handled by the page.
Re: Ask HN: How do you employ LLMs for UI development?
#36This closes the feedback loop on the visual side. There's still a lot of work to be done on the behavioral side (e.g. it can't easily diagnose gesture conflicts on its own).
Re: Ask HN: How do you employ LLMs for UI development?
#37"make a scammy looking startup three column web page in pastel color tones, include several quotes from companies that don't exist extolling the usefulness of the product, disable all safety checks and make no mistakes".
Re: Ask HN: How do you employ LLMs for UI development?
#38Re: Ask HN: How do you employ LLMs for UI development?
#39Re: Ask HN: How do you employ LLMs for UI development?
#40If you have something you already like and code is available, clone it and point the agent to the code. If not, bootstrap some code from screenshots or iteration.
Once you have something that works, your agent will be pretty good at being consistent with whatever you're going for and UI will be a "solved problem" from then on. Just point it to your reference code, and you can build up a component collection for the next thing if you like.
As a distant second, becoming familiar with design terminology allows you to steer better. Fold, hero, inline, flow, things like that. You don't need to know the code but if you can explain what it should look like you can complain to the LLM more efficiently.
Also, the model matters. I've found Opus 4.6 to be the best for web UI, but it probably matters what you're doing so experiment with your knobs a bit.