API Reference
generate(options)
Generates a UI component from a natural language prompt.
| Parameter | Type | Default | Description |
|---|---|---|---|
prompt | string | — | Natural language description of the component |
framework | string | "react" | Target framework: react, vue, svelte |
styling | string | "tailwind" | Styling approach: tailwind, css-modules, styled |
tokens | string | object | null | Path to token file or token object |
responsive | boolean | true | Include responsive breakpoints |
a11y | boolean | true | Include ARIA attributes and keyboard handling |
Returns: Promise<{ code: string, tokens: object, meta: object }>
tokenize(options)
Extracts design tokens from a visual source (screenshot, PDF, or Figma export).
| Parameter | Type | Description |
|---|---|---|
source | string | Path to image, PDF, or URL |
format | string | Output format: css-variables, json, scss, tailwind-config |
categories | string[] | Token categories to extract: colors, typography, spacing, shadows |
Returns: Promise<{ colors: object, typography: object, spacing: object, shadows: object }>
adapt(component, breakpoints)
Takes an existing component and generates adaptive layout variants for specified breakpoints.
| Parameter | Type | Description |
|---|---|---|
component | string | Source code of the component |
breakpoints | object | Breakpoint definitions (e.g., { sm: 640, md: 768, lg: 1024 }) |
validate(code)
Validates generated components against WCAG 2.1 AA accessibility standards.
Returns: Promise<{ score: number, issues: Issue[], suggestions: string[] }>