Sakani

Product Options

The controls on a product detail page: price, swatches, sizes, quantity, stock, and wishlist.

Sand · M · ×1

Unavailable, not missing

ColorSwatch and SizeSelector both take available rather than expecting you to filter the list. Showing a greyed-out XL tells someone the size exists and is sold out; omitting it leaves them wondering whether you stock it at all.

Price

$38.00
$38.00$28.00Save 27%

Stock status

The wording and colour come from the number, so three states can't drift out of sync with the inventory count driving them.

In stockOnly 3 leftOut of stock

Sizes and quantity

Sand · M · ×1

PriceDisplay props

PropTypeDefaultDescription
pricenumberCurrent price, as a raw number.
compareAtPricenumberThe was-price; switches to the sale treatment.
showBadgebooleanfalseAdds a "Save X%" badge computed from the two prices. No-op without compareAtPrice.
formatPrice(amount: number) => stringOverride the default USD formatting.

The option controls

PropTypeDefaultDescription
ColorSwatchcolor, label, selected, available, onSelectlabel is the accessible name — colour alone isn't one. available={false} renders it disabled rather than hiding it, so people can see the option exists.
SizeSelectorsize, selected, available, onSelectSame pattern: unavailable sizes stay visible but unclickable.
QuantitySelectorquantity, onQuantityChange, min, max, labelControlled. label names the group for screen readers, so include the product.
StockStatusquantity, lowStockThreshold, labelDerives its own text and colour from the number; lowStockThreshold defaults to 5. label overrides the text but keeps the derived colour.
WishlistButtonsaved, onToggle, labelonToggle receives the new saved state.