Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Sold Out Size Error Block for React

A full-screen page for a sold-out size: a drawn sweater, a row of five sizes with the sold-out ones struck, a notify field and Shine Button that follow the chosen size, and two similar knits in stock.

Framework
UI library

Preview

Preview width

Installation

Part of Pro
Pro unlocks the code and one-line install of every Pro button and text effect, plus the MCP for your AI editor.
Have Pro already? Sign in to open it.Opens here as soon as you're Pro.

Overview

Keep the sale alive when a size is gone with this sold out page for React with Base UI. It's the screen Alderwool, a knitwear brand, shows when the size a shopper wanted is sold out: the page's two side rails run its full height and one band crosses the screen between two rules, split in two with the picture first. The picture is a greyscale sweater drawn in SVG, solid when the chosen size is in stock and a dashed twin that fades in when it isn't. A row of five sizes, a Toggle Group, strikes the sold-out ones and marks them Out. What sits under the row follows the chosen size: for a sold-out one, when it is expected (counted from a typed date against a fixed day) and an email Field; for one in stock, how many there are. The Shine Button follows too, Notify me when Medium is back or Add Small to bag. Under the split, two drawn knits that are in stock in the chosen size. For any shop with sizes.

FAQ

What stays in the page, and how do I make it real?

Everything. Notify checks the email, waits a moment and says in a polite status line that the shopper is on the list in this demo and that no email will be sent; Add to bag only records the choice. Stop notifying and Take out put each back. To make it real, send the size and the email from submit to your stock service and read stock, dates and the similar knits from your catalog.

How are sold-out sizes shown without colour?

Three ways at once: the size's letter is struck through, a small word under it says Out or In, and the chosen size is a solid fill. A screen reader hears each size named with its state ("Medium, sold out"). A sold-out size can still be chosen, because that is how you ask to be told.

Where does the expected date come from?

From a typed ISO date per size and one fixed "today", counted with UTC day numbers ("Expected 3 Dec 2026, in 49 days"). A size with no date says so. Nothing reads the clock, and the numbers are the same on the server and in every time zone.

How is the sweater drawn, and can I change it?

It is one SVG of a few paths in the text colour at low weights, hidden from assistive technology, with the facts in words beside it. The same drawing, with a cardigan collar and a roll neck, draws the two similar knits. The dashed twin is a second copy of the lines that fades in; no dash is animated, and nothing moves under reduced motion. Swap the paths for your own product shots, or keep the drawing as a placeholder.

How does it work with the keyboard?

The sizes are one single-choice toggle group: Tab reaches it, the arrow keys move between sizes and one is always chosen. The button's label and the field under the row follow the size; a refused notify moves focus to the email field and says what is wrong. The two similar knits are links in reading order after the form.

What changes on a phone?

The heading, the sizes, the email field and the button come first, so the button is on the first screen; the drawn sweater and the similar knits follow them.

  • Pro

    Booking Unavailable Error

    Plans and checkout

    A full-screen page for a time that was just taken: the booked slot as a struck chip, the next free times grouped by day, a Shine Button that follows the choice, and a waitlist switch that opens an email field.

  • Pro

    Payment Failed Error

    Plans and checkout

    A full-screen page for a declined card payment: the order, the bank's answer, four reasons that each change the fix, and three ways to pay, with a Shine Button that follows the method.

  • Pro

    Coupon Invalid Error

    Plans and checkout

    A panel for a promo code that no longer works: the failed code with why, the offers that do work for this box ranked by saving, and the box's total recomputed as you choose.

  • Pro

    A 404 page for a shipping dashboard that offers three guesses as radio rows, each showing its address with the changed part struck through or underlined and named in a word, and one button that opens the chosen guess.

  • Pro

    Subscription Required Error

    Plans and checkout

    A full-screen 403 for a feature the plan does not include: the facts, what Pro adds, and an editable message that asks the workspace owners, with a Viewing as demo control that turns the ask into an upgrade with the price worked out.

  • Pro

    A full-height page for a feature that is not on for your workspace yet: three conditions ruled from rail to rail, a rollout meter with the next wave, and a Switch that joins early access and flips the last condition.