Back to blog
·UI Anvil Team

5 Tips for Better Forge Prompts

Get better component output from the AI Forge with these prompt engineering techniques.

tipsforgeai

1. Be Specific About Components

Bad: "Make a form"

Good: "A contact form with name, email, message textarea, and submit button using react-hook-form validation"

The more specific you are, the better the AI classifies your request and generates appropriate code.

2. Mention Interactive States

Bad: "A button"

Good: "A button with loading spinner state, disabled state, and 3 variants: default, destructive, outline"

Interactive states are where components get complex. Mentioning them upfront produces much better code.

3. Reference shadcn Components by Name

The Forge knows all 57 shadcn/ui components. Use their names:

  • "A Command palette with search" (not "a searchable dropdown")
  • "A Sheet with a form inside" (not "a slide-over panel")
  • "An Accordion for FAQ items" (not "collapsible sections")

4. Specify the Data Shape

Bad: "A user table"

Good: "A data table for users with columns: name, email, role (admin/member badge), status (active/inactive), and last login date. Include sortable headers and row selection checkboxes."

5. Set the Context

Tell the Forge where this component lives:

  • "A sidebar navigation for a SaaS dashboard"
  • "A hero section for a developer tool landing page"
  • "A settings card inside a dashboard layout"

Context helps the AI make better decisions about spacing, density, and visual weight.

Start Forging

Try these tips at uianvil.com/forge — 10 free generations per day with a free account.

Command Palette

Search for a command to run...