Generating Front-End Projects with LLMs: What Works and What Still Falls Short

    This article reports a hands-on test in which large language models generated a front-end project from a natural-language requirements document. The test covered login, product list, and form pages. Basic layouts were generated reliably, but multi-condition filters and form validation were often incomplete. The article also compares closed-source and open-source models, outlines the risks of open-source deployment, and gives practical steps for teams, including acceptance checklists, structured prompts, and manual review of sensitive modules.

    Large language models are improving, and more teams want to generate runnable front-end projects directly from natural-language requirements. This article draws on a real front-end project generation test. It examines how the model handles basic pages, complex interactions, and form details, and it offers practical recommendations.

    1. Test Scope and Evaluation Criteria

    The test used one requirements document throughout. The document has three parts: a login page with a carousel and a basic form, a product list page with multi-condition filtering, and a form page with field mapping, required-field checks, and format validation. The model had to build a front-end project from scratch with routing, page interactions, and state management, and the project had to run in a local preview.

    The evaluation covered four metrics: instruction following, business logic understanding, page usability, and generation time. Each metric was recorded as “complete,” “partially complete,” or “incomplete,” with specific observations.

    This article does not disclose the model names or versions. The full test environment and prompts are not listed either. The conclusions therefore rely mainly on observed behavior and should not be treated as precise benchmark data. Readers who want to reproduce the test should first fix the model version, sampling parameters, requirements document, and runtime environment. Then they should check the results item by item.

    2. Actual Performance on Three Types of Pages

    1. Login page: the basic structure is reusable

    The carousel, form layout, and button styles on the login page were generated correctly, and the page started without problems. The parts that usually need changes are the API endpoints, the authentication method, and the error messages. When the login request must connect to a real backend, the generated request wrapper often needs manual changes, such as where the token is stored and how expiration is handled.

    2. Product list page: filters are often missing

    The table, pagination, and page layout on the product list page were generated correctly. However, across several generations, the multi-condition filters only produced input boxes and buttons. Clicking them did not filter the data. A closer check showed that the filter conditions were not bound to page state and were not passed to the list API as query parameters.

    This suggests the model paid too little attention to the interaction items in a long requirements document, while it handled the visual parts well. We recommend splitting each filter into a separate acceptance item and confirming after generation that each one actually works.

    3. Form page: validation rules often fall back to defaults

    The form page could complete the submission flow, but its validation details did not match the document. There were three main problems:

    • Required-field messages used generic wording instead of the wording in the document.
    • Format checks for phone numbers, emails, and similar fields used generic regular expressions instead of the rules defined in the document.
    • Field linkage was not implemented. For example, when a user selected “Enterprise user,” the logic to show the tax ID input was missing.

    With normal input, the form appeared to work correctly. With boundary input, such as spaces, overly long text, and invalid formats, the behavior clearly differed from the requirements. Form testing should therefore include boundary cases, not only the normal flow.

    4. Visual style: usable but lacking design polish

    The generated pages had consistent spacing and colors, and components were neatly arranged. However, the overall look was template-like. If the requirements set specific visual rules, specify the component library and design tokens directly, such as the primary color, border radius, and font size. A vague description like “clean and modern” gives the model more room to improvise, which makes the result harder to match to expectations.

    3. Observations Compared with Closed-Source Models

    On standard pages such as the login page, the two model types performed similarly. The gap appeared mainly in list filtering and form linkage. The better-performing model matched field relationships and validation rules more accurately, and it missed fewer features.

    Generation time was affected by queueing. On free compute, requests queued noticeably during peak hours. This lengthened the wait for complete projects and slowed iteration. This finding comes from individual tests and does not represent all time periods or service conditions.

    The gap comes from how natural-language requirements map to code logic. The model must understand the relationships between fields and turn them into state and validation code. Two approaches can help:

    1. Provide structured constraints in the prompt, stating what each requirement must implement and which default approaches it must not use.
    2. Use retrieval-augmented generation (RAG) to put the team’s form standards, component usage, and existing code into the context, so the model can follow established patterns.

    The following is an example of a structured prompt. The file names are placeholders. Replace them with your team’s own files:

    1. [Role] You are a front-end architect familiar with React and form engineering.
    2. [Task] Generate the product list page based on requirements/list.md, including routing, the list, filters, and pagination.
    3. [Constraints]
    4. 1. Bind each filter to page state and pass it to the list API as a query parameter.
    5. 2. Validate phone numbers with the regular expression defined in the requirements, not a generic rule.
    6. 3. After generation, list the completion status of each acceptance item. For any incomplete item, explain why.
    7. [Context] Follow the validation and error message conventions in the team's form standards, forms.md.
    8. [Fallback] If a requirement cannot be implemented, output a question for confirmation instead of making assumptions.

    This article did not measure the prompt’s effect before and after, so it cannot give a specific improvement figure. In testing, this kind of structured prompt reduced some omissions but did not eliminate them.

    4. Value and Risks of Open-Source Models

    Open-source models offer several practical benefits to front-end teams:

    1. Private deployment: Teams with compliance requirements can run the model in their own environment, so requirements documents and business code stay inside the internal network. The cost is GPU resources, operations work, and the effort of upgrading models.
    2. Community feedback: Public issue reports and evaluation sets help identify defects in specific scenarios, such as form validation. Teams should still validate with their own requirements and not rely only on public conclusions.
    3. Customizability: Teams can fine-tune on their own data or add constraints, so the model fits their internal component libraries and coding standards.

    Open-source models also carry risks that teams should assess in advance:

    • License terms: Model licenses differ in how they restrict commercial use, redistribution, and the use of training data. Have legal counsel confirm the terms before release.
    • Code security: Generated code may contain unsafe patterns, such as concatenating user input directly or putting secret keys in front-end code. Pair generation with static analysis and manual review.
    • Maintenance responsibility: Updating the model version can change the generated output. Record the version in use, and rerun the acceptance cases after every upgrade.

    Enterprises can decide how to deploy based on their existing cloud platforms, container environments, and security tools.

    5. Practical Recommendations

    Based on this test, teams adopting LLM-generated front-end projects can follow these practices:

    • Break requirements into acceptance items, each tied to one specific page behavior.
    • Fix the model version and key parameters so that results can be reproduced.
    • Run the local preview first, then verify each item. Do not judge the result by screenshots alone.
    • Assign manual rewriting or close review to modules such as login authentication, permission control, and amount calculation.
    • Log the failed cases from each generation and gradually build the team’s own evaluation checklist.

    LLMs can build basic pages quickly, but complex interactions and detailed validation still need human review. Whether to adopt them, and how far, depends on the team’s requirement complexity, compliance obligations, and iteration pace.