<SizeGuide>
The native “Size guide” button: “Size guide” → “Calculating your size…” → “Your size: M”.
function SizeGuide({ product, variant = "link", label, style, onRecommendation }: SizeGuideProps)productstringRequiredvariant"link" | "button"Optional"link" (default): link-sized text with the mark. "button": a small bordered button.
labelstringOptionalYour own words instead of "Size guide".
styleStyleProp<ViewStyle>OptionalonRecommendation(r: Recommendation) => voidOptionalThe shopper's recommended size, on show and on every change (sizes only).
Example
Section titled “Example”<SizeGuide product="SKU-123" onRecommendation={(rec) => rec.status === "ready" && !touched && setSize(rec.size)}/>// SwiftUI, where your "Size guide" link wasSizeGuide(client: tys, product: "SKU-123") { rec in if rec.status == .ready, !touched { selectedSize = rec.size }}// Compose, where your "Size guide" link wasSizeGuide(tys, "SKU-123", textStyle = MaterialTheme.typography.bodyMedium) { rec -> if (rec.status == Recommendation.Status.READY && !touched) selected = rec.size}const SizeGuide(product: 'SKU-123') // listen to tys.onRecommendation to preselectWas this page helpful?
Thank you. We read every answer.