API Reference

generate(options)

Generates a UI component from a natural language prompt.

ParameterTypeDefaultDescription
promptstringNatural language description of the component
frameworkstring"react"Target framework: react, vue, svelte
stylingstring"tailwind"Styling approach: tailwind, css-modules, styled
tokensstring | objectnullPath to token file or token object
responsivebooleantrueInclude responsive breakpoints
a11ybooleantrueInclude 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).

ParameterTypeDescription
sourcestringPath to image, PDF, or URL
formatstringOutput format: css-variables, json, scss, tailwind-config
categoriesstring[]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.

ParameterTypeDescription
componentstringSource code of the component
breakpointsobjectBreakpoint 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[] }>