Post Listing Wizard React block for Tailwind CSS v4
v1.0.1Updated in 1.9.0
A React post listing wizard for marketplaces: category, details, photos, price, place, contact and a preview, with an autosaved draft.
Pick the category from icon tiles (drill down, Back, or type to search and press Enter for the first match); a fresh pick shows the path as a chip with Change and moves on by itself, and a title typed before offers Looks like it belongs in Bicycles. Continue (or Enter in a field, Cmd/Ctrl+Enter in the description) checks the step: errors appear under the fields, the stepper marks the step with !, the button shakes and focus goes to the first problem. Details has the title with a 70 character counter, the condition as radio cards, the category's own fields (selects open as bottom sheets on phones) and the description. Photos takes up to 8 photos by drop, picker, camera or paste, each uploads with progress (a failed one offers Retry), drag or Space and the arrow keys reorder them and the first is badged Cover. Price switches between fixed, negotiable, free and swap, shows similar ads' range and the delivery switch. Location is the Romanian address form with Show the exact location. Contact prefills the account. Preview shows the ad as a grid and a list card and a summary whose Edit links go back to a step; Publish ad spins, then the success view with a bouncing check, View ad, Post another ad and the promotion packages. A failed publish shows an alert and keeps the draft. Completed steps in the stepper are clickable; Back never validates. Every change is saved to local storage after a moment (Draft saved 3 s ago); a reload restores it with an alert and Start over, and photos that only lived in the page are dropped with a note. Discard asks before deleting a draft. On phones the wizard fills the screen under the shell's header, with the compact progress on top and Back / Continue pinned above the safe area. Under reduced motion steps crossfade and the check just appears.
Post Listing Wizard is a Pro React block in the React blocks category, written in TypeScript for React 19 and Tailwind CSS v4. It installs as source with npx wingo-ui@latest add post-listing-wizard, together with Address Input, Alert, Alert Dialog, Badge, Button and 23 more and the npm packages react-hook-form, zod, motion and lucide-react.
Add to a project
Requirements: React 19 and Tailwind CSS v4, in Next.js (App Router or Pages), Vite or React Router. Installation guide · Next.js setup · Vite setup
npx wingo-ui@latest add post-listing-wizardPost Listing Wizard is part of Pro, with 298 more Pro items: $8 a month or $150 once. 14-day refund before you download any Pro item. See plans
Usage
Import PostListingWizard from @/components/blocks/post-listing-wizard.
// app/(market)/post-ad/page.tsx (the shell lives in the layout with variant="minimal"; mount <Toaster /> once there)
"use client"
import { useRouter } from "next/navigation"
import { PostListingWizard } from "@/components/blocks/post-listing-wizard"
export default function PostAdPage() {
const router = useRouter()
return (
<PostListingWizard
user={{ name: "Emma Carter", phone: "+40745123456", email: "emma.carter@acme.com", locality: "Cluj-Napoca" }}
onUpload={async (file, { signal }) => {
const body = new FormData()
body.append("photo", file)
const response = await fetch("/api/photos", { method: "POST", body, signal })
return response.json() // { url }
}}
onPublish={async (draft) => {
const response = await fetch("/api/listings", { method: "POST", body: JSON.stringify(draft) })
if (!response.ok) throw new Error("We could not publish your ad. Please try again.")
return response.json() // { id, url }
}}
onCancel={() => router.push("/")}
/>
)
}Props
categoriesCategoryNode[]The category tree (POST_LISTING_SAMPLE.categories: the 12 marketplace categories with their subcategories and counts). Only leaves can be picked.
attributesRecord<string, CategoryAttributeDef[]>The Details fields per leaf category id (POST_LISTING_SAMPLE.attributes: Bicycles, Mobile phones, Apartments). CategoryAttributeDef = { id, label, type: "select" | "text" | "number", options?, required?, unit? }.
priceHintsRecord<string, { min: number; max: number }>Similar ads' price range in RON per category id, shown under the price (POST_LISTING_SAMPLE.priceHints: Bicycles 900 to 1,500 RON).
draftListingDraftThe ad being written, controlled; pair it with onDraftChange. ListingDraft = { category, categoryPath, title, condition, attributes, description, photos: UploadFile[], priceType, price, currency, location: { county, locality, address?, showExact }, contact: { name, phone, hidePhone, chatOnly }, delivery }.
defaultDraftListingDraftThe starting draft, uncontrolled. Default: an empty ad with the contact and the place taken from user (createEmptyListingDraft). POST_LISTING_SAMPLE.draft is the filled l01 bike.
onDraftChange(draft: ListingDraft) => voidEvery change to the draft.
stepPostListingStepThe current step, controlled; pair it with onStepChange.
defaultStepdefault"category""category" | "details" | "photos" | "price" | "location" | "contact" | "preview"The starting step; the steps before it count as done. The playground fills the l01 bike for every step past the first.
onStepChange(step: PostListingStep) => voidCalled with the new step on every change.
user{ name: string; phone: string; email: string; locality: string }The signed-in seller: prefills Contact and the place, shows the email read only (POST_LISTING_SAMPLE.user: Emma Carter, +40745123456, emma.carter@acme.com, Cluj-Napoca).
persistKeydefault"post-listing-draft"stringLocal storage key of the autosaved draft and step; "" keeps it in memory. The demo uses demo:post-listing and a Delete draft button in the header.
maxPhotosdefault8numberThe most photos an ad takes; more are rejected with the upload's message.
requirePhotodefaulttruebooleanFotografii needs at least one photo to continue.
promotions{ id: string; label: string; price: number; description?: string; featured?: boolean }[]The promotion offer after publishing (POST_LISTING_SAMPLE.promotions: No promotion, 7 days 29 RON, 30 days 79 RON Most popular, Auto refresh 15 RON). [] hides it.
ctaTonedefault"neutral""neutral" | "brand" | "success" | "warning" | "danger" | "info"Publish ad, View ad and Promote (brand in the examples).
onUpload(file: File, context: { signal; onProgress }) => Promise<unknown>Uploads one photo; resolve with { url } so the photo shows after its step and survives a reload. Default: a pretend 1,2 s upload with progress that resolves with an object url.
onPublish(draft: ListingDraft) => Promise<{ id: string; url: string }>Publishes the ad. The button spins while it runs; a rejection shows its message in an alert and keeps the draft. Default: a pretend 1,2 s request.
onPromote(promotion: PostListingPromotion, listing: { id; url }) => (void | Promise<unknown>)Buys the chosen package. A rejection shows its message. Default: a pretend request, then a toast.
onCancel() => voidAfter Discard deleted the draft (leave the page here). Default: a toast.
defaultPublished{ id: string; url: string } | nullOpens on the success view for defaultDraft, as if it had just been published (the promotion example).
labelsPartial<PostListingWizardLabels>Every visible string (DEFAULT_POST_LISTING_WIZARD_LABELS, Romanian), counted ones as functions; nested validation, categoryPicker, fileUpload, addressInput, phoneInput, currencyInput and listingCard for the composed items. POST_LISTING_WIZARD_LABELS_EN is the English set.
localedefault"en-US"stringIntl locale for prices, counts, sizes and dates.
currencydefault"RON"stringThe empty draft's currency; the price field switches between RON and EUR.
tonedefault"neutral""neutral" | "brand" | "success" | "warning" | "danger" | "info"The stepper, Continue, the selected category, radio cards, switches and upload progress.
radiusdefault"md""sm" | "md" | "lg"The form panel 12 / 16 / 24px, its tiles, the radio cards, the photo tiles and the listing cards.
loadingdefaultfalsebooleanThe stepper and the category tiles as skeletons.
animateIndefaulttruebooleanThe header and the form rise in once when the page mounts on the client (never over server HTML, never with reduced motion).
linkComponent(props: LinkComponentProps) => ReactNodeThe router link for View ad and the terms. Default: the provider's (the shell's), then <a>.
classNamestringClasses for the root.
classNamesPartial<Record<"header" | "panel" | "wizard" | "success" | "promote", string>>Classes for the parts.
Parts
createEmptyListingDraft
functionReturns an empty ad for a seller, with the contact and the place filled from their account and the price in the given currency.
DEFAULT_POST_LISTING_WIZARD_LABELS
constantEvery English string of the seven steps, the preview, the draft and the publish states. Spread it and override what you translate.
POST_LISTING_WIZARD_LABELS_EN
constantAn alias of DEFAULT_POST_LISTING_WIZARD_LABELS, kept so older imports keep working.
POST_LISTING_SAMPLE
constantThe demo content: categories, attributes per category, price hints, promotions, the seller, photos, a ready draft and a rough draft. Replace it with your own data.
POST_LISTING_NOW
constantThe fixed "now" of the sample (September 24, 2026, 4:40 PM), so the autosave times render the same on server and client.
Examples
Details with errors
A rushed bike ad: Continue shows every problem and focuses the title.
Photos
Four uploaded photos; drag or use Space and the arrows to reorder, the first is the cover.
Preview
The l01 bike as buyers see it in a grid and a list, with the summary and Edit links.
Published, with the promote offer
The success view with brand actions; pick a package and press Promote.
Publish fails
The pretend server rejects: an alert under the summary, the draft stays.
Euro, en-GB
The price step with a euro amount and en-GB formatting.
Loading
The stepper and the category tiles as skeletons.
Dependencies
Files
- components/blocks/post-listing-wizard.tsx
- components/blocks/post-listing-wizard-data.ts
FAQ
Is the React Post Listing Wizard block free?
The preview, props and docs are free; copying the source needs a Pro plan. See plans.
How do I install Post Listing Wizard?
Run npx wingo-ui@latest add post-listing-wizard. It also adds the Wingo UI items it builds on (Address Input, Alert, Alert Dialog, Badge, Button and 23 more) and the npm packages react-hook-form, zod, motion and lucide-react. With shadcn, add the @wingo-ui registry with your API key, then run npx shadcn@latest add @wingo-ui/post-listing-wizard.
How does Post Listing Wizard behave on phones?
Details has the title with a 70 character counter, the condition as radio cards, the category's own fields (selects open as bottom sheets on phones) and the description. On phones the wizard fills the screen under the shell's header, with the compact progress on top and Back / Continue pinned above the safe area.