Generating Frontend Projects with LLMs: Results and Capability Boundaries
Large language models have moved beyond single-line code completion to generating entire frontend projects. Some tools claim they can produce deployable frontend applications directly from requirement documents, but how well they perform in complex business scenarios still needs verification. This article uses a sample requirement covering three typical pages—login, list, and form—to document how the model performed on each and to offer engineering practices you can apply. Backend API implementation and performance testing are out of scope.
1. Test Scope and Evaluation Criteria
The test sample was a frontend requirements document targeting React, covering three typical pages: login, list, and form. Each requirement in the document was treated as an acceptance item.
The original test did not record the following information: the model name and version, the length of the requirements document, the versions of React and the build tools, or the runtime environment. Therefore, this article describes observed behavior and likely causes only, and makes no judgment about the relative quality of specific models. If you want to reproduce the test, record these details first.
When evaluating, mark each acceptance item as “implemented,” “partially implemented,” or “not implemented.” “Implemented” means the page is visible and the interaction behaves as required. A page that only looks right but lacks the corresponding behavior counts as “partially implemented.”
2. Login Page: The Skeleton Is Usable
The carousel, basic input fields, and buttons on the login page were all generated completely. The model also provided a working preview URL, which indicates the project already had a basic build configuration. For this kind of page, the model’s output can serve directly as a starting point for iteration—developers don’t need to scaffold the project from scratch.
However, a visible page is not the same as a working feature. During acceptance, you still need to check whether form submission actually calls the login API, whether empty inputs trigger validation messages, and whether a failed login produces correct feedback.
3. List Page: Filtering Exists Only in Appearance
The list page had the most obvious problems in this test. The requirements called for status filtering and date-range search, along with specific data-request logic after filtering. The model generated the static structure of the list, but the filter controls were not wired to the data requests—the core filtering functionality was missing.
This is a typical failure mode: the model interprets “filtering” as a set of dropdowns and date pickers without defining any state for them. The essence of a list page lies in:
- The mapping between filter conditions and backend API parameters;
- Whether the pagination state resets when filters change;
- Loading indicators during requests, and how empty results are displayed.
To verify, check whether the code contains an explicit query parameters object, whether the controls’ change events update it, and whether the request function reads from it. If any of the three is missing, that filter can be judged as not implemented.
The recommended fix is to define the query state explicitly first, then generate the view layer. For example:
interface ListQuery {status?: 'open' | 'closed';startTime?: string;endTime?: string;page: number;pageSize: number;}
Once the state structure is clearly defined, the view layer only needs to read and update it, and the logic becomes much easier to verify.
4. Form Page: Conditional Validation Is Easily Lost
The form page ran overall, but fine-grained requirements were incompletely reproduced. The requirements stated that when field A reaches a certain value, field B becomes required and must match a specific regex. The validation logic generated by the model was either too lenient or inconsistent with the requirements.
A plausible explanation is that constraints in a long document are scattered across multiple paragraphs, and the model may have missed some of them during generation. This hypothesis has not been validated through controlled experiments, so treat it as an assumption. Regardless of the cause, the outcome can be confirmed through testing.
Design at least three test cases for each conditional rule:
- The trigger value is selected and field B is empty—a required-field message should appear;
- Field B does not match the regex—a format error message should appear;
- Field A is switched to another value—the required state of field B should be cleared.
Only when all three types of cases pass can the conditional rule be considered correctly implemented. The third case is nearly impossible to catch from appearance alone.
5. Differences Between Models
Differences between models are observable, but because the original test lacked uniform comparison conditions, no quantitative conclusions can be drawn. The observable differences center on the generated code itself. Better outputs typically include complete state fields, event handlers, and validation branches. Weaker outputs lack these parts—the view exists, but the logic is incomplete.
If you want to run a comparison, use the same requirements document and the same acceptance checklist, and record three metrics: generation time, the number of acceptance items passed, and the number of code lines requiring manual fixes.
6. Engineering Practices
1. Split requirements and shrink the scope of each generation
Do not generate an entire system from one long prompt. Break the requirements down by page or component, and give the model one clearly scoped task at a time. A prompt can include the following:
Role: a frontend engineer familiar with React and TypeScriptInput: list query parameters and the API response structureOutput: the list page component and its query state management code====================Task requirements====
With a bounded scope, the model’s output is easier to review, and gaps in logic are easier to catch during acceptance.
