> ## Documentation Index
> Fetch the complete documentation index at: https://help.21st.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Overview

> Generate UI from a prompt, compare multiple drafts, and copy production-ready code.

<video autoPlay muted playsInline src="https://mintcdn.com/21st/uLCB5kikM-FHl_zp/videos/21st-ai.mp4?fit=max&auto=format&n=uLCB5kikM-FHl_zp&q=85&s=33554fe3ce5f629fd9c44413dde30a3b" />

**21st AI** turns a text prompt into working UI. Instead of one answer, it generates several drafts at once so you can compare and pick the direction you like, then refine your choice in plain language.

## The core loop

**1. Describe what you want**

Write a prompt — a landing hero, a pricing table, a settings page. Attach
images or reference a marketplace component as a starting point.

**2. Get multiple drafts**

21st generates several variations in parallel so you can compare approaches
side by side instead of iterating on a single guess.

**3. Pick and refine**

Choose your favorite draft and refine it with follow-up instructions
("make it bolder", "add a toggle", "use this theme").

**4. Take the code**

Copy the code or a paste-ready prompt and drop it into your project, editor,
or AI agent.

## Two ways to generate

> [card] [Sketch mode](https://help.21st.dev/ai/generation.md#sketch-mode)
>
> Fast HTML/Tailwind drafts rendered in the browser. Best for exploring layout
> and visual direction quickly.

> [card] [Code mode](https://help.21st.dev/ai/generation.md#code-mode)
>
> Full React/shadcn components with a live preview and multi-turn editing. Best
> when you want real, installable code.

## Where you can use it

> [card] [Web](https://21st.dev/ai)
>
> Generate and refine at 21st.dev/ai.

> [card] [CLI](https://help.21st.dev/cli.md)
>
> `21st generate`, `iterate`, and `take` from your terminal.

> [card] [MCP](https://help.21st.dev/ai/mcp.md)
>
> The same generation tools inside Cursor, Claude, and VS Code.

> [!NOTE]
>
> Generation uses **credits** and is a paid feature. Search and browsing are
> free; each generation and refinement draws from your available balance. Turn
> on AI for Builder or Team and choose a monthly allowance of 500, 1,000, or
> 2,000 credits. See [Pricing & Credits](https://help.21st.dev/ai/pricing.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.