> ## Documentation Index
> Fetch the complete documentation index at: https://bazable.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# bazable gen ui

> Generate a React + Tailwind form component from an endpoint's request schema.

Generates a form component from an endpoint's request schema. By default, produces a **zero‑dependency, standalone HTML file** with embedded CSS and JavaScript. You can also use `--ai` to let an LLM generate the UI for any framework.

## Usage

```bash theme={null}
bazable gen ui <method> <url> [options]
```

## Options

<ParamField query="-o, --output" default="./generated-ui" type="string">
  Output directory for the generated form.
</ParamField>

<ParamField query="--framework" default="html" type="string">
  Target framework. One of `html` or `react-tailwind`.
</ParamField>

<ParamField query="--ai" type="boolean">
  Use AI to generate the UI (requires a configured AI key).
</ParamField>

## What it generates

* **Vanilla HTML (default):** a self-contained `.html` file with a dark/light theme toggle, semantic form inputs, and native `fetch` logic. Handles text inputs, number inputs, and checkboxes. No build tools or dependencies required.
* **React + Tailwind** (with `--framework react-tailwind`): a `.tsx` React component using Tailwind CSS classes and state management. If AI is enabled, the component is fully generated by the AI.
* **AI-powered** (with `--ai`): sends the endpoint schema to your configured AI model (OpenAI, Groq, and others) and returns production-ready code for the chosen framework. Falls back to the vanilla HTML generator if no AI key is configured or the AI call fails.

## Prerequisites

* The endpoint must have a request schema in your `bazable.config.json` (run [`bazable extract -r`](/commands/extract) first).
* For AI generation, an AI key must be configured via [`bazable config --set-ai-key`](/commands/config).

## Examples

<CodeGroup>
  ```bash Vanilla HTML theme={null}
  bazable gen ui POST https://api.example.com/v1/settlements
  ```

  ```bash React + Tailwind (AI) theme={null}
  bazable gen ui POST https://api.example.com/v1/settlements --ai --framework react-tailwind
  ```

  ```bash Custom output dir theme={null}
  bazable gen ui POST https://api.example.com/v1/settlements -o ./my-forms
  ```
</CodeGroup>


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