AI-Generated Frontend Pages: What Works and What Still Requires Human Review
Large language models can quickly generate frontend scaffolding, basic form behavior, state management, and components such as carousels. They are useful for early project structure and repetitive UI work, but they often miss multi-dimensional filtering, dependent fields, and complex validation rules. This article examines their performance across login, product-list, and complex-form pages, and provides practical testing, review, and deployment guidelines.
Key Takeaways
- Large language models can quickly build page scaffolding, including form submission, state management, and basic features such as carousels. They are well suited to generating structural code during the early stages of a project.
- When requirements include multi-dimensional filtering, dependent fields, and validation rules, models often miss interaction logic. A generated page may look complete while behaving differently from the requirements.
- Generated interfaces tend to use generic visual styles. They may be suitable for internal tools or prototypes, but design and engineering reviews are still required before delivering them to end users.
Scope: These conclusions are based on three types of enterprise back-office pages and do not represent model performance across every business scenario.
1. Designing a Frontend Generation Test
To evaluate the engineering capabilities of large language models for frontend generation, we designed a project covering common enterprise back-office use cases. It included three pages:
- A user login page
- A product list page
- A complex form page
The requirements document specified the page structure, interaction logic, field validation rules, and filtering conditions. It did not specify a frontend framework. Instead, the model was allowed to select a mainstream component-based framework.
This setup is closer to a real development environment. It also tests how accurately a model can convert natural-language requirements into structured code.
2. How Well Do Models Generate Basic Pages?
The login page produced the best results. The model identified the key elements in the requirements and generated basic functionality such as form submission and state management. It also provided a working implementation for the carousel described in the requirements.
In addition, the model supplied an accessible preview URL rather than isolated code fragments.
This suggests that models already have a degree of engineering organization capability when working on basic pages. However, an accessible preview does not mean the code is ready for production. Generated code still requires manual code review, security checks, and regression testing before release.
If a preview page is exposed externally, the team must also verify that access permissions and data sources comply with applicable requirements.
3. Why Does Complex Logic Often Fail?
The model’s performance declined noticeably on the product list and complex form pages.
On the product list page, the requirements described multiple filtering dimensions and dynamic interactions in detail. The generated page had the correct overall structure: the table, pagination, and layout were all present. However, none of the filtering options were implemented.
Similar issues appeared in several list-page scenarios. This indicates that models often capture the visual structure of a page without mapping data-driven interaction behavior into executable code.
The complex form page could run, but several dependent validations and interaction details did not follow the requirements. For example, suppose the requirements state that after a user selects an enterprise account, the business license number becomes mandatory and must pass an 18-character format check.
The generated code might implement the format validation but fail to update the field’s required status. These issues are more common in long requirements documents because the model must preserve dependencies between multiple fields at the same time.
4. How to Evaluate Code Quality and Visual Style
Descriptions such as “ordinary” or “adequate” are subjective. The following observable indicators provide a more consistent way to evaluate generated frontend code:
- Component library usage: Does the implementation reuse a mature component library, or does it contain many hand-written basic controls?
- Project structure: Are pages, components, API requests, and utility functions separated into appropriate layers?
- Maintainability: Is state managed consistently? Has duplicated code been extracted?
- Accessibility: Do forms include labels? Can buttons and input fields be operated with a keyboard?
- Visual consistency: Are spacing, typography, and colors based on shared design variables?
By these measures, model-generated code can be useful from an engineering perspective and can improve development efficiency. It should not yet be treated as a finished product for direct delivery.
5. Reproducing and Comparing Test Results
When comparing different models, tests should be conducted under the same conditions. Each test should record:
- Model name and version
- Frontend framework
- Length of the requirements document
- Full prompt text
- Whether multiple rounds of fixes were applied
- Runtime environment
- Pass or fail results for every acceptance case
Generation time should be measured from the moment the request is submitted until runnable code is available. Measurements should be repeated and averaged.
Without these records, it is only appropriate to describe observed behavior. The results should not be used to establish an absolute ranking among models.
6. Implementation Steps and an Actionable Checklist
- Define the capability boundary. Use the model to build project scaffolding and repetitive UI code. Have engineers design complex business logic, with the model implementing only clearly defined local components.
- Integrate the standard development workflow. Generated code should enter the organization’s existing source control, container deployment, and CI/CD pipelines. After release, logs, monitoring, and alerts should be used to observe runtime behavior.
- Create structured prompts. Break requirements into page lists, field tables, state descriptions, and API definitions, then provide these parts to the model in a structured way.
A prompt template should include the following fields:
- Page objective and user roles
- Component list and hierarchy
- Field table: name, type, required status, validation rules, and dependent fields
- Interaction events: trigger conditions, prerequisite state, and resulting state
- API definitions: request parameters, response structure, and error-handling behavior
- Restrictions, such as not introducing third-party dependencies outside the requirements
Recommended CI checks include:
- Type checks and code-style checks pass
- Dependency scanning finds no high-severity vulnerabilities
- Unit tests cover validation functions and dependent-field logic
- Build artifact size and dependency count remain within predefined limits
Acceptance cases for form and list pages can be written as follows:
- After selecting an enterprise account, the business license number becomes required.
- When an invalid license number is entered, the submit button is disabled and an error message is displayed.
- After the filter conditions change, the list data matches the selected filters.
- After all filters are cleared, the list displays the complete dataset again.
Dependent fields can be described in the following format, which is easier for both models and testers to understand:
Field: account_type (single choice: individual/enterprise)Field: license_no (text, 18 characters)Rule: When account_type is enterprise, license_no is required and must match the 18-character unified social credit code formatAcceptance: When account_type switches to individual, license_no is no longer required, and any error message is cleared
7. Risk Considerations
Generated code may contain snippets with unclear licenses. Their source and licensing terms should be verified before they are introduced into a project.
Dependency packages may also contain known vulnerabilities, so automated scanning should be included in the CI pipeline.
If the requirements document or page data contains personal information, the team should review the model service’s data-processing terms and redact sensitive information when necessary.
Preview URLs should be protected with access controls to prevent unauthorized access to test environments.
Large language models can already handle the initial setup of frontend projects. Complex business logic still requires human design, review, and acceptance testing.
