# Grok turns screenshots into Tailwind components, self-correcting layout errors

> Original title: 3. screenshot to react component

- Source: eric zakariasson
- Published: 2026-10-06T17:07:05.000Z
- Bad Influence: https://badinfluence.news/items/k2nwyyof7jrijqyhvco7bg2ky
- Original: https://x.com/ericzakariasson/status/2107518016129048888

## Summary

The xai-cookbook example uses Grok to generate a Tailwind React component from a dropped-in screenshot. The page then screenshots its own render, overlays it on the original, and feeds the mismatches back so Grok can refine the layout, raising the match from 60% to 77% in one run.

## Post

3. screenshot to react component

drop in a screenshot and grok writes a tailwind component. then the page screenshots the result, overlays the outlines of both, and sends that back so grok can fix what doesn't line up. in this run it went from 60% to 77%.

https://github.com/xai-org/xai-cookbook/tree/main/examples/screenshot-to-component

[Video](https://badinfluence.news/api/img-proxy?u=https%3A%2F%2Fpbs.twimg.com%2Famplify_video_thumb%2F2107517989390323712%2Fimg%2F7Xaq_BmUeyuMOQkH.jpg&mode=thumb&exp=1795737600&sig=785f70ae3ea226ce)
