V0

v0 Loading States: Prompt Empty and Error States Too

You paste a prompt into v0, get a clean dashboard, wire it to your API, and the first real request shows a blank white card for two seconds. Then a user with no data sees an empty table with headers and nothing else. Then the API fails and the page shows nothing at all. Every one of those moments was missing from the generated UI, and fixing them one at a time costs more than writing them into the prompt.

v0 loading states are the temporary placeholder UI a v0-generated component shows while its data is still being fetched, usually a skeleton that matches the final layout. They are one of four conditions every data view needs, and v0 will only build the ones you describe.

Why does v0 skip loading, empty and error states?

v0 skips them because your prompt describes a finished screen, and a finished screen has data in it. The model fills in what you asked for, and a sentence like "a table of invoices with status badges" describes exactly one condition: invoices exist and have loaded.

The other three conditions are not implied by that sentence. A model has no way to know whether you want a spinner, a skeleton or nothing, what an empty account should say, or whether a failed request should retry on its own. When it has to guess, it guesses the cheapest option, which is to render nothing special.

This is the same mechanism that produces generic components from AI UI builders: unspecified decisions get filled with the most average answer. States are simply the most commonly unspecified decision.

What are the four states every data view needs?

Every view that reads data needs four states: loading, empty, error and populated. Treat them as a set, and write one line in your prompt for each.

StateWhat the user seesWhat the user can do
LoadingA skeleton matching the final layoutNothing yet; the layout should not shift later
EmptyA short sentence explaining why nothing is hereOne primary action to create the first item
ErrorA plain message saying what failedRetry, and a way to reach support if it repeats
PopulatedThe data itselfThe normal actions for the view

The table is also a useful review tool. Open any generated screen and ask which of the four rows it covers. Most first generations cover one.

How do you write a prompt that produces all four states?

You write the populated view first, then add one short block that names the other three states and what each one contains. Keep the block separate from your layout description so the model treats it as a requirement, not a decoration.

Here is a template you can adapt. It follows the usual order of a good v0 prompt, goal first and constraints last, with a states block added at the end.

Build an invoices table for [PRODUCT NAME].

POPULATED: columns Customer, Amount, Status, Due date.
Status is a badge: paid, pending, overdue.

LOADING: show 6 skeleton rows with the same column widths.
No spinner. The table header stays visible.

EMPTY: replace the table with one sentence,
"No invoices yet", and a single button,
"Create invoice".

ERROR: replace the table with the message
"We could not load invoices" and a Retry button.
Keep the page header and filters in place.

TECHNICAL: Next.js app router, Tailwind, shadcn/ui.
Accept the state as a prop so I can wire it later.

The last line matters. Asking for the state as a prop gives you a component you can test in each condition without touching a real API.

How do you check that each state actually works?

You force each state by hand before you connect any data. A generated state that looks right in the preview can still be unreachable in code, so run through the same short routine every time.

  1. Ask v0 to expose a single prop or constant that switches between loading, empty, error and populated.
  2. Set it to loading and confirm the skeleton has the same height and column widths as the final table.
  3. Set it to empty and confirm the one action is visible without scrolling.
  4. Set it to error and confirm the page header and navigation are still on screen.
  5. Switch back to populated and confirm nothing jumped. Layout shift between loading and populated is the most common visible defect.

If a state fails, regenerate only that block with a one-line instruction. Do not regenerate the whole screen, because you will lose the parts that already work. A full regenerate can change unrelated styling, since v0 does not promise the same output twice.

Where should real loading logic live?

Real loading logic should live in your framework, not in the generated component. In the Next.js app router, a loading.js file next to a route shows a fallback while the route segment streams, as described in the Next.js loading.js documentation. React's Suspense component does the same job at a finer grain, wrapping one part of the tree and showing a fallback until it is ready, per the React Suspense reference.

That gives you a clean split. v0 designs what the skeleton looks like, and the framework decides when it appears. Ask v0 for a skeleton component with no data fetching in it, then pass it as the fallback.

Doing this by hand for every table, card list and chart in an app gets repetitive. Writing the same four-state block for each screen, and keeping the wording and spacing consistent between them, is where most of the time goes. BuyCoded's v0, Lovable and Bolt prompt pack sells ready-made prompts where you fill in bracketed placeholders such as brand name, primary color and product description. Each prompt carries a TECHNICAL line naming the libraries it assumes, so you can swap in your own stack.

Is it worth asking for states in the first prompt?

Yes, because the first prompt is the cheapest place to add them. Adding states afterward means a second or third generation, and every extra generation risks changing styling you already approved.

The honest objection is length. A states block adds five or six lines to a prompt, and short prompts feel faster. In practice the extra lines replace a round of follow-up messages, so the total effort goes down, not up. If a screen is a throwaway prototype that will never see real data, skip the block and say so in the prompt.

Two things are worth keeping in mind. First, an empty state is a conversion moment: it is the first thing a new user sees, so it should name one action. Second, an error state should never blame the user, and should always offer a retry.

What should you do next?

Take the screen you are building now, add the four-line states block from the template above, and generate it once. Then, if you want the same discipline across every screen without writing it each time, browse the BuyCoded product catalog, pick the prompt pack that fits your builder, and download it. Your files are available right after checkout.

Frequently asked questions

Why does v0 not add loading states by default?

v0 does not add loading states because your prompt usually describes a finished screen with data in it. The model fills in what you asked for and has no signal about spinners, skeletons or failures. Naming each state in the prompt turns the unspecified guess into an explicit requirement the model can follow.

Should I use a spinner or a skeleton in v0?

Use a skeleton when the final layout is known, such as a table or card list, because it keeps the page from shifting when data arrives. Use a small spinner only for short actions with no predictable shape, such as a button press. State your choice in the prompt, since v0 will otherwise pick for you.

How do I make v0 show an empty state?

Add a line to your prompt that says what replaces the data when none exists. Give one short sentence and one primary action, for example the text No invoices yet and a Create invoice button. Without that line, v0 usually renders table headers or an empty container with nothing to guide the user.

Can I add error states to an existing v0 component?

Yes. Ask v0 to add an error state to the existing component and describe the message and the retry action. Keep the request narrow and say what must stay unchanged, such as the header and filters. A narrow request is less likely to alter styling you already approved than a full regeneration.

Where should the real loading logic go in a Next.js app?

Put it in the framework. A loading.js file beside a route shows a fallback while that segment streams, and a Suspense boundary does the same for a smaller part of the page. Let v0 design the skeleton component, then pass it as the fallback instead of embedding fetching inside it.