Skip to content

The Open Standard for Generative UI

4.1 KB
Raw Blame
root = Stack([header, main], "column", "l")
header = Card([headerText], "clear")
headerText = TextContent("Product Details", "large-heavy")
main = Stack([topRow, detailsRow], "column", "l")
topRow = Stack([galleryCard, buyCard], "row", "l", "start", "start", true)
galleryCard = Card([galleryHeader, gallery], "card")
galleryHeader = CardHeader("AeroStride Runner Sneakers", "Lightweight daily trainers with responsive cushioning")
gallery = ImageGallery(galleryImages)
buyCard = Card([buyHeader, priceRow, separator1, sizeForm, separator2, colorCard, separator3, ctaButtons, finePrint], "card")
buyHeader = CardHeader("AeroStride Runner", "Men's / Women's • Road & casual")
priceRow = Stack([priceText, priceTag], "row", "m", "center", "between", true)
priceText = TextContent("$129.00", "large-heavy")
priceTag = Tag("In stock", "check", "md", "success")
separator1 = Separator("horizontal", true)
sizeForm = Form("select_size", [sizeField])
sizeField = FormControl("Size", Select("size", sizeOptions, "Select your size...", ["required"]))
sizeOptions = [SelectItem("7", "US 7"), SelectItem("7.5", "US 7.5"), SelectItem("8", "US 8"), SelectItem("8.5", "US 8.5"), SelectItem("9", "US 9"), SelectItem("9.5", "US 9.5"), SelectItem("10", "US 10"), SelectItem("10.5", "US 10.5"), SelectItem("11", "US 11"), SelectItem("12", "US 12")]
separator2 = Separator("horizontal", true)
colorCard = Stack([colorTitle, colorOptionsGroup], "column", "s")
colorTitle = TextContent("Color", "small-heavy")
colorOptionsGroup = RadioGroup("color", colorItems, "black_white", ["required"])
colorItems = [RadioItem("Black / White", "Classic contrast with white midsole", "black_white"), RadioItem("Sand / Gum", "Neutral upper with gum outsole", "sand_gum"), RadioItem("Slate / Neon", "Cool tones with neon accents", "slate_neon")]
separator3 = Separator("horizontal", true)
ctaButtons = Buttons([addToCartBtn, wishlistBtn], "row")
addToCartBtn = Button("Add to Cart", "action:add_to_cart_sneakers", "primary")
wishlistBtn = Button("Save", "action:save_sneakers", "secondary")
finePrint = TextContent("Free returns within 30 days. Ships in 1–2 business days.", "small")
detailsRow = Stack([detailsCard, specsCard], "row", "l", "start", "start", true)
detailsCard = Card([detailsHeader, detailsText, featureTags], "sunk")
detailsHeader = CardHeader("About this item", "Built for comfort from morning commutes to weekend miles")
detailsText = MarkDownRenderer(detailsMarkdown, "clear")
detailsMarkdown = "The **AeroStride Runner** blends breathable mesh with a supportive heel counter for a secure fit. A responsive foam midsole delivers soft landings and quick transitions, while the durable rubber outsole adds traction on city streets.\n\n**Fit note:** True to size. If you’re between sizes, consider going up 0.5."
featureTags = TagBlock(featureTagList)
featureTagList = ["Breathable mesh upper", "Responsive foam cushioning", "Rubber traction outsole", "Padded collar & tongue", "Everyday training"]
specsCard = Card([specsHeader, specsTable], "sunk")
specsHeader = CardHeader("Specs", "Materials, weight, and care")
specsTable = Table(specCols, specRows)
specCols = [Col("Detail", "string"), Col("Value", "string")]
specRows = [["Weight", "9.8 oz (US 9)"], ["Drop", "8 mm"], ["Upper", "Engineered mesh"], ["Midsole", "EVA-based foam"], ["Outsole", "High-abrasion rubber"], ["Care", "Spot clean; air dry"]]
galleryImages = [{src: "https://images.unsplash.com/photo-1542291026-7eec264c27ff?auto=format&fit=crop&w=1200&q=80", alt: "Sneakers angled side view", details: "Side profile showing breathable mesh and cushioned midsole"}, {src: "https://images.unsplash.com/photo-1528701800489-20be3c1ea3b1?auto=format&fit=crop&w=1200&q=80", alt: "Sneakers top view", details: "Top view highlighting laces and padded tongue"}, {src: "https://images.unsplash.com/photo-1600269452121-4f2416e55c28?auto=format&fit=crop&w=1200&q=80", alt: "Sneakers outsole view", details: "Rubber outsole pattern for traction"}, {src: "https://images.unsplash.com/photo-1519741497674-611481863552?auto=format&fit=crop&w=1200&q=80", alt: "Sneakers lifestyle shot", details: "Everyday styling in an urban setting"}]