Online shop: Product
4 sections between the top bar and the footer of the template.
Install
The blocks of this page, top bar and footer included:
npx ui8kit add nav-bar product-detail product-info review-list product-grid sitemap-footerBlocks: nav-bar, product-detail, product-info, review-list, product-grid, sitemap-footer
Preview
The sections of the page; the top bar and the footer have their own block pages.
Arc desk lamp
Warm, dimmable light with a weighted base.
$89
128 reviews
In stock
- Free shipping over 75 dollars
- Thirty-day returns
Product details
Description
A desk lamp with a long reach and a heavy base. The arm moves in three joints and stays where you leave it.
Materials
Powder-coated aluminium arm, steel base, linen-wrapped cable.
Care
Wipe with a dry cloth. The LED module lasts about 25,000 hours and can be replaced.
Shipping and returns
Ships within one working day. Thirty days to return it in the original box.
Specifications
- CategoryLighting
- Weight1.2 kg
- Size42 x 18 cm
- MaterialAluminium
- Warranty2 years
What buyers say
Great light for late work
Bright enough to read, soft enough to relax. The base stays put.
Dana Pierce
Mar 12, 2026
Solid and simple
Build quality is better than the price suggests.
Ravi Menon
Mar 03, 2026
Does the job
Easy setup. I would like one more color.
Elena Brandt
Feb 19, 2026
Popular right now
light
Arc desk lamp
128 reviews
Warm, dimmable light with a weighted base.
$89
bags
Field backpack
342 reviews
Water-resistant, 22 litres, fits a 16 inch laptop.
$129
audio
Studio headphones
87 reviews
Closed-back, 40 hour battery, wired and wireless.
$199
desk
Laptop stand
210 reviews
Aluminium, folds flat, six heights.
$49
desk
Desk mat
64 reviews
Felt top with a non-slip base, 90 by 40 cm.
$35
gifts
Gift card
19 reviews
Delivered by email, never expires.
$50
Code
The page as generated in the source monorepo (commit 6c20aba1e4be). It imports the blocks from the UI package and its texts and sample data from the app package; after installing the blocks, replace those imports with your own content.
Point the CLI at this runtime once, then add the blocks:
npx ui8kit init --yes --framework svelte --dir src --registry-url https://registry.buildy.tw/svelte --strict-cdnnpx ui8kit add nav-bar product-detail product-info review-list product-grid sitemap-footer<!-- Code generated by xgen. DO NOT EDIT. -->
<!-- Source: xgen/specs/screens/theme-commerce-shop.json -->
<!-- The product page of ThemeCommerceShopScreen. -->
<script lang="ts">
import {
ProductDetail,
ProductGrid,
ProductInfo,
ReviewList,
tpl,
uniqLabel,
type Detail,
type Product,
type Review,
type Spec,
} from "@ui8kit/svelte-ui";
import { fromCodex } from "@ui8kit/app-shared/runtime/core";
import { ui } from "@ui8kit/app-shared/content";
import { products as productsEntries } from "@ui8kit/app-shared/data/products";
import { reviews as reviewsEntries } from "@ui8kit/app-shared/data/reviews";
import { details as detailsEntries } from "@ui8kit/app-shared/data/details";
import { specs as specsEntries } from "@ui8kit/app-shared/data/specs";
const PRODUCTS_FIELDS = {
"id": "id",
"name": "title.en",
"summary": "metadata.summary.value",
"price": "metadata.price.value",
"currency": "metadata.currency.value",
"rating": "metadata.rating.value",
"reviews": "metadata.reviews.value",
"badge": "metadata.badge.value",
"category": "metadata.category.value",
"inStock": "metadata.inStock.value",
} as const;
const REVIEWS_FIELDS = {
"id": "id",
"title": "title.en",
"author": "metadata.author.value",
"rating": "metadata.rating.value",
"text": "metadata.text.value",
"date": "metadata.date.value",
} as const;
const DETAILS_FIELDS = {"id":"id","title":"title.en","text":"metadata.text.value"} as const;
const SPECS_FIELDS = {"id":"id","label":"title.en","value":"metadata.value.value"} as const;
const products = fromCodex<Product>(productsEntries, PRODUCTS_FIELDS);
const reviews = fromCodex<Review>(reviewsEntries, REVIEWS_FIELDS);
const details = fromCodex<Detail>(detailsEntries, DETAILS_FIELDS);
const specs = fromCodex<Spec>(specsEntries, SPECS_FIELDS);
</script>
<ProductDetail
id="product-product"
product={products.find((i) => i.id === "product-lamp")!}
labels={ui.commerce.detail}
badges={ui.commerce.badges}
layout="split"
mediaSide="start"
thumbs="below"
buy="full"
tone="default"
density="default"
/>
<ProductInfo
id="product-productinfo"
title={ui.commerce.info.title}
details={details}
specs={specs}
labels={ui.commerce.info}
layout="split"
expand="first"
tone="default"
landmarkLabel={uniqLabel(tpl(ui.blocks.landmark, ui.blocks.names.productinfo, ui.blocks.variants.productinfo.split))}
/>
<ReviewList
id="product-reviews"
title={ui.commerce.reviews.title}
reviews={reviews}
labels={ui.commerce.reviewLabels}
layout="list"
item="card"
avatar="none"
tone="default"
density="default"
landmarkLabel={uniqLabel(tpl(ui.blocks.landmark, ui.blocks.names.reviews, ui.blocks.variants.reviews.list))}
/>
<ProductGrid
id="product-products"
title={ui.commerce.products.title}
products={products}
labels={ui.commerce.productLabels}
badges={ui.commerce.badges}
layout="grid"
cols="1-3"
ratio="4/3"
rating="show"
action="button"
tone="default"
density="default"
landmarkLabel={uniqLabel(tpl(ui.blocks.landmark, ui.blocks.names.products, ui.blocks.variants.products.grid3))}
/>
Point the CLI at this runtime once, then add the blocks:
npx ui8kit init --yes --framework react --dir src --registry-url https://registry.buildy.tw/react --strict-cdnnpx ui8kit add nav-bar product-detail product-info review-list product-grid sitemap-footer// Code generated by xgen. DO NOT EDIT.
// Source: xgen/specs/screens/theme-commerce-shop.json
// The product page of ThemeCommerceShopScreen.
import {
ProductDetail,
ProductGrid,
ProductInfo,
ReviewList,
tpl,
uniqLabel,
type Detail,
type Product,
type Review,
type Spec,
} from "@ui8kit/react-ui";
import { fromCodex } from "@ui8kit/app-shared/runtime/core";
import { ui } from "@ui8kit/app-shared/content";
import { products as productsEntries } from "@ui8kit/app-shared/data/products";
import { reviews as reviewsEntries } from "@ui8kit/app-shared/data/reviews";
import { details as detailsEntries } from "@ui8kit/app-shared/data/details";
import { specs as specsEntries } from "@ui8kit/app-shared/data/specs";
const PRODUCTS_FIELDS = {
"id": "id",
"name": "title.en",
"summary": "metadata.summary.value",
"price": "metadata.price.value",
"currency": "metadata.currency.value",
"rating": "metadata.rating.value",
"reviews": "metadata.reviews.value",
"badge": "metadata.badge.value",
"category": "metadata.category.value",
"inStock": "metadata.inStock.value",
} as const;
const REVIEWS_FIELDS = {
"id": "id",
"title": "title.en",
"author": "metadata.author.value",
"rating": "metadata.rating.value",
"text": "metadata.text.value",
"date": "metadata.date.value",
} as const;
const DETAILS_FIELDS = {"id":"id","title":"title.en","text":"metadata.text.value"} as const;
const SPECS_FIELDS = {"id":"id","label":"title.en","value":"metadata.value.value"} as const;
const products = fromCodex<Product>(productsEntries, PRODUCTS_FIELDS);
const reviews = fromCodex<Review>(reviewsEntries, REVIEWS_FIELDS);
const details = fromCodex<Detail>(detailsEntries, DETAILS_FIELDS);
const specs = fromCodex<Spec>(specsEntries, SPECS_FIELDS);
export function ProductPage() {
return (
<>
<ProductDetail
id="product-product"
product={products.find((i) => i.id === "product-lamp")!}
labels={ui.commerce.detail}
badges={ui.commerce.badges}
layout="split"
mediaSide="start"
thumbs="below"
buy="full"
tone="default"
density="default"
/>
<ProductInfo
id="product-productinfo"
title={ui.commerce.info.title}
details={details}
specs={specs}
labels={ui.commerce.info}
layout="split"
expand="first"
tone="default"
landmarkLabel={uniqLabel(tpl(ui.blocks.landmark, ui.blocks.names.productinfo, ui.blocks.variants.productinfo.split))}
/>
<ReviewList
id="product-reviews"
title={ui.commerce.reviews.title}
reviews={reviews}
labels={ui.commerce.reviewLabels}
layout="list"
item="card"
avatar="none"
tone="default"
density="default"
landmarkLabel={uniqLabel(tpl(ui.blocks.landmark, ui.blocks.names.reviews, ui.blocks.variants.reviews.list))}
/>
<ProductGrid
id="product-products"
title={ui.commerce.products.title}
products={products}
labels={ui.commerce.productLabels}
badges={ui.commerce.badges}
layout="grid"
cols="1-3"
ratio="4/3"
rating="show"
action="button"
tone="default"
density="default"
landmarkLabel={uniqLabel(tpl(ui.blocks.landmark, ui.blocks.names.products, ui.blocks.variants.products.grid3))}
/>
</>
);
}
Point the CLI at this runtime once, then add the blocks:
npx ui8kit init --yes --framework vue --dir src --registry-url https://registry.buildy.tw/vue --strict-cdnnpx ui8kit add nav-bar product-detail product-info review-list product-grid sitemap-footer<!-- Code generated by xgen. DO NOT EDIT. -->
<!-- Source: xgen/specs/screens/theme-commerce-shop.json -->
<!-- The product page of ThemeCommerceShopScreen. -->
<script setup lang="ts">
import {
ProductDetail,
ProductGrid,
ProductInfo,
ReviewList,
tpl,
uniqLabel,
type Detail,
type Product,
type Review,
type Spec,
} from "@ui8kit/vue-ui";
import { fromCodex } from "@ui8kit/app-shared/runtime/core";
import { ui } from "@ui8kit/app-shared/content";
import { products as productsEntries } from "@ui8kit/app-shared/data/products";
import { reviews as reviewsEntries } from "@ui8kit/app-shared/data/reviews";
import { details as detailsEntries } from "@ui8kit/app-shared/data/details";
import { specs as specsEntries } from "@ui8kit/app-shared/data/specs";
const PRODUCTS_FIELDS = {
"id": "id",
"name": "title.en",
"summary": "metadata.summary.value",
"price": "metadata.price.value",
"currency": "metadata.currency.value",
"rating": "metadata.rating.value",
"reviews": "metadata.reviews.value",
"badge": "metadata.badge.value",
"category": "metadata.category.value",
"inStock": "metadata.inStock.value",
} as const;
const REVIEWS_FIELDS = {
"id": "id",
"title": "title.en",
"author": "metadata.author.value",
"rating": "metadata.rating.value",
"text": "metadata.text.value",
"date": "metadata.date.value",
} as const;
const DETAILS_FIELDS = {"id":"id","title":"title.en","text":"metadata.text.value"} as const;
const SPECS_FIELDS = {"id":"id","label":"title.en","value":"metadata.value.value"} as const;
const products = fromCodex<Product>(productsEntries, PRODUCTS_FIELDS);
const reviews = fromCodex<Review>(reviewsEntries, REVIEWS_FIELDS);
const details = fromCodex<Detail>(detailsEntries, DETAILS_FIELDS);
const specs = fromCodex<Spec>(specsEntries, SPECS_FIELDS);
</script>
<template>
<ProductDetail
id="product-product"
:product="products.find((i) => i.id === 'product-lamp')!"
:labels="ui.commerce.detail"
:badges="ui.commerce.badges"
layout="split"
mediaSide="start"
thumbs="below"
buy="full"
tone="default"
density="default"
/>
<ProductInfo
id="product-productinfo"
:title="ui.commerce.info.title"
:details="details"
:specs="specs"
:labels="ui.commerce.info"
layout="split"
expand="first"
tone="default"
:landmarkLabel="uniqLabel(tpl(ui.blocks.landmark, ui.blocks.names.productinfo, ui.blocks.variants.productinfo.split))"
/>
<ReviewList
id="product-reviews"
:title="ui.commerce.reviews.title"
:reviews="reviews"
:labels="ui.commerce.reviewLabels"
layout="list"
item="card"
avatar="none"
tone="default"
density="default"
:landmarkLabel="uniqLabel(tpl(ui.blocks.landmark, ui.blocks.names.reviews, ui.blocks.variants.reviews.list))"
/>
<ProductGrid
id="product-products"
:title="ui.commerce.products.title"
:products="products"
:labels="ui.commerce.productLabels"
:badges="ui.commerce.badges"
layout="grid"
cols="1-3"
ratio="4/3"
rating="show"
action="button"
tone="default"
density="default"
:landmarkLabel="uniqLabel(tpl(ui.blocks.landmark, ui.blocks.names.products, ui.blocks.variants.products.grid3))"
/>
</template>
Point the CLI at this runtime once, then add the blocks:
npx ui8kit init --yes --framework solid --dir src --registry-url https://registry.buildy.tw/solid --strict-cdnnpx ui8kit add nav-bar product-detail product-info review-list product-grid sitemap-footer// Code generated by xgen. DO NOT EDIT.
// Source: xgen/specs/screens/theme-commerce-shop.json
// The product page of ThemeCommerceShopScreen.
import {
ProductDetail,
ProductGrid,
ProductInfo,
ReviewList,
tpl,
uniqLabel,
type Detail,
type Product,
type Review,
type Spec,
} from "@ui8kit/solid-ui";
import { fromCodex } from "@ui8kit/app-shared/runtime/core";
import { ui } from "@ui8kit/app-shared/content";
import { products as productsEntries } from "@ui8kit/app-shared/data/products";
import { reviews as reviewsEntries } from "@ui8kit/app-shared/data/reviews";
import { details as detailsEntries } from "@ui8kit/app-shared/data/details";
import { specs as specsEntries } from "@ui8kit/app-shared/data/specs";
const PRODUCTS_FIELDS = {
"id": "id",
"name": "title.en",
"summary": "metadata.summary.value",
"price": "metadata.price.value",
"currency": "metadata.currency.value",
"rating": "metadata.rating.value",
"reviews": "metadata.reviews.value",
"badge": "metadata.badge.value",
"category": "metadata.category.value",
"inStock": "metadata.inStock.value",
} as const;
const REVIEWS_FIELDS = {
"id": "id",
"title": "title.en",
"author": "metadata.author.value",
"rating": "metadata.rating.value",
"text": "metadata.text.value",
"date": "metadata.date.value",
} as const;
const DETAILS_FIELDS = {"id":"id","title":"title.en","text":"metadata.text.value"} as const;
const SPECS_FIELDS = {"id":"id","label":"title.en","value":"metadata.value.value"} as const;
const products = fromCodex<Product>(productsEntries, PRODUCTS_FIELDS);
const reviews = fromCodex<Review>(reviewsEntries, REVIEWS_FIELDS);
const details = fromCodex<Detail>(detailsEntries, DETAILS_FIELDS);
const specs = fromCodex<Spec>(specsEntries, SPECS_FIELDS);
export function ProductPage() {
return (
<>
<ProductDetail
id="product-product"
product={products.find((i) => i.id === "product-lamp")!}
labels={ui.commerce.detail}
badges={ui.commerce.badges}
layout="split"
mediaSide="start"
thumbs="below"
buy="full"
tone="default"
density="default"
/>
<ProductInfo
id="product-productinfo"
title={ui.commerce.info.title}
details={details}
specs={specs}
labels={ui.commerce.info}
layout="split"
expand="first"
tone="default"
landmarkLabel={uniqLabel(tpl(ui.blocks.landmark, ui.blocks.names.productinfo, ui.blocks.variants.productinfo.split))}
/>
<ReviewList
id="product-reviews"
title={ui.commerce.reviews.title}
reviews={reviews}
labels={ui.commerce.reviewLabels}
layout="list"
item="card"
avatar="none"
tone="default"
density="default"
landmarkLabel={uniqLabel(tpl(ui.blocks.landmark, ui.blocks.names.reviews, ui.blocks.variants.reviews.list))}
/>
<ProductGrid
id="product-products"
title={ui.commerce.products.title}
products={products}
labels={ui.commerce.productLabels}
badges={ui.commerce.badges}
layout="grid"
cols="1-3"
ratio="4/3"
rating="show"
action="button"
tone="default"
density="default"
landmarkLabel={uniqLabel(tpl(ui.blocks.landmark, ui.blocks.names.products, ui.blocks.variants.products.grid3))}
/>
</>
);
}
Go templ is not installed by the CLI. Copy the files below into your Go module, together with these helper files from packages/templ/ui of the source (package utils):
- utils/cn_merge.go
- utils/dyn.go
- utils/expr.go
- utils/heading.go
- utils/tags.go
- utils/utils.go
- utils/variants_json.go
// Code generated by xgen. DO NOT EDIT.
// Source: xgen/specs/organisms/nav-bar.json
package blocks
import (
"github.com/codegen-x/ui8kit/packages/templ/ui/ui/block"
"github.com/codegen-x/ui8kit/packages/templ/ui/ui/box"
"github.com/codegen-x/ui8kit/packages/templ/ui/ui/container"
"github.com/codegen-x/ui8kit/packages/templ/ui/ui/grid"
"github.com/codegen-x/ui8kit/packages/templ/ui/ui/group"
"github.com/codegen-x/ui8kit/packages/templ/ui/ui/link"
linkplain "github.com/codegen-x/ui8kit/packages/templ/ui/ui/link-plain"
uiutils "github.com/codegen-x/ui8kit/packages/templ/ui/utils"
)
// NavBarProps are the props of NavBar; the values are the JSON shapes of the TypeScript props.
type NavBarProps struct {
Label any `json:"label"`
Brand any `json:"brand"`
Links any `json:"links"`
Current any `json:"current"`
Actions any `json:"actions"`
Search any `json:"search"`
Tone any `json:"tone"`
Layout any `json:"layout"`
Over any `json:"over"`
Skip any `json:"skip"`
LandmarkLabel any `json:"landmarkLabel"`
}
// A top bar in four shapes. Axes: layout (inline: brand left, links, button right; split: the brand in the middle with the links on both sides; search: a search field with its shortcut in the middle), over (none, media: the bar sits over a picture, transparent), actions mode (none, cta), tone (default, inverse: on a dark hero band). Turning solid on scroll is a port contract.
templ NavBar(p NavBarProps) {
{{ vLabel := p.Label }}
{{ vBrand := p.Brand }}
{{ vLinks := p.Links }}
{{ vCurrent := uiutils.Def(p.Current, "") }}
{{ vActions := p.Actions }}
{{ vSearch := p.Search }}
{{ vTone := uiutils.Def(p.Tone, "default") }}
{{ vLayout := uiutils.Def(p.Layout, "inline") }}
{{ vOver := uiutils.Def(p.Over, "none") }}
{{ vSkip := p.Skip }}
{{ vLandmarkLabel := p.LandmarkLabel }}
@block.Block(block.BlockProps{Tag: "header", Class: uiutils.S(uiutils.Cnv("relative", uiutils.Cond(uiutils.T(uiutils.Eq(vTone, "inverse")), "border-b border-transparent bg-foreground text-background [&_a]:text-background [&_button]:text-background", "border-b border-border bg-background"), uiutils.Cond(uiutils.T(uiutils.Eq(vOver, "media")), "isolate overflow-hidden border-0 bg-transparent", ""))), Attrs: uiutils.Attrs("data-testid", "nav-bar", "data-layout", vLayout, "data-tone", vTone, "aria-label", vLandmarkLabel)}) {
@OverMedia(OverMediaProps{On: uiutils.Eq(vOver, "media"), Alt: vBrand})
if uiutils.T(vSkip) {
@linkplain.LinkPlain(linkplain.LinkPlainProps{Href: "#main-content", Class: "sr-only focus:not-sr-only focus:fixed focus:left-2 focus:top-2 focus:z-50 focus:rounded focus:bg-background focus:px-4 focus:py-2 focus:text-sm focus:inset-ring focus:inset-ring-border", Attrs: uiutils.Attrs("data-testid", "skip-link")}) {
{ uiutils.Text(vSkip) }
}
}
@container.Container(container.ContainerProps{Class: "mx-auto w-full max-w-6xl px-4", Attrs: uiutils.Attrs("data-slot", "container")}) {
@box.Box(box.BoxProps{Class: uiutils.S(uiutils.Cnv("flex flex-wrap items-center justify-between gap-4", "py-4"))}) {
if uiutils.Eq(vLayout, "split") {
@NavBlock(NavBlockProps{Label: uiutils.Cond(uiutils.T(vLandmarkLabel), uiutils.Uniq(uiutils.Tpl("{0}, {1}", vLabel, vLandmarkLabel)), vLabel), Class: uiutils.Cnv("w-full"), Testid: "site-nav"}) {
@grid.Grid(grid.GridProps{Cols: "1-3", Class: "w-full items-center gap-4"}) {
@box.Box(box.BoxProps{Class: "md:justify-self-start"}) {
@NavLinks(NavLinksProps{Links: vLinks, Current: vCurrent, Side: "left"})
}
@box.Box(box.BoxProps{Class: "text-center"}) {
@link.Link(link.LinkProps{Href: "#/", Variant: "default", Class: "text-lg font-medium", Attrs: uiutils.Attrs("data-testid", "brand")}) {
{ uiutils.Text(vBrand) }
}
}
@group.Group(group.GroupProps{Gap: "4", Align: "center", Justify: "end", Class: "flex-wrap md:justify-self-end"}) {
@box.Box(box.BoxProps{}) {
@NavLinks(NavLinksProps{Links: vLinks, Current: vCurrent, Side: "right"})
}
@NavActions(NavActionsProps{Login: uiutils.Get(vActions, "login"), LoginHref: uiutils.Get(vActions, "loginHref"), Cta: uiutils.Get(vActions, "cta"), CtaHref: uiutils.Get(vActions, "href"), Actions: uiutils.Get(vActions, "mode"), Tone: vTone, ThemeLabel: uiutils.Get(vActions, "themeLabel")})
}
}
}
} else {
@link.Link(link.LinkProps{Href: "#/", Variant: "default", Class: "text-lg font-medium", Attrs: uiutils.Attrs("data-testid", "brand")}) {
{ uiutils.Text(vBrand) }
}
if uiutils.Eq(vLayout, "search") {
@SearchPalette(SearchPaletteProps{Label: uiutils.Get(vSearch, "label"), Shortcut: uiutils.Get(vSearch, "shortcut")})
}
@NavBlock(NavBlockProps{Label: uiutils.Cond(uiutils.T(vLandmarkLabel), uiutils.Uniq(uiutils.Tpl("{0}, {1}", vLabel, vLandmarkLabel)), vLabel), Class: uiutils.Cnv("order-last w-full overflow-x-auto md:order-none md:w-auto [&>div]:flex-nowrap md:[&>div]:flex-wrap [&_a]:shrink-0"), Testid: "site-nav"}) {
@NavLinks(NavLinksProps{Links: vLinks, Current: vCurrent})
}
@NavActions(NavActionsProps{Login: uiutils.Get(vActions, "login"), LoginHref: uiutils.Get(vActions, "loginHref"), Cta: uiutils.Get(vActions, "cta"), CtaHref: uiutils.Get(vActions, "href"), Actions: uiutils.Get(vActions, "mode"), Tone: vTone, ThemeLabel: uiutils.Get(vActions, "themeLabel")})
}
}
}
}
}
// Code generated by xgen. DO NOT EDIT.
// Source: xgen/specs/organisms/product-detail.json
package blocks
import (
"github.com/codegen-x/ui8kit/packages/templ/ui/ui/badge"
"github.com/codegen-x/ui8kit/packages/templ/ui/ui/button"
"github.com/codegen-x/ui8kit/packages/templ/ui/ui/grid"
"github.com/codegen-x/ui8kit/packages/templ/ui/ui/group"
"github.com/codegen-x/ui8kit/packages/templ/ui/ui/inline"
"github.com/codegen-x/ui8kit/packages/templ/ui/ui/list"
lucideicon "github.com/codegen-x/ui8kit/packages/templ/ui/ui/lucide-icon"
"github.com/codegen-x/ui8kit/packages/templ/ui/ui/stack"
"github.com/codegen-x/ui8kit/packages/templ/ui/ui/text"
uiutils "github.com/codegen-x/ui8kit/packages/templ/ui/utils"
)
// ProductDetailProps are the props of ProductDetail; the values are the JSON shapes of the TypeScript props.
type ProductDetailProps struct {
Id any `json:"id"`
Product any `json:"product"`
Labels any `json:"labels"`
Badges any `json:"badges"`
Level any `json:"level"`
Layout any `json:"layout"`
MediaSide any `json:"mediaSide"`
Thumbs any `json:"thumbs"`
Buy any `json:"buy"`
Tone any `json:"tone"`
Density any `json:"density"`
LandmarkLabel any `json:"landmarkLabel"`
}
// A product page: a gallery (the main picture and optional thumbnails) beside the buy box (badge, rating, price, stock, quantity, add button, shipping and returns notes). Axes: layout (split, stacked), media side, thumbs (none, below), buy (full, compact), tone, density.
templ ProductDetail(p ProductDetailProps) {
{{ vId := p.Id }}
{{ vProduct := p.Product }}
{{ vLabels := p.Labels }}
{{ vBadges := p.Badges }}
{{ vLevel := uiutils.Def(p.Level, float64(1)) }}
{{ vLayout := uiutils.Def(p.Layout, "split") }}
{{ vMediaSide := uiutils.Def(p.MediaSide, "start") }}
{{ vThumbs := uiutils.Def(p.Thumbs, "below") }}
{{ vBuy := uiutils.Def(p.Buy, "full") }}
{{ vTone := uiutils.Def(p.Tone, "default") }}
{{ vDensity := uiutils.Def(p.Density, "default") }}
{{ vLandmarkLabel := p.LandmarkLabel }}
@SectionFrame(SectionFrameProps{Id: vId, Title: uiutils.Get(vProduct, "name"), Lead: uiutils.Get(vProduct, "summary"), Heading: map[string]any{"level": vLevel}, Layout: uiutils.Cond(uiutils.T(uiutils.Eq(vLayout, "split")), "split", "stack"), Media: map[string]any{"show": true, "side": vMediaSide, "align": "start"}, Tone: vTone, Density: vDensity, LandmarkLabel: vLandmarkLabel, Aside: productDetailFill1(p, vProduct, vThumbs)}) {
@stack.Stack(stack.StackProps{Gap: "4", Align: "stretch", Attrs: uiutils.Attrs("data-testid", "buy-box")}) {
@group.Group(group.GroupProps{Gap: "4", Align: "center", Class: "flex-wrap"}) {
@text.Text(text.TextProps{Size: "4xl", Weight: "bold"}) {
{ uiutils.Text(uiutils.Money(uiutils.Get(vProduct, "price"), uiutils.Get(vProduct, "currency"))) }
}
if uiutils.T(uiutils.Get(vProduct, "badge")) {
@badge.Badge(badge.BadgeProps{Variant: "default", Size: "default"}) {
{ uiutils.Text(uiutils.At(vBadges, uiutils.Get(vProduct, "badge"))) }
}
}
}
@group.Group(group.GroupProps{Gap: "2"}) {
@Rating(RatingProps{Value: uiutils.Get(vProduct, "rating"), Label: uiutils.Tpl(uiutils.Get(vLabels, "ratingLabel"), uiutils.Get(vProduct, "rating"))})
@text.Text(text.TextProps{Size: "sm", Class: "text-muted-foreground"}) {
{ uiutils.Text(uiutils.Tpl(uiutils.Get(vLabels, "reviews"), uiutils.Get(vProduct, "reviews"))) }
}
}
@text.Text(text.TextProps{Size: "sm", Weight: "medium", Class: uiutils.S(uiutils.Cond(uiutils.T(uiutils.Get(vProduct, "inStock")), "text-foreground", "text-destructive")), Attrs: uiutils.Attrs("data-testid", "stock")}) {
{ uiutils.Text(uiutils.Cond(uiutils.T(uiutils.Get(vProduct, "inStock")), uiutils.Get(vLabels, "inStock"), uiutils.Get(vLabels, "soldOut"))) }
}
@group.Group(group.GroupProps{Gap: "4", Class: "flex-wrap"}) {
if uiutils.Eq(vBuy, "full") {
@NumberField(NumberFieldProps{Value: "1", Name: uiutils.Tpl("{0}-qty", vId), Min: "1", Label: uiutils.Get(vLabels, "qty"), Decrease: uiutils.Get(vLabels, "decrease"), Increase: uiutils.Get(vLabels, "increase")})
}
@button.Button(button.ButtonProps{Disabled: uiutils.T(!uiutils.T(uiutils.Get(vProduct, "inStock"))), Attrs: uiutils.Attrs("data-testid", "add")}) {
{ uiutils.Text(uiutils.Get(vLabels, "add")) }
}
}
if uiutils.Eq(vBuy, "full") {
@list.List(list.ListProps{Tag: "ul", Class: "flex flex-col gap-2 text-sm text-muted-foreground"}) {
@list.ListItem(list.ListItemProps{Class: "flex items-center gap-2"}) {
@lucideicon.LucideIcon(lucideicon.LucideIconProps{Name: "truck", Size: 16})
@inline.Inline(inline.InlineProps{}) {
{ uiutils.Text(uiutils.Get(vLabels, "shipping")) }
}
}
@list.ListItem(list.ListItemProps{Class: "flex items-center gap-2"}) {
@lucideicon.LucideIcon(lucideicon.LucideIconProps{Name: "shield-check", Size: 16})
@inline.Inline(inline.InlineProps{}) {
{ uiutils.Text(uiutils.Get(vLabels, "returns")) }
}
}
}
}
}
}
}
templ productDetailFill1(p ProductDetailProps, vProduct any, vThumbs any) {
@stack.Stack(stack.StackProps{Gap: "4", Align: "stretch", Attrs: uiutils.Attrs("data-testid", "gallery")}) {
@MediaFrame(MediaFrameProps{Alt: uiutils.Get(vProduct, "name"), Ratio: "1/1"})
if uiutils.Eq(vThumbs, "below") {
@grid.Grid(grid.GridProps{Cols: "3", Class: "gap-4", Attrs: uiutils.Attrs("data-testid", "thumbs")}) {
@MediaFrame(MediaFrameProps{Alt: uiutils.Get(vProduct, "name"), Ratio: "1/1", Class: uiutils.Cnv("ring-2 ring-foreground")})
@MediaFrame(MediaFrameProps{Alt: uiutils.Get(vProduct, "name"), Ratio: "1/1"})
@MediaFrame(MediaFrameProps{Alt: uiutils.Get(vProduct, "name"), Ratio: "1/1"})
}
}
}
}
// Code generated by xgen. DO NOT EDIT.
// Source: xgen/specs/organisms/product-info.json
package blocks
import (
"github.com/codegen-x/ui8kit/packages/templ/ui/ui/box"
"github.com/codegen-x/ui8kit/packages/templ/ui/ui/disclosure"
"github.com/codegen-x/ui8kit/packages/templ/ui/ui/inline"
"github.com/codegen-x/ui8kit/packages/templ/ui/ui/list"
"github.com/codegen-x/ui8kit/packages/templ/ui/ui/stack"
"github.com/codegen-x/ui8kit/packages/templ/ui/ui/text"
"github.com/codegen-x/ui8kit/packages/templ/ui/ui/title"
uiutils "github.com/codegen-x/ui8kit/packages/templ/ui/utils"
)
// ProductInfoProps are the props of ProductInfo; the values are the JSON shapes of the TypeScript props.
type ProductInfoProps struct {
Id any `json:"id"`
Title any `json:"title"`
Details any `json:"details"`
Specs any `json:"specs"`
Labels any `json:"labels"`
Layout any `json:"layout"`
Expand any `json:"expand"`
Tone any `json:"tone"`
LandmarkLabel any `json:"landmarkLabel"`
}
// The details of a product under its buy box: texts in an accordion (native details) beside a card with the specs. Axes: layout (split: the specs beside the texts, stacked: below them), expand (first: the first text open, none), tone.
templ ProductInfo(p ProductInfoProps) {
{{ vId := p.Id }}
{{ vTitle := p.Title }}
{{ vDetails := p.Details }}
{{ vSpecs := p.Specs }}
{{ vLabels := p.Labels }}
{{ vLayout := uiutils.Def(p.Layout, "split") }}
{{ vExpand := uiutils.Def(p.Expand, "first") }}
{{ vTone := uiutils.Def(p.Tone, "default") }}
{{ vLandmarkLabel := p.LandmarkLabel }}
@SectionFrame(SectionFrameProps{Id: vId, Title: vTitle, Tone: vTone, LandmarkLabel: vLandmarkLabel}) {
@box.Box(box.BoxProps{Class: uiutils.S(uiutils.Cond(uiutils.T(uiutils.Eq(vLayout, "split")), "grid grid-cols-1 items-start gap-8 lg:grid-cols-3", "grid grid-cols-1 gap-8"))}) {
@stack.Stack(stack.StackProps{Gap: "0", Align: "stretch", Class: uiutils.S(uiutils.Cond(uiutils.T(uiutils.Eq(vLayout, "split")), "lg:col-span-2", "")), Attrs: uiutils.Attrs("data-testid", "items")}) {
for vI, vD := range uiutils.L(vDetails) {
@disclosure.Disclosure(disclosure.DisclosureProps{Variant: "item", Open: uiutils.T(uiutils.And(uiutils.Eq(vExpand, "first"), uiutils.Eq(float64(vI), float64(0)))), Attrs: uiutils.Attrs("data-testid", "item")}) {
@disclosure.Summary(disclosure.SummaryProps{Variant: "item"}) {
@inline.Inline(inline.InlineProps{Class: "text-base font-semibold"}) {
{ uiutils.Text(uiutils.Get(vD, "title")) }
}
}
@text.Text(text.TextProps{Size: "sm", Class: "pb-4 text-muted-foreground"}) {
{ uiutils.Text(uiutils.Get(vD, "text")) }
}
}
}
}
@stack.Stack(stack.StackProps{Gap: "4", Align: "stretch", Class: "rounded bg-card inset-ring inset-ring-border p-6", Attrs: uiutils.Attrs("data-testid", "specs")}) {
@title.Title(title.TitleProps{As: uiutils.HeadingLevel(uiutils.I(float64(3))), Size: "lg", Weight: "bold"}) {
{ uiutils.Text(uiutils.Get(vLabels, "specs")) }
}
@list.List(list.ListProps{Tag: "ul", Class: "flex flex-col"}) {
for _, vS := range uiutils.L(vSpecs) {
@list.ListItem(list.ListItemProps{Class: "flex items-center justify-between gap-4 border-b border-border py-2 text-sm last:border-b-0", Attrs: uiutils.Attrs("data-testid", "spec")}) {
@inline.Inline(inline.InlineProps{Class: "text-muted-foreground"}) {
{ uiutils.Text(uiutils.Get(vS, "label")) }
}
@inline.Inline(inline.InlineProps{Class: "font-medium"}) {
{ uiutils.Text(uiutils.Get(vS, "value")) }
}
}
}
}
}
}
}
}
// Code generated by xgen. DO NOT EDIT.
// Source: xgen/specs/organisms/review-list.json
package blocks
import (
"github.com/codegen-x/ui8kit/packages/templ/ui/ui/grid"
"github.com/codegen-x/ui8kit/packages/templ/ui/ui/group"
"github.com/codegen-x/ui8kit/packages/templ/ui/ui/stack"
"github.com/codegen-x/ui8kit/packages/templ/ui/ui/text"
"github.com/codegen-x/ui8kit/packages/templ/ui/ui/title"
uiutils "github.com/codegen-x/ui8kit/packages/templ/ui/utils"
)
// ReviewListProps are the props of ReviewList; the values are the JSON shapes of the TypeScript props.
type ReviewListProps struct {
Id any `json:"id"`
Title any `json:"title"`
Reviews any `json:"reviews"`
Labels any `json:"labels"`
Layout any `json:"layout"`
Item any `json:"item"`
Avatar any `json:"avatar"`
Tone any `json:"tone"`
Density any `json:"density"`
LandmarkLabel any `json:"landmarkLabel"`
}
// Customer reviews as cards or plain entries: rating, title, text, author and date. Axes: layout (list, grid), columns, item (card, plain), avatar (none, image), tone, density.
templ ReviewList(p ReviewListProps) {
{{ vId := p.Id }}
{{ vTitle := p.Title }}
{{ vReviews := p.Reviews }}
{{ vLabels := p.Labels }}
{{ vLayout := uiutils.Def(p.Layout, "list") }}
{{ vItem := uiutils.Def(p.Item, "card") }}
{{ vAvatar := uiutils.Def(p.Avatar, "none") }}
{{ vTone := uiutils.Def(p.Tone, "default") }}
{{ vDensity := uiutils.Def(p.Density, "default") }}
{{ vLandmarkLabel := p.LandmarkLabel }}
@SectionFrame(SectionFrameProps{Id: vId, Title: vTitle, Tone: vTone, Density: vDensity, Measure: uiutils.Cond(uiutils.T(uiutils.Eq(vLayout, "list")), "2xl", "default"), LandmarkLabel: vLandmarkLabel}) {
@grid.Grid(grid.GridProps{Cols: uiutils.S(uiutils.Cond(uiutils.T(uiutils.Eq(vLayout, "grid")), "1-3", "1")), Class: "gap-4", Attrs: uiutils.Attrs("data-testid", "items")}) {
for _, vR := range uiutils.L(vReviews) {
@ArticleBlock(ArticleBlockProps{Class: uiutils.Cnv(uiutils.Cnv("flex h-full flex-col gap-4", uiutils.Cond(uiutils.T(uiutils.Eq(vItem, "card")), "rounded bg-card p-6 inset-ring inset-ring-border", "border-b border-border pb-4"))), Testid: "item"}) {
@Rating(RatingProps{Value: uiutils.Get(vR, "rating"), Label: uiutils.Tpl(uiutils.Get(vLabels, "ratingLabel"), uiutils.Get(vR, "rating"))})
@title.Title(title.TitleProps{As: uiutils.HeadingLevel(uiutils.I(float64(3))), Size: "base", Weight: "bold"}) {
{ uiutils.Text(uiutils.Get(vR, "title")) }
}
@text.Text(text.TextProps{Size: "sm", Class: "text-muted-foreground"}) {
{ uiutils.Text(uiutils.Get(vR, "text")) }
}
@group.Group(group.GroupProps{Gap: "4", Align: "center", Class: "mt-auto"}) {
if uiutils.Eq(vAvatar, "image") {
@MediaFrame(MediaFrameProps{Alt: uiutils.Get(vR, "author"), Ratio: "1/1", Class: uiutils.Cnv("size-10 shrink-0 rounded-full")})
}
@stack.Stack(stack.StackProps{Gap: "0"}) {
@text.Text(text.TextProps{Size: "sm", Weight: "semibold"}) {
{ uiutils.Text(uiutils.Get(vR, "author")) }
}
@text.Text(text.TextProps{Size: "xs", Class: "text-muted-foreground"}) {
{ uiutils.Text(uiutils.Get(vR, "date")) }
}
}
}
}
}
}
}
}
// Code generated by xgen. DO NOT EDIT.
// Source: xgen/specs/organisms/product-grid.json
package blocks
import (
"github.com/codegen-x/ui8kit/packages/templ/ui/ui/box"
"github.com/codegen-x/ui8kit/packages/templ/ui/ui/grid"
uiutils "github.com/codegen-x/ui8kit/packages/templ/ui/utils"
)
// ProductGridProps are the props of ProductGrid; the values are the JSON shapes of the TypeScript props.
type ProductGridProps struct {
Id any `json:"id"`
Title any `json:"title"`
Products any `json:"products"`
Labels any `json:"labels"`
Badges any `json:"badges"`
Layout any `json:"layout"`
Cols any `json:"cols"`
Ratio any `json:"ratio"`
Rating any `json:"rating"`
Action any `json:"action"`
Tone any `json:"tone"`
Density any `json:"density"`
LandmarkLabel any `json:"landmarkLabel"`
}
// A section with a heading and the products as cards in a grid, as a list of horizontal cards, or as a rail that scrolls sideways. Axes: layout (grid, list, rail), columns, ratio, rating, action, tone, density.
templ ProductGrid(p ProductGridProps) {
{{ vId := p.Id }}
{{ vTitle := p.Title }}
{{ vProducts := p.Products }}
{{ vLabels := p.Labels }}
{{ vBadges := p.Badges }}
{{ vLayout := uiutils.Def(p.Layout, "grid") }}
{{ vCols := uiutils.Def(p.Cols, "1-3") }}
{{ vRatio := uiutils.Def(p.Ratio, "4/3") }}
{{ vRating := uiutils.Def(p.Rating, "show") }}
{{ vAction := uiutils.Def(p.Action, "button") }}
{{ vTone := uiutils.Def(p.Tone, "default") }}
{{ vDensity := uiutils.Def(p.Density, "default") }}
{{ vLandmarkLabel := p.LandmarkLabel }}
@SectionFrame(SectionFrameProps{Id: vId, Title: vTitle, Tone: vTone, Density: vDensity, LandmarkLabel: vLandmarkLabel}) {
if uiutils.Eq(vLayout, "rail") {
@box.Box(box.BoxProps{Class: "flex snap-x gap-4 overflow-x-auto pb-4", Attrs: uiutils.Attrs("data-testid", "items")}) {
for _, vP := range uiutils.L(vProducts) {
@box.Box(box.BoxProps{Class: "w-64 shrink-0 snap-start"}) {
@ProductCard(ProductCardProps{Product: vP, Labels: vLabels, Badges: vBadges, Layout: uiutils.Cond(uiutils.T(uiutils.Eq(vLayout, "list")), "horizontal", "vertical"), Ratio: vRatio, Rating: vRating, Action: vAction, Density: uiutils.Cond(uiutils.T(uiutils.Eq(vDensity, "compact")), "compact", "default")})
}
}
}
} else {
@grid.Grid(grid.GridProps{Cols: uiutils.S(uiutils.Cond(uiutils.T(uiutils.Eq(vLayout, "list")), "1", vCols)), Class: "gap-4", Attrs: uiutils.Attrs("data-testid", "items")}) {
for _, vP := range uiutils.L(vProducts) {
@ProductCard(ProductCardProps{Product: vP, Labels: vLabels, Badges: vBadges, Layout: uiutils.Cond(uiutils.T(uiutils.Eq(vLayout, "list")), "horizontal", "vertical"), Ratio: vRatio, Rating: vRating, Action: vAction, Density: uiutils.Cond(uiutils.T(uiutils.Eq(vDensity, "compact")), "compact", "default")})
}
}
}
}
}
// Code generated by xgen. DO NOT EDIT.
// Source: xgen/specs/organisms/sitemap-footer.json
package blocks
import (
"github.com/codegen-x/ui8kit/packages/templ/ui/ui/block"
"github.com/codegen-x/ui8kit/packages/templ/ui/ui/box"
"github.com/codegen-x/ui8kit/packages/templ/ui/ui/button"
"github.com/codegen-x/ui8kit/packages/templ/ui/ui/container"
"github.com/codegen-x/ui8kit/packages/templ/ui/ui/form"
"github.com/codegen-x/ui8kit/packages/templ/ui/ui/group"
"github.com/codegen-x/ui8kit/packages/templ/ui/ui/input"
"github.com/codegen-x/ui8kit/packages/templ/ui/ui/label"
"github.com/codegen-x/ui8kit/packages/templ/ui/ui/link"
"github.com/codegen-x/ui8kit/packages/templ/ui/ui/stack"
"github.com/codegen-x/ui8kit/packages/templ/ui/ui/text"
"github.com/codegen-x/ui8kit/packages/templ/ui/ui/title"
uiutils "github.com/codegen-x/ui8kit/packages/templ/ui/utils"
)
// SitemapFooterProps are the props of SitemapFooter; the values are the JSON shapes of the TypeScript props.
type SitemapFooterProps struct {
Label any `json:"label"`
Brand any `json:"brand"`
Tagline any `json:"tagline"`
Copyright any `json:"copyright"`
Groups any `json:"groups"`
Signup any `json:"signup"`
Status any `json:"status"`
Id any `json:"id"`
Layout any `json:"layout"`
Density any `json:"density"`
LandmarkLabel any `json:"landmarkLabel"`
}
// A footer with the brand, a tagline, groups of links and the copyright. Axes: layout (columns: brand above, equal columns per group, row: the brand, the group names and the copyright in one row), signup mode (none, first: a sign-up above the links), status mode (none, show: a live status pill), density. The live status itself is a port contract.
templ SitemapFooter(p SitemapFooterProps) {
{{ vLabel := p.Label }}
{{ vBrand := p.Brand }}
{{ vTagline := p.Tagline }}
{{ vCopyright := p.Copyright }}
{{ vGroups := p.Groups }}
{{ vSignup := p.Signup }}
{{ vStatus := p.Status }}
{{ vId := uiutils.Def(p.Id, "footer") }}
{{ vLayout := uiutils.Def(p.Layout, "columns") }}
{{ vDensity := uiutils.Def(p.Density, "default") }}
{{ vLandmarkLabel := p.LandmarkLabel }}
if uiutils.Eq(vLayout, "card") {
@FooterCard(FooterCardProps{Label: vLabel, Brand: vBrand, Groups: vGroups, LandmarkLabel: vLandmarkLabel})
} else {
@block.Block(block.BlockProps{Tag: "footer", Class: "mt-12 border-t border-border", Attrs: uiutils.Attrs("data-testid", "site-footer", "data-layout", vLayout, "aria-label", vLandmarkLabel)}) {
@container.Container(container.ContainerProps{Class: uiutils.S(uiutils.Cnv("mx-auto w-full max-w-6xl px-4", "flex flex-col gap-8", uiutils.Cond(uiutils.T(uiutils.Eq(vDensity, "compact")), "py-6", "py-12"))), Attrs: uiutils.Attrs("data-slot", "container")}) {
if uiutils.Eq(uiutils.Get(vSignup, "mode"), "first") {
@stack.Stack(stack.StackProps{Gap: "4", Class: "max-w-md", Attrs: uiutils.Attrs("data-testid", "signup")}) {
@title.Title(title.TitleProps{As: uiutils.HeadingLevel(uiutils.I(float64(3))), Size: "xl", Weight: "bold"}) {
{ uiutils.Text(uiutils.Get(vSignup, "title")) }
}
@form.Form(form.FormProps{Method: "dialog", Class: uiutils.S(uiutils.Cnv("w-full max-w-md", uiutils.Cond(uiutils.T(false), "mx-auto", ""))), Attrs: uiutils.Attrs("data-testid", "email-form")}) {
@label.Label(label.LabelProps{HTMLFor: uiutils.S(uiutils.Tpl("{0}-email", vId)), Class: "sr-only"}) {
{ uiutils.Text(uiutils.Get(vSignup, "label")) }
}
@group.Group(group.GroupProps{Gap: "2", Align: "start", Class: "w-full flex-wrap"}) {
@input.Input(input.InputProps{Type: "email", Name: "email", Class: "min-w-0 flex-1", Attrs: uiutils.Attrs("id", uiutils.Tpl("{0}-email", vId), "data-testid", "field")})
@button.Button(button.ButtonProps{Variant: "default", Size: "default", Type: "submit", Attrs: uiutils.Attrs("data-testid", "submit")}) {
{ uiutils.Text(uiutils.Get(vSignup, "submit")) }
}
}
}
}
}
if uiutils.Eq(vLayout, "columns") {
@box.Box(box.BoxProps{Class: "flex flex-col gap-8 md:flex-row md:items-start md:gap-12", Attrs: uiutils.Attrs("data-slot", "footer-top")}) {
@stack.Stack(stack.StackProps{Gap: "2", Class: "md:w-64 md:shrink-0"}) {
@text.Text(text.TextProps{Size: "xl", Weight: "bold"}) {
{ uiutils.Text(vBrand) }
}
@text.Text(text.TextProps{Size: "sm", Class: "text-muted-foreground"}) {
{ uiutils.Text(vTagline) }
}
}
@box.Box(box.BoxProps{Class: "min-w-0 flex-1"}) {
@FooterColumns(FooterColumnsProps{Label: vLabel, Groups: vGroups, LandmarkLabel: vLandmarkLabel})
}
}
} else {
@group.Group(group.GroupProps{Gap: "6", Align: "center", Justify: "between", Class: "flex-wrap"}) {
@text.Text(text.TextProps{Size: "base", Weight: "bold"}) {
{ uiutils.Text(vBrand) }
}
@NavBlock(NavBlockProps{Label: uiutils.Cond(uiutils.T(vLandmarkLabel), uiutils.Uniq(uiutils.Tpl("{0}, {1}", vLabel, vLandmarkLabel)), vLabel)}) {
@group.Group(group.GroupProps{Gap: "4", Class: "flex-wrap"}) {
for _, vG := range uiutils.L(vGroups) {
@link.Link(link.LinkProps{Href: "#/", Variant: "default", Class: "text-sm", Attrs: uiutils.Attrs("data-testid", "group")}) {
{ uiutils.Text(uiutils.Get(vG, "title")) }
}
}
}
}
}
}
@group.Group(group.GroupProps{Gap: "4", Align: "center", Justify: "between", Class: "flex-wrap border-t border-border pt-6"}) {
@text.Text(text.TextProps{Size: "sm", Class: "text-muted-foreground"}) {
{ uiutils.Text(vCopyright) }
}
if uiutils.Eq(uiutils.Get(vStatus, "mode"), "show") {
@Pill(PillProps{Tone: "green", Icon: "circle-check"}) {
{ uiutils.Text(uiutils.Get(vStatus, "label")) }
}
}
}
}
}
}
}
Twig is not installed by the CLI. Copy the template files below into your Twig templates, together with these helper files from packages/twig/ui of the source (the Runtime, CnMerge and the Twig extension):
- php/CnMerge.php
- php/Extension.php
- php/Runtime.php
{#- Code generated by xgen. DO NOT EDIT.
Source: xgen/specs/organisms/nav-bar.json
A top bar in four shapes. Axes: layout (inline: brand left, links, button right; split: the brand in the middle with the links on both sides; search: a search field with its shortcut in the middle), over (none, media: the bar sits over a picture, transparent), actions mode (none, cta), tone (default, inverse: on a dark hero band). Turning solid on scroll is a port contract.
Props (p): label, brand, links, current, actions, search, tone, layout, over, skip, landmarkLabel. -#}
{%- set v_label = (p.label ?? null) -%}
{%- set v_brand = (p.brand ?? null) -%}
{%- set v_links = (p.links ?? null) -%}
{%- set v_current = (p.current ?? '') -%}
{%- set v_actions = (p.actions ?? null) -%}
{%- set v_search = (p.search ?? null) -%}
{%- set v_tone = (p.tone ?? 'default') -%}
{%- set v_layout = (p.layout ?? 'inline') -%}
{%- set v_over = (p.over ?? 'none') -%}
{%- set v_skip = (p.skip ?? null) -%}
{%- set v_landmarkLabel = (p.landmarkLabel ?? null) -%}
{%- set c_13 -%}
{{ include('blocks/over-media.html.twig', {'p': {'on': ui_eq(v_over, 'media'), 'alt': v_brand}}, with_context = false) }}
{%- if ui_t(v_skip) %}
{%- set c_1 -%}
{{ ui_text(v_skip) }}
{%- endset -%}
{{ include('ui/link-plain/link-plain.html.twig', {'p': {'Href': '#main-content', 'Class': 'sr-only focus:not-sr-only focus:fixed focus:left-2 focus:top-2 focus:z-50 focus:rounded focus:bg-background focus:px-4 focus:py-2 focus:text-sm focus:inset-ring focus:inset-ring-border', 'Attrs': ui_attrs(['data-testid', 'skip-link'])}, 'children': c_1}, with_context = false) }}
{%- endif %}
{%- set c_12 -%}
{%- set c_11 -%}
{%- if ui_t(ui_eq(v_layout, 'split')) %}
{%- set c_8 -%}
{%- set c_7 -%}
{%- set c_2 -%}
{{ include('blocks/nav-links.html.twig', {'p': {'links': v_links, 'current': v_current, 'side': 'left'}}, with_context = false) }}
{%- endset -%}
{{ include('ui/box/box.html.twig', {'p': {'Class': 'md:justify-self-start'}, 'children': c_2}, with_context = false) }}
{%- set c_4 -%}
{%- set c_3 -%}
{{ ui_text(v_brand) }}
{%- endset -%}
{{ include('ui/link/link.html.twig', {'p': {'Href': '#/', 'Variant': 'default', 'Class': 'text-lg font-medium', 'Attrs': ui_attrs(['data-testid', 'brand'])}, 'children': c_3}, with_context = false) }}
{%- endset -%}
{{ include('ui/box/box.html.twig', {'p': {'Class': 'text-center'}, 'children': c_4}, with_context = false) }}
{%- set c_6 -%}
{%- set c_5 -%}
{{ include('blocks/nav-links.html.twig', {'p': {'links': v_links, 'current': v_current, 'side': 'right'}}, with_context = false) }}
{%- endset -%}
{{ include('ui/box/box.html.twig', {'p': {}, 'children': c_5}, with_context = false) }}
{{ include('blocks/nav-actions.html.twig', {'p': {'login': ui_get(v_actions, ['login']), 'loginHref': ui_get(v_actions, ['loginHref']), 'cta': ui_get(v_actions, ['cta']), 'ctaHref': ui_get(v_actions, ['href']), 'actions': ui_get(v_actions, ['mode']), 'tone': v_tone, 'themeLabel': ui_get(v_actions, ['themeLabel'])}}, with_context = false) }}
{%- endset -%}
{{ include('ui/group/group.html.twig', {'p': {'Gap': '4', 'Align': 'center', 'Justify': 'end', 'Class': 'flex-wrap md:justify-self-end'}, 'children': c_6}, with_context = false) }}
{%- endset -%}
{{ include('ui/grid/grid.html.twig', {'p': {'Cols': '1-3', 'Class': 'w-full items-center gap-4'}, 'children': c_7}, with_context = false) }}
{%- endset -%}
{{ include('blocks/nav-block.html.twig', {'p': {'label': (ui_t(v_landmarkLabel) ? ui_uniq(ui_tpl('{0}, {1}', [v_label, v_landmarkLabel])) : v_label), 'className': ui_cnv(['w-full']), 'testid': 'site-nav'}, 'children': c_8}, with_context = false) }}
{%- else %}
{%- set c_9 -%}
{{ ui_text(v_brand) }}
{%- endset -%}
{{ include('ui/link/link.html.twig', {'p': {'Href': '#/', 'Variant': 'default', 'Class': 'text-lg font-medium', 'Attrs': ui_attrs(['data-testid', 'brand'])}, 'children': c_9}, with_context = false) }}
{%- if ui_t(ui_eq(v_layout, 'search')) %}
{{ include('blocks/search-palette.html.twig', {'p': {'label': ui_get(v_search, ['label']), 'shortcut': ui_get(v_search, ['shortcut'])}}, with_context = false) }}
{%- endif %}
{%- set c_10 -%}
{{ include('blocks/nav-links.html.twig', {'p': {'links': v_links, 'current': v_current}}, with_context = false) }}
{%- endset -%}
{{ include('blocks/nav-block.html.twig', {'p': {'label': (ui_t(v_landmarkLabel) ? ui_uniq(ui_tpl('{0}, {1}', [v_label, v_landmarkLabel])) : v_label), 'className': ui_cnv(['order-last w-full overflow-x-auto md:order-none md:w-auto [&>div]:flex-nowrap md:[&>div]:flex-wrap [&_a]:shrink-0']), 'testid': 'site-nav'}, 'children': c_10}, with_context = false) }}
{{ include('blocks/nav-actions.html.twig', {'p': {'login': ui_get(v_actions, ['login']), 'loginHref': ui_get(v_actions, ['loginHref']), 'cta': ui_get(v_actions, ['cta']), 'ctaHref': ui_get(v_actions, ['href']), 'actions': ui_get(v_actions, ['mode']), 'tone': v_tone, 'themeLabel': ui_get(v_actions, ['themeLabel'])}}, with_context = false) }}
{%- endif %}
{%- endset -%}
{{ include('ui/box/box.html.twig', {'p': {'Class': ui_s(ui_cnv(['flex flex-wrap items-center justify-between gap-4', 'py-4']))}, 'children': c_11}, with_context = false) }}
{%- endset -%}
{{ include('ui/container/container.html.twig', {'p': {'Class': 'mx-auto w-full max-w-6xl px-4', 'Attrs': ui_attrs(['data-slot', 'container'])}, 'children': c_12}, with_context = false) }}
{%- endset -%}
{{ include('ui/block/block.html.twig', {'p': {'Tag': 'header', 'Class': ui_s(ui_cnv(['relative', (ui_t(ui_eq(v_tone, 'inverse')) ? 'border-b border-transparent bg-foreground text-background [&_a]:text-background [&_button]:text-background' : 'border-b border-border bg-background'), (ui_t(ui_eq(v_over, 'media')) ? 'isolate overflow-hidden border-0 bg-transparent' : '')])), 'Attrs': ui_attrs(['data-testid', 'nav-bar', 'data-layout', v_layout, 'data-tone', v_tone, 'aria-label', v_landmarkLabel])}, 'children': c_13}, with_context = false) }}
{#- Code generated by xgen. DO NOT EDIT.
Source: xgen/specs/organisms/product-detail.json
A product page: a gallery (the main picture and optional thumbnails) beside the buy box (badge, rating, price, stock, quantity, add button, shipping and returns notes). Axes: layout (split, stacked), media side, thumbs (none, below), buy (full, compact), tone, density.
Props (p): id, product, labels, badges, level, layout, mediaSide, thumbs, buy, tone, density, landmarkLabel. -#}
{%- set v_id = (p.id ?? null) -%}
{%- set v_product = (p.product ?? null) -%}
{%- set v_labels = (p.labels ?? null) -%}
{%- set v_badges = (p.badges ?? null) -%}
{%- set v_level = (p.level ?? 1) -%}
{%- set v_layout = (p.layout ?? 'split') -%}
{%- set v_mediaSide = (p.mediaSide ?? 'start') -%}
{%- set v_thumbs = (p.thumbs ?? 'below') -%}
{%- set v_buy = (p.buy ?? 'full') -%}
{%- set v_tone = (p.tone ?? 'default') -%}
{%- set v_density = (p.density ?? 'default') -%}
{%- set v_landmarkLabel = (p.landmarkLabel ?? null) -%}
{%- set f_15 -%}
{%- set c_17 -%}
{{ include('blocks/media-frame.html.twig', {'p': {'alt': ui_get(v_product, ['name']), 'ratio': '1/1'}}, with_context = false) }}
{%- if ui_t(ui_eq(v_thumbs, 'below')) %}
{%- set c_16 -%}
{{ include('blocks/media-frame.html.twig', {'p': {'alt': ui_get(v_product, ['name']), 'ratio': '1/1', 'className': ui_cnv(['ring-2 ring-foreground'])}}, with_context = false) }}
{{ include('blocks/media-frame.html.twig', {'p': {'alt': ui_get(v_product, ['name']), 'ratio': '1/1'}}, with_context = false) }}
{{ include('blocks/media-frame.html.twig', {'p': {'alt': ui_get(v_product, ['name']), 'ratio': '1/1'}}, with_context = false) }}
{%- endset -%}
{{ include('ui/grid/grid.html.twig', {'p': {'Cols': '3', 'Class': 'gap-4', 'Attrs': ui_attrs(['data-testid', 'thumbs'])}, 'children': c_16}, with_context = false) }}
{%- endif %}
{%- endset -%}
{{ include('ui/stack/stack.html.twig', {'p': {'Gap': '4', 'Align': 'stretch', 'Attrs': ui_attrs(['data-testid', 'gallery'])}, 'children': c_17}, with_context = false) }}
{%- endset -%}
{%- set c_18 -%}
{%- set c_14 -%}
{%- set c_3 -%}
{%- set c_1 -%}
{{ ui_text(ui_money(ui_get(v_product, ['price']), ui_get(v_product, ['currency']))) }}
{%- endset -%}
{{ include('ui/text/text.html.twig', {'p': {'Size': '4xl', 'Weight': 'bold'}, 'children': c_1}, with_context = false) }}
{%- if ui_t(ui_get(v_product, ['badge'])) %}
{%- set c_2 -%}
{{ ui_text(ui_at(v_badges, ui_get(v_product, ['badge']))) }}
{%- endset -%}
{{ include('ui/badge/badge.html.twig', {'p': {'Variant': 'default', 'Size': 'default'}, 'children': c_2}, with_context = false) }}
{%- endif %}
{%- endset -%}
{{ include('ui/group/group.html.twig', {'p': {'Gap': '4', 'Align': 'center', 'Class': 'flex-wrap'}, 'children': c_3}, with_context = false) }}
{%- set c_5 -%}
{{ include('blocks/rating.html.twig', {'p': {'value': ui_get(v_product, ['rating']), 'label': ui_tpl(ui_get(v_labels, ['ratingLabel']), [ui_get(v_product, ['rating'])])}}, with_context = false) }}
{%- set c_4 -%}
{{ ui_text(ui_tpl(ui_get(v_labels, ['reviews']), [ui_get(v_product, ['reviews'])])) }}
{%- endset -%}
{{ include('ui/text/text.html.twig', {'p': {'Size': 'sm', 'Class': 'text-muted-foreground'}, 'children': c_4}, with_context = false) }}
{%- endset -%}
{{ include('ui/group/group.html.twig', {'p': {'Gap': '2'}, 'children': c_5}, with_context = false) }}
{%- set c_6 -%}
{{ ui_text((ui_t(ui_get(v_product, ['inStock'])) ? ui_get(v_labels, ['inStock']) : ui_get(v_labels, ['soldOut']))) }}
{%- endset -%}
{{ include('ui/text/text.html.twig', {'p': {'Size': 'sm', 'Weight': 'medium', 'Class': ui_s((ui_t(ui_get(v_product, ['inStock'])) ? 'text-foreground' : 'text-destructive')), 'Attrs': ui_attrs(['data-testid', 'stock'])}, 'children': c_6}, with_context = false) }}
{%- set c_8 -%}
{%- if ui_t(ui_eq(v_buy, 'full')) %}
{{ include('blocks/number-field.html.twig', {'p': {'value': '1', 'name': ui_tpl('{0}-qty', [v_id]), 'min': '1', 'label': ui_get(v_labels, ['qty']), 'decrease': ui_get(v_labels, ['decrease']), 'increase': ui_get(v_labels, ['increase'])}}, with_context = false) }}
{%- endif %}
{%- set c_7 -%}
{{ ui_text(ui_get(v_labels, ['add'])) }}
{%- endset -%}
{{ include('ui/button/button.html.twig', {'p': {'Disabled': ui_t(not (ui_t(ui_get(v_product, ['inStock'])))), 'Attrs': ui_attrs(['data-testid', 'add'])}, 'children': c_7}, with_context = false) }}
{%- endset -%}
{{ include('ui/group/group.html.twig', {'p': {'Gap': '4', 'Class': 'flex-wrap'}, 'children': c_8}, with_context = false) }}
{%- if ui_t(ui_eq(v_buy, 'full')) %}
{%- set c_13 -%}
{%- set c_10 -%}
{{ include('ui/lucide-icon/lucide-icon.html.twig', {'p': {'Name': 'truck', 'Size': 16}}, with_context = false) }}
{%- set c_9 -%}
{{ ui_text(ui_get(v_labels, ['shipping'])) }}
{%- endset -%}
{{ include('ui/inline/inline.html.twig', {'p': {}, 'children': c_9}, with_context = false) }}
{%- endset -%}
{{ include('ui/list/list-item.html.twig', {'p': {'Class': 'flex items-center gap-2'}, 'children': c_10}, with_context = false) }}
{%- set c_12 -%}
{{ include('ui/lucide-icon/lucide-icon.html.twig', {'p': {'Name': 'shield-check', 'Size': 16}}, with_context = false) }}
{%- set c_11 -%}
{{ ui_text(ui_get(v_labels, ['returns'])) }}
{%- endset -%}
{{ include('ui/inline/inline.html.twig', {'p': {}, 'children': c_11}, with_context = false) }}
{%- endset -%}
{{ include('ui/list/list-item.html.twig', {'p': {'Class': 'flex items-center gap-2'}, 'children': c_12}, with_context = false) }}
{%- endset -%}
{{ include('ui/list/list.html.twig', {'p': {'Tag': 'ul', 'Class': 'flex flex-col gap-2 text-sm text-muted-foreground'}, 'children': c_13}, with_context = false) }}
{%- endif %}
{%- endset -%}
{{ include('ui/stack/stack.html.twig', {'p': {'Gap': '4', 'Align': 'stretch', 'Attrs': ui_attrs(['data-testid', 'buy-box'])}, 'children': c_14}, with_context = false) }}
{%- endset -%}
{{ include('blocks/section-frame.html.twig', {'p': {'id': v_id, 'title': ui_get(v_product, ['name']), 'lead': ui_get(v_product, ['summary']), 'heading': {'level': v_level}, 'layout': (ui_t(ui_eq(v_layout, 'split')) ? 'split' : 'stack'), 'media': {'show': true, 'side': v_mediaSide, 'align': 'start'}, 'tone': v_tone, 'density': v_density, 'landmarkLabel': v_landmarkLabel, 'aside': f_15}, 'children': c_18}, with_context = false) }}
{#- Code generated by xgen. DO NOT EDIT.
Source: xgen/specs/organisms/product-info.json
The details of a product under its buy box: texts in an accordion (native details) beside a card with the specs. Axes: layout (split: the specs beside the texts, stacked: below them), expand (first: the first text open, none), tone.
Props (p): id, title, details, specs, labels, layout, expand, tone, landmarkLabel. -#}
{%- set v_id = (p.id ?? null) -%}
{%- set v_title = (p.title ?? null) -%}
{%- set v_details = (p.details ?? null) -%}
{%- set v_specs = (p.specs ?? null) -%}
{%- set v_labels = (p.labels ?? null) -%}
{%- set v_layout = (p.layout ?? 'split') -%}
{%- set v_expand = (p.expand ?? 'first') -%}
{%- set v_tone = (p.tone ?? 'default') -%}
{%- set v_landmarkLabel = (p.landmarkLabel ?? null) -%}
{%- set c_13 -%}
{%- set c_12 -%}
{%- set c_5 -%}
{%- for v_d in ui_l(v_details) %}
{%- set v_i = loop.index0 -%}
{%- set c_4 -%}
{%- set c_2 -%}
{%- set c_1 -%}
{{ ui_text(ui_get(v_d, ['title'])) }}
{%- endset -%}
{{ include('ui/inline/inline.html.twig', {'p': {'Class': 'text-base font-semibold'}, 'children': c_1}, with_context = false) }}
{%- endset -%}
{{ include('ui/disclosure/summary.html.twig', {'p': {'Variant': 'item'}, 'children': c_2}, with_context = false) }}
{%- set c_3 -%}
{{ ui_text(ui_get(v_d, ['text'])) }}
{%- endset -%}
{{ include('ui/text/text.html.twig', {'p': {'Size': 'sm', 'Class': 'pb-4 text-muted-foreground'}, 'children': c_3}, with_context = false) }}
{%- endset -%}
{{ include('ui/disclosure/disclosure.html.twig', {'p': {'Variant': 'item', 'Open': ui_t(ui_and([ui_eq(v_expand, 'first'), ui_eq(v_i, 0)])), 'Attrs': ui_attrs(['data-testid', 'item'])}, 'children': c_4}, with_context = false) }}
{%- endfor %}
{%- endset -%}
{{ include('ui/stack/stack.html.twig', {'p': {'Gap': '0', 'Align': 'stretch', 'Class': ui_s((ui_t(ui_eq(v_layout, 'split')) ? 'lg:col-span-2' : '')), 'Attrs': ui_attrs(['data-testid', 'items'])}, 'children': c_5}, with_context = false) }}
{%- set c_11 -%}
{%- set c_6 -%}
{{ ui_text(ui_get(v_labels, ['specs'])) }}
{%- endset -%}
{{ include('ui/title/title.html.twig', {'p': {'As': ui_i(3), 'Size': 'lg', 'Weight': 'bold'}, 'children': c_6}, with_context = false) }}
{%- set c_10 -%}
{%- for v_s in ui_l(v_specs) %}
{%- set c_9 -%}
{%- set c_7 -%}
{{ ui_text(ui_get(v_s, ['label'])) }}
{%- endset -%}
{{ include('ui/inline/inline.html.twig', {'p': {'Class': 'text-muted-foreground'}, 'children': c_7}, with_context = false) }}
{%- set c_8 -%}
{{ ui_text(ui_get(v_s, ['value'])) }}
{%- endset -%}
{{ include('ui/inline/inline.html.twig', {'p': {'Class': 'font-medium'}, 'children': c_8}, with_context = false) }}
{%- endset -%}
{{ include('ui/list/list-item.html.twig', {'p': {'Class': 'flex items-center justify-between gap-4 border-b border-border py-2 text-sm last:border-b-0', 'Attrs': ui_attrs(['data-testid', 'spec'])}, 'children': c_9}, with_context = false) }}
{%- endfor %}
{%- endset -%}
{{ include('ui/list/list.html.twig', {'p': {'Tag': 'ul', 'Class': 'flex flex-col'}, 'children': c_10}, with_context = false) }}
{%- endset -%}
{{ include('ui/stack/stack.html.twig', {'p': {'Gap': '4', 'Align': 'stretch', 'Class': 'rounded bg-card inset-ring inset-ring-border p-6', 'Attrs': ui_attrs(['data-testid', 'specs'])}, 'children': c_11}, with_context = false) }}
{%- endset -%}
{{ include('ui/box/box.html.twig', {'p': {'Class': ui_s((ui_t(ui_eq(v_layout, 'split')) ? 'grid grid-cols-1 items-start gap-8 lg:grid-cols-3' : 'grid grid-cols-1 gap-8'))}, 'children': c_12}, with_context = false) }}
{%- endset -%}
{{ include('blocks/section-frame.html.twig', {'p': {'id': v_id, 'title': v_title, 'tone': v_tone, 'landmarkLabel': v_landmarkLabel}, 'children': c_13}, with_context = false) }}
{#- Code generated by xgen. DO NOT EDIT.
Source: xgen/specs/organisms/review-list.json
Customer reviews as cards or plain entries: rating, title, text, author and date. Axes: layout (list, grid), columns, item (card, plain), avatar (none, image), tone, density.
Props (p): id, title, reviews, labels, layout, item, avatar, tone, density, landmarkLabel. -#}
{%- set v_id = (p.id ?? null) -%}
{%- set v_title = (p.title ?? null) -%}
{%- set v_reviews = (p.reviews ?? null) -%}
{%- set v_labels = (p.labels ?? null) -%}
{%- set v_layout = (p.layout ?? 'list') -%}
{%- set v_item = (p.item ?? 'card') -%}
{%- set v_avatar = (p.avatar ?? 'none') -%}
{%- set v_tone = (p.tone ?? 'default') -%}
{%- set v_density = (p.density ?? 'default') -%}
{%- set v_landmarkLabel = (p.landmarkLabel ?? null) -%}
{%- set c_9 -%}
{%- set c_8 -%}
{%- for v_r in ui_l(v_reviews) %}
{%- set c_7 -%}
{{ include('blocks/rating.html.twig', {'p': {'value': ui_get(v_r, ['rating']), 'label': ui_tpl(ui_get(v_labels, ['ratingLabel']), [ui_get(v_r, ['rating'])])}}, with_context = false) }}
{%- set c_1 -%}
{{ ui_text(ui_get(v_r, ['title'])) }}
{%- endset -%}
{{ include('ui/title/title.html.twig', {'p': {'As': ui_i(3), 'Size': 'base', 'Weight': 'bold'}, 'children': c_1}, with_context = false) }}
{%- set c_2 -%}
{{ ui_text(ui_get(v_r, ['text'])) }}
{%- endset -%}
{{ include('ui/text/text.html.twig', {'p': {'Size': 'sm', 'Class': 'text-muted-foreground'}, 'children': c_2}, with_context = false) }}
{%- set c_6 -%}
{%- if ui_t(ui_eq(v_avatar, 'image')) %}
{{ include('blocks/media-frame.html.twig', {'p': {'alt': ui_get(v_r, ['author']), 'ratio': '1/1', 'className': ui_cnv(['size-10 shrink-0 rounded-full'])}}, with_context = false) }}
{%- endif %}
{%- set c_5 -%}
{%- set c_3 -%}
{{ ui_text(ui_get(v_r, ['author'])) }}
{%- endset -%}
{{ include('ui/text/text.html.twig', {'p': {'Size': 'sm', 'Weight': 'semibold'}, 'children': c_3}, with_context = false) }}
{%- set c_4 -%}
{{ ui_text(ui_get(v_r, ['date'])) }}
{%- endset -%}
{{ include('ui/text/text.html.twig', {'p': {'Size': 'xs', 'Class': 'text-muted-foreground'}, 'children': c_4}, with_context = false) }}
{%- endset -%}
{{ include('ui/stack/stack.html.twig', {'p': {'Gap': '0'}, 'children': c_5}, with_context = false) }}
{%- endset -%}
{{ include('ui/group/group.html.twig', {'p': {'Gap': '4', 'Align': 'center', 'Class': 'mt-auto'}, 'children': c_6}, with_context = false) }}
{%- endset -%}
{{ include('blocks/article-block.html.twig', {'p': {'className': ui_cnv([ui_cnv(['flex h-full flex-col gap-4', (ui_t(ui_eq(v_item, 'card')) ? 'rounded bg-card p-6 inset-ring inset-ring-border' : 'border-b border-border pb-4')])]), 'testid': 'item'}, 'children': c_7}, with_context = false) }}
{%- endfor %}
{%- endset -%}
{{ include('ui/grid/grid.html.twig', {'p': {'Cols': ui_s((ui_t(ui_eq(v_layout, 'grid')) ? '1-3' : '1')), 'Class': 'gap-4', 'Attrs': ui_attrs(['data-testid', 'items'])}, 'children': c_8}, with_context = false) }}
{%- endset -%}
{{ include('blocks/section-frame.html.twig', {'p': {'id': v_id, 'title': v_title, 'tone': v_tone, 'density': v_density, 'measure': (ui_t(ui_eq(v_layout, 'list')) ? '2xl' : 'default'), 'landmarkLabel': v_landmarkLabel}, 'children': c_9}, with_context = false) }}
{#- Code generated by xgen. DO NOT EDIT.
Source: xgen/specs/organisms/product-grid.json
A section with a heading and the products as cards in a grid, as a list of horizontal cards, or as a rail that scrolls sideways. Axes: layout (grid, list, rail), columns, ratio, rating, action, tone, density.
Props (p): id, title, products, labels, badges, layout, cols, ratio, rating, action, tone, density, landmarkLabel. -#}
{%- set v_id = (p.id ?? null) -%}
{%- set v_title = (p.title ?? null) -%}
{%- set v_products = (p.products ?? null) -%}
{%- set v_labels = (p.labels ?? null) -%}
{%- set v_badges = (p.badges ?? null) -%}
{%- set v_layout = (p.layout ?? 'grid') -%}
{%- set v_cols = (p.cols ?? '1-3') -%}
{%- set v_ratio = (p.ratio ?? '4/3') -%}
{%- set v_rating = (p.rating ?? 'show') -%}
{%- set v_action = (p.action ?? 'button') -%}
{%- set v_tone = (p.tone ?? 'default') -%}
{%- set v_density = (p.density ?? 'default') -%}
{%- set v_landmarkLabel = (p.landmarkLabel ?? null) -%}
{%- set c_4 -%}
{%- if ui_t(ui_eq(v_layout, 'rail')) %}
{%- set c_2 -%}
{%- for v_p in ui_l(v_products) %}
{%- set c_1 -%}
{{ include('blocks/product-card.html.twig', {'p': {'product': v_p, 'labels': v_labels, 'badges': v_badges, 'layout': (ui_t(ui_eq(v_layout, 'list')) ? 'horizontal' : 'vertical'), 'ratio': v_ratio, 'rating': v_rating, 'action': v_action, 'density': (ui_t(ui_eq(v_density, 'compact')) ? 'compact' : 'default')}}, with_context = false) }}
{%- endset -%}
{{ include('ui/box/box.html.twig', {'p': {'Class': 'w-64 shrink-0 snap-start'}, 'children': c_1}, with_context = false) }}
{%- endfor %}
{%- endset -%}
{{ include('ui/box/box.html.twig', {'p': {'Class': 'flex snap-x gap-4 overflow-x-auto pb-4', 'Attrs': ui_attrs(['data-testid', 'items'])}, 'children': c_2}, with_context = false) }}
{%- else %}
{%- set c_3 -%}
{%- for v_p in ui_l(v_products) %}
{{ include('blocks/product-card.html.twig', {'p': {'product': v_p, 'labels': v_labels, 'badges': v_badges, 'layout': (ui_t(ui_eq(v_layout, 'list')) ? 'horizontal' : 'vertical'), 'ratio': v_ratio, 'rating': v_rating, 'action': v_action, 'density': (ui_t(ui_eq(v_density, 'compact')) ? 'compact' : 'default')}}, with_context = false) }}
{%- endfor %}
{%- endset -%}
{{ include('ui/grid/grid.html.twig', {'p': {'Cols': ui_s((ui_t(ui_eq(v_layout, 'list')) ? '1' : v_cols)), 'Class': 'gap-4', 'Attrs': ui_attrs(['data-testid', 'items'])}, 'children': c_3}, with_context = false) }}
{%- endif %}
{%- endset -%}
{{ include('blocks/section-frame.html.twig', {'p': {'id': v_id, 'title': v_title, 'tone': v_tone, 'density': v_density, 'landmarkLabel': v_landmarkLabel}, 'children': c_4}, with_context = false) }}
{#- Code generated by xgen. DO NOT EDIT.
Source: xgen/specs/organisms/sitemap-footer.json
A footer with the brand, a tagline, groups of links and the copyright. Axes: layout (columns: brand above, equal columns per group, row: the brand, the group names and the copyright in one row), signup mode (none, first: a sign-up above the links), status mode (none, show: a live status pill), density. The live status itself is a port contract.
Props (p): label, brand, tagline, copyright, groups, signup, status, id, layout, density, landmarkLabel. -#}
{%- set v_label = (p.label ?? null) -%}
{%- set v_brand = (p.brand ?? null) -%}
{%- set v_tagline = (p.tagline ?? null) -%}
{%- set v_copyright = (p.copyright ?? null) -%}
{%- set v_groups = (p.groups ?? null) -%}
{%- set v_signup = (p.signup ?? null) -%}
{%- set v_status = (p.status ?? null) -%}
{%- set v_id = (p.id ?? 'footer') -%}
{%- set v_layout = (p.layout ?? 'columns') -%}
{%- set v_density = (p.density ?? 'default') -%}
{%- set v_landmarkLabel = (p.landmarkLabel ?? null) -%}
{%- if ui_t(ui_eq(v_layout, 'card')) %}
{{ include('blocks/footer-card.html.twig', {'p': {'label': v_label, 'brand': v_brand, 'groups': v_groups, 'landmarkLabel': v_landmarkLabel}}, with_context = false) }}
{%- else %}
{%- set c_21 -%}
{%- set c_20 -%}
{%- if ui_t(ui_eq(ui_get(v_signup, ['mode']), 'first')) %}
{%- set c_6 -%}
{%- set c_1 -%}
{{ ui_text(ui_get(v_signup, ['title'])) }}
{%- endset -%}
{{ include('ui/title/title.html.twig', {'p': {'As': ui_i(3), 'Size': 'xl', 'Weight': 'bold'}, 'children': c_1}, with_context = false) }}
{%- set c_5 -%}
{%- set c_2 -%}
{{ ui_text(ui_get(v_signup, ['label'])) }}
{%- endset -%}
{{ include('ui/label/label.html.twig', {'p': {'HTMLFor': ui_s(ui_tpl('{0}-email', [v_id])), 'Class': 'sr-only'}, 'children': c_2}, with_context = false) }}
{%- set c_4 -%}
{{ include('ui/input/input.html.twig', {'p': {'Type': 'email', 'Name': 'email', 'Class': 'min-w-0 flex-1', 'Attrs': ui_attrs(['id', ui_tpl('{0}-email', [v_id]), 'data-testid', 'field'])}}, with_context = false) }}
{%- set c_3 -%}
{{ ui_text(ui_get(v_signup, ['submit'])) }}
{%- endset -%}
{{ include('ui/button/button.html.twig', {'p': {'Variant': 'default', 'Size': 'default', 'Type': 'submit', 'Attrs': ui_attrs(['data-testid', 'submit'])}, 'children': c_3}, with_context = false) }}
{%- endset -%}
{{ include('ui/group/group.html.twig', {'p': {'Gap': '2', 'Align': 'start', 'Class': 'w-full flex-wrap'}, 'children': c_4}, with_context = false) }}
{%- endset -%}
{{ include('ui/form/form.html.twig', {'p': {'Method': 'dialog', 'Class': ui_s(ui_cnv(['w-full max-w-md', (ui_t(false) ? 'mx-auto' : '')])), 'Attrs': ui_attrs(['data-testid', 'email-form'])}, 'children': c_5}, with_context = false) }}
{%- endset -%}
{{ include('ui/stack/stack.html.twig', {'p': {'Gap': '4', 'Class': 'max-w-md', 'Attrs': ui_attrs(['data-testid', 'signup'])}, 'children': c_6}, with_context = false) }}
{%- endif %}
{%- if ui_t(ui_eq(v_layout, 'columns')) %}
{%- set c_11 -%}
{%- set c_9 -%}
{%- set c_7 -%}
{{ ui_text(v_brand) }}
{%- endset -%}
{{ include('ui/text/text.html.twig', {'p': {'Size': 'xl', 'Weight': 'bold'}, 'children': c_7}, with_context = false) }}
{%- set c_8 -%}
{{ ui_text(v_tagline) }}
{%- endset -%}
{{ include('ui/text/text.html.twig', {'p': {'Size': 'sm', 'Class': 'text-muted-foreground'}, 'children': c_8}, with_context = false) }}
{%- endset -%}
{{ include('ui/stack/stack.html.twig', {'p': {'Gap': '2', 'Class': 'md:w-64 md:shrink-0'}, 'children': c_9}, with_context = false) }}
{%- set c_10 -%}
{{ include('blocks/footer-columns.html.twig', {'p': {'label': v_label, 'groups': v_groups, 'landmarkLabel': v_landmarkLabel}}, with_context = false) }}
{%- endset -%}
{{ include('ui/box/box.html.twig', {'p': {'Class': 'min-w-0 flex-1'}, 'children': c_10}, with_context = false) }}
{%- endset -%}
{{ include('ui/box/box.html.twig', {'p': {'Class': 'flex flex-col gap-8 md:flex-row md:items-start md:gap-12', 'Attrs': ui_attrs(['data-slot', 'footer-top'])}, 'children': c_11}, with_context = false) }}
{%- else %}
{%- set c_16 -%}
{%- set c_12 -%}
{{ ui_text(v_brand) }}
{%- endset -%}
{{ include('ui/text/text.html.twig', {'p': {'Size': 'base', 'Weight': 'bold'}, 'children': c_12}, with_context = false) }}
{%- set c_15 -%}
{%- set c_14 -%}
{%- for v_g in ui_l(v_groups) %}
{%- set c_13 -%}
{{ ui_text(ui_get(v_g, ['title'])) }}
{%- endset -%}
{{ include('ui/link/link.html.twig', {'p': {'Href': '#/', 'Variant': 'default', 'Class': 'text-sm', 'Attrs': ui_attrs(['data-testid', 'group'])}, 'children': c_13}, with_context = false) }}
{%- endfor %}
{%- endset -%}
{{ include('ui/group/group.html.twig', {'p': {'Gap': '4', 'Class': 'flex-wrap'}, 'children': c_14}, with_context = false) }}
{%- endset -%}
{{ include('blocks/nav-block.html.twig', {'p': {'label': (ui_t(v_landmarkLabel) ? ui_uniq(ui_tpl('{0}, {1}', [v_label, v_landmarkLabel])) : v_label)}, 'children': c_15}, with_context = false) }}
{%- endset -%}
{{ include('ui/group/group.html.twig', {'p': {'Gap': '6', 'Align': 'center', 'Justify': 'between', 'Class': 'flex-wrap'}, 'children': c_16}, with_context = false) }}
{%- endif %}
{%- set c_19 -%}
{%- set c_17 -%}
{{ ui_text(v_copyright) }}
{%- endset -%}
{{ include('ui/text/text.html.twig', {'p': {'Size': 'sm', 'Class': 'text-muted-foreground'}, 'children': c_17}, with_context = false) }}
{%- if ui_t(ui_eq(ui_get(v_status, ['mode']), 'show')) %}
{%- set c_18 -%}
{{ ui_text(ui_get(v_status, ['label'])) }}
{%- endset -%}
{{ include('blocks/pill.html.twig', {'p': {'tone': 'green', 'icon': 'circle-check'}, 'children': c_18}, with_context = false) }}
{%- endif %}
{%- endset -%}
{{ include('ui/group/group.html.twig', {'p': {'Gap': '4', 'Align': 'center', 'Justify': 'between', 'Class': 'flex-wrap border-t border-border pt-6'}, 'children': c_19}, with_context = false) }}
{%- endset -%}
{{ include('ui/container/container.html.twig', {'p': {'Class': ui_s(ui_cnv(['mx-auto w-full max-w-6xl px-4', 'flex flex-col gap-8', (ui_t(ui_eq(v_density, 'compact')) ? 'py-6' : 'py-12')])), 'Attrs': ui_attrs(['data-slot', 'container'])}, 'children': c_20}, with_context = false) }}
{%- endset -%}
{{ include('ui/block/block.html.twig', {'p': {'Tag': 'footer', 'Class': 'mt-12 border-t border-border', 'Attrs': ui_attrs(['data-testid', 'site-footer', 'data-layout', v_layout, 'aria-label', v_landmarkLabel])}, 'children': c_21}, with_context = false) }}
{%- endif %}
Jinja2 is not installed by the CLI. Copy the template files below into your Jinja2 templates, together with the ui8kit_jinja Python package from packages/jinja2/ui of the source:
- py/ui8kit_jinja/__init__.py
- py/ui8kit_jinja/cn_merge.py
- py/ui8kit_jinja/runtime.py
{#- Code generated by xgen. DO NOT EDIT.
Source: xgen/specs/organisms/nav-bar.json
A top bar in four shapes. Axes: layout (inline: brand left, links, button right; split: the brand in the middle with the links on both sides; search: a search field with its shortcut in the middle), over (none, media: the bar sits over a picture, transparent), actions mode (none, cta), tone (default, inverse: on a dark hero band). Turning solid on scroll is a port contract.
Props (p): label, brand, links, current, actions, search, tone, layout, over, skip, landmarkLabel. -#}
{%- set v_label = ui_def(p['label'], none) -%}
{%- set v_brand = ui_def(p['brand'], none) -%}
{%- set v_links = ui_def(p['links'], none) -%}
{%- set v_current = ui_def(p['current'], '') -%}
{%- set v_actions = ui_def(p['actions'], none) -%}
{%- set v_search = ui_def(p['search'], none) -%}
{%- set v_tone = ui_def(p['tone'], 'default') -%}
{%- set v_layout = ui_def(p['layout'], 'inline') -%}
{%- set v_over = ui_def(p['over'], 'none') -%}
{%- set v_skip = ui_def(p['skip'], none) -%}
{%- set v_landmarkLabel = ui_def(p['landmarkLabel'], none) -%}
{%- set c_13 -%}
{{ ui_include('blocks/over-media.html.j2', {'p': {'on': ui_eq(v_over, 'media'), 'alt': v_brand}}) }}
{%- if ui_t(v_skip) %}
{%- set c_1 -%}
{{ ui_text(v_skip) }}
{%- endset -%}
{{ ui_include('ui/link-plain/link-plain.html.j2', {'p': {'Href': '#main-content', 'Class': 'sr-only focus:not-sr-only focus:fixed focus:left-2 focus:top-2 focus:z-50 focus:rounded focus:bg-background focus:px-4 focus:py-2 focus:text-sm focus:inset-ring focus:inset-ring-border', 'Attrs': ui_attrs(['data-testid', 'skip-link'])}, 'children': c_1}) }}
{%- endif %}
{%- set c_12 -%}
{%- set c_11 -%}
{%- if ui_t(ui_eq(v_layout, 'split')) %}
{%- set c_8 -%}
{%- set c_7 -%}
{%- set c_2 -%}
{{ ui_include('blocks/nav-links.html.j2', {'p': {'links': v_links, 'current': v_current, 'side': 'left'}}) }}
{%- endset -%}
{{ ui_include('ui/box/box.html.j2', {'p': {'Class': 'md:justify-self-start'}, 'children': c_2}) }}
{%- set c_4 -%}
{%- set c_3 -%}
{{ ui_text(v_brand) }}
{%- endset -%}
{{ ui_include('ui/link/link.html.j2', {'p': {'Href': '#/', 'Variant': 'default', 'Class': 'text-lg font-medium', 'Attrs': ui_attrs(['data-testid', 'brand'])}, 'children': c_3}) }}
{%- endset -%}
{{ ui_include('ui/box/box.html.j2', {'p': {'Class': 'text-center'}, 'children': c_4}) }}
{%- set c_6 -%}
{%- set c_5 -%}
{{ ui_include('blocks/nav-links.html.j2', {'p': {'links': v_links, 'current': v_current, 'side': 'right'}}) }}
{%- endset -%}
{{ ui_include('ui/box/box.html.j2', {'p': {}, 'children': c_5}) }}
{{ ui_include('blocks/nav-actions.html.j2', {'p': {'login': ui_get(v_actions, ['login']), 'loginHref': ui_get(v_actions, ['loginHref']), 'cta': ui_get(v_actions, ['cta']), 'ctaHref': ui_get(v_actions, ['href']), 'actions': ui_get(v_actions, ['mode']), 'tone': v_tone, 'themeLabel': ui_get(v_actions, ['themeLabel'])}}) }}
{%- endset -%}
{{ ui_include('ui/group/group.html.j2', {'p': {'Gap': '4', 'Align': 'center', 'Justify': 'end', 'Class': 'flex-wrap md:justify-self-end'}, 'children': c_6}) }}
{%- endset -%}
{{ ui_include('ui/grid/grid.html.j2', {'p': {'Cols': '1-3', 'Class': 'w-full items-center gap-4'}, 'children': c_7}) }}
{%- endset -%}
{{ ui_include('blocks/nav-block.html.j2', {'p': {'label': (ui_uniq(ui_tpl('{0}, {1}', [v_label, v_landmarkLabel])) if ui_t(v_landmarkLabel) else v_label), 'className': ui_cnv(['w-full']), 'testid': 'site-nav'}, 'children': c_8}) }}
{%- else %}
{%- set c_9 -%}
{{ ui_text(v_brand) }}
{%- endset -%}
{{ ui_include('ui/link/link.html.j2', {'p': {'Href': '#/', 'Variant': 'default', 'Class': 'text-lg font-medium', 'Attrs': ui_attrs(['data-testid', 'brand'])}, 'children': c_9}) }}
{%- if ui_t(ui_eq(v_layout, 'search')) %}
{{ ui_include('blocks/search-palette.html.j2', {'p': {'label': ui_get(v_search, ['label']), 'shortcut': ui_get(v_search, ['shortcut'])}}) }}
{%- endif %}
{%- set c_10 -%}
{{ ui_include('blocks/nav-links.html.j2', {'p': {'links': v_links, 'current': v_current}}) }}
{%- endset -%}
{{ ui_include('blocks/nav-block.html.j2', {'p': {'label': (ui_uniq(ui_tpl('{0}, {1}', [v_label, v_landmarkLabel])) if ui_t(v_landmarkLabel) else v_label), 'className': ui_cnv(['order-last w-full overflow-x-auto md:order-none md:w-auto [&>div]:flex-nowrap md:[&>div]:flex-wrap [&_a]:shrink-0']), 'testid': 'site-nav'}, 'children': c_10}) }}
{{ ui_include('blocks/nav-actions.html.j2', {'p': {'login': ui_get(v_actions, ['login']), 'loginHref': ui_get(v_actions, ['loginHref']), 'cta': ui_get(v_actions, ['cta']), 'ctaHref': ui_get(v_actions, ['href']), 'actions': ui_get(v_actions, ['mode']), 'tone': v_tone, 'themeLabel': ui_get(v_actions, ['themeLabel'])}}) }}
{%- endif %}
{%- endset -%}
{{ ui_include('ui/box/box.html.j2', {'p': {'Class': ui_s(ui_cnv(['flex flex-wrap items-center justify-between gap-4', 'py-4']))}, 'children': c_11}) }}
{%- endset -%}
{{ ui_include('ui/container/container.html.j2', {'p': {'Class': 'mx-auto w-full max-w-6xl px-4', 'Attrs': ui_attrs(['data-slot', 'container'])}, 'children': c_12}) }}
{%- endset -%}
{{ ui_include('ui/block/block.html.j2', {'p': {'Tag': 'header', 'Class': ui_s(ui_cnv(['relative', ('border-b border-transparent bg-foreground text-background [&_a]:text-background [&_button]:text-background' if ui_t(ui_eq(v_tone, 'inverse')) else 'border-b border-border bg-background'), ('isolate overflow-hidden border-0 bg-transparent' if ui_t(ui_eq(v_over, 'media')) else '')])), 'Attrs': ui_attrs(['data-testid', 'nav-bar', 'data-layout', v_layout, 'data-tone', v_tone, 'aria-label', v_landmarkLabel])}, 'children': c_13}) }}
{#- Code generated by xgen. DO NOT EDIT.
Source: xgen/specs/organisms/product-detail.json
A product page: a gallery (the main picture and optional thumbnails) beside the buy box (badge, rating, price, stock, quantity, add button, shipping and returns notes). Axes: layout (split, stacked), media side, thumbs (none, below), buy (full, compact), tone, density.
Props (p): id, product, labels, badges, level, layout, mediaSide, thumbs, buy, tone, density, landmarkLabel. -#}
{%- set v_id = ui_def(p['id'], none) -%}
{%- set v_product = ui_def(p['product'], none) -%}
{%- set v_labels = ui_def(p['labels'], none) -%}
{%- set v_badges = ui_def(p['badges'], none) -%}
{%- set v_level = ui_def(p['level'], 1) -%}
{%- set v_layout = ui_def(p['layout'], 'split') -%}
{%- set v_mediaSide = ui_def(p['mediaSide'], 'start') -%}
{%- set v_thumbs = ui_def(p['thumbs'], 'below') -%}
{%- set v_buy = ui_def(p['buy'], 'full') -%}
{%- set v_tone = ui_def(p['tone'], 'default') -%}
{%- set v_density = ui_def(p['density'], 'default') -%}
{%- set v_landmarkLabel = ui_def(p['landmarkLabel'], none) -%}
{%- set f_15 -%}
{%- set c_17 -%}
{{ ui_include('blocks/media-frame.html.j2', {'p': {'alt': ui_get(v_product, ['name']), 'ratio': '1/1'}}) }}
{%- if ui_t(ui_eq(v_thumbs, 'below')) %}
{%- set c_16 -%}
{{ ui_include('blocks/media-frame.html.j2', {'p': {'alt': ui_get(v_product, ['name']), 'ratio': '1/1', 'className': ui_cnv(['ring-2 ring-foreground'])}}) }}
{{ ui_include('blocks/media-frame.html.j2', {'p': {'alt': ui_get(v_product, ['name']), 'ratio': '1/1'}}) }}
{{ ui_include('blocks/media-frame.html.j2', {'p': {'alt': ui_get(v_product, ['name']), 'ratio': '1/1'}}) }}
{%- endset -%}
{{ ui_include('ui/grid/grid.html.j2', {'p': {'Cols': '3', 'Class': 'gap-4', 'Attrs': ui_attrs(['data-testid', 'thumbs'])}, 'children': c_16}) }}
{%- endif %}
{%- endset -%}
{{ ui_include('ui/stack/stack.html.j2', {'p': {'Gap': '4', 'Align': 'stretch', 'Attrs': ui_attrs(['data-testid', 'gallery'])}, 'children': c_17}) }}
{%- endset -%}
{%- set c_18 -%}
{%- set c_14 -%}
{%- set c_3 -%}
{%- set c_1 -%}
{{ ui_text(ui_money(ui_get(v_product, ['price']), ui_get(v_product, ['currency']))) }}
{%- endset -%}
{{ ui_include('ui/text/text.html.j2', {'p': {'Size': '4xl', 'Weight': 'bold'}, 'children': c_1}) }}
{%- if ui_t(ui_get(v_product, ['badge'])) %}
{%- set c_2 -%}
{{ ui_text(ui_at(v_badges, ui_get(v_product, ['badge']))) }}
{%- endset -%}
{{ ui_include('ui/badge/badge.html.j2', {'p': {'Variant': 'default', 'Size': 'default'}, 'children': c_2}) }}
{%- endif %}
{%- endset -%}
{{ ui_include('ui/group/group.html.j2', {'p': {'Gap': '4', 'Align': 'center', 'Class': 'flex-wrap'}, 'children': c_3}) }}
{%- set c_5 -%}
{{ ui_include('blocks/rating.html.j2', {'p': {'value': ui_get(v_product, ['rating']), 'label': ui_tpl(ui_get(v_labels, ['ratingLabel']), [ui_get(v_product, ['rating'])])}}) }}
{%- set c_4 -%}
{{ ui_text(ui_tpl(ui_get(v_labels, ['reviews']), [ui_get(v_product, ['reviews'])])) }}
{%- endset -%}
{{ ui_include('ui/text/text.html.j2', {'p': {'Size': 'sm', 'Class': 'text-muted-foreground'}, 'children': c_4}) }}
{%- endset -%}
{{ ui_include('ui/group/group.html.j2', {'p': {'Gap': '2'}, 'children': c_5}) }}
{%- set c_6 -%}
{{ ui_text((ui_get(v_labels, ['inStock']) if ui_t(ui_get(v_product, ['inStock'])) else ui_get(v_labels, ['soldOut']))) }}
{%- endset -%}
{{ ui_include('ui/text/text.html.j2', {'p': {'Size': 'sm', 'Weight': 'medium', 'Class': ui_s(('text-foreground' if ui_t(ui_get(v_product, ['inStock'])) else 'text-destructive')), 'Attrs': ui_attrs(['data-testid', 'stock'])}, 'children': c_6}) }}
{%- set c_8 -%}
{%- if ui_t(ui_eq(v_buy, 'full')) %}
{{ ui_include('blocks/number-field.html.j2', {'p': {'value': '1', 'name': ui_tpl('{0}-qty', [v_id]), 'min': '1', 'label': ui_get(v_labels, ['qty']), 'decrease': ui_get(v_labels, ['decrease']), 'increase': ui_get(v_labels, ['increase'])}}) }}
{%- endif %}
{%- set c_7 -%}
{{ ui_text(ui_get(v_labels, ['add'])) }}
{%- endset -%}
{{ ui_include('ui/button/button.html.j2', {'p': {'Disabled': ui_t(not (ui_t(ui_get(v_product, ['inStock'])))), 'Attrs': ui_attrs(['data-testid', 'add'])}, 'children': c_7}) }}
{%- endset -%}
{{ ui_include('ui/group/group.html.j2', {'p': {'Gap': '4', 'Class': 'flex-wrap'}, 'children': c_8}) }}
{%- if ui_t(ui_eq(v_buy, 'full')) %}
{%- set c_13 -%}
{%- set c_10 -%}
{{ ui_include('ui/lucide-icon/lucide-icon.html.j2', {'p': {'Name': 'truck', 'Size': 16}}) }}
{%- set c_9 -%}
{{ ui_text(ui_get(v_labels, ['shipping'])) }}
{%- endset -%}
{{ ui_include('ui/inline/inline.html.j2', {'p': {}, 'children': c_9}) }}
{%- endset -%}
{{ ui_include('ui/list/list-item.html.j2', {'p': {'Class': 'flex items-center gap-2'}, 'children': c_10}) }}
{%- set c_12 -%}
{{ ui_include('ui/lucide-icon/lucide-icon.html.j2', {'p': {'Name': 'shield-check', 'Size': 16}}) }}
{%- set c_11 -%}
{{ ui_text(ui_get(v_labels, ['returns'])) }}
{%- endset -%}
{{ ui_include('ui/inline/inline.html.j2', {'p': {}, 'children': c_11}) }}
{%- endset -%}
{{ ui_include('ui/list/list-item.html.j2', {'p': {'Class': 'flex items-center gap-2'}, 'children': c_12}) }}
{%- endset -%}
{{ ui_include('ui/list/list.html.j2', {'p': {'Tag': 'ul', 'Class': 'flex flex-col gap-2 text-sm text-muted-foreground'}, 'children': c_13}) }}
{%- endif %}
{%- endset -%}
{{ ui_include('ui/stack/stack.html.j2', {'p': {'Gap': '4', 'Align': 'stretch', 'Attrs': ui_attrs(['data-testid', 'buy-box'])}, 'children': c_14}) }}
{%- endset -%}
{{ ui_include('blocks/section-frame.html.j2', {'p': {'id': v_id, 'title': ui_get(v_product, ['name']), 'lead': ui_get(v_product, ['summary']), 'heading': {'level': v_level}, 'layout': ('split' if ui_t(ui_eq(v_layout, 'split')) else 'stack'), 'media': {'show': true, 'side': v_mediaSide, 'align': 'start'}, 'tone': v_tone, 'density': v_density, 'landmarkLabel': v_landmarkLabel, 'aside': f_15}, 'children': c_18}) }}
{#- Code generated by xgen. DO NOT EDIT.
Source: xgen/specs/organisms/product-info.json
The details of a product under its buy box: texts in an accordion (native details) beside a card with the specs. Axes: layout (split: the specs beside the texts, stacked: below them), expand (first: the first text open, none), tone.
Props (p): id, title, details, specs, labels, layout, expand, tone, landmarkLabel. -#}
{%- set v_id = ui_def(p['id'], none) -%}
{%- set v_title = ui_def(p['title'], none) -%}
{%- set v_details = ui_def(p['details'], none) -%}
{%- set v_specs = ui_def(p['specs'], none) -%}
{%- set v_labels = ui_def(p['labels'], none) -%}
{%- set v_layout = ui_def(p['layout'], 'split') -%}
{%- set v_expand = ui_def(p['expand'], 'first') -%}
{%- set v_tone = ui_def(p['tone'], 'default') -%}
{%- set v_landmarkLabel = ui_def(p['landmarkLabel'], none) -%}
{%- set c_13 -%}
{%- set c_12 -%}
{%- set c_5 -%}
{%- for v_d in ui_l(v_details) %}
{%- set v_i = loop.index0 -%}
{%- set c_4 -%}
{%- set c_2 -%}
{%- set c_1 -%}
{{ ui_text(ui_get(v_d, ['title'])) }}
{%- endset -%}
{{ ui_include('ui/inline/inline.html.j2', {'p': {'Class': 'text-base font-semibold'}, 'children': c_1}) }}
{%- endset -%}
{{ ui_include('ui/disclosure/summary.html.j2', {'p': {'Variant': 'item'}, 'children': c_2}) }}
{%- set c_3 -%}
{{ ui_text(ui_get(v_d, ['text'])) }}
{%- endset -%}
{{ ui_include('ui/text/text.html.j2', {'p': {'Size': 'sm', 'Class': 'pb-4 text-muted-foreground'}, 'children': c_3}) }}
{%- endset -%}
{{ ui_include('ui/disclosure/disclosure.html.j2', {'p': {'Variant': 'item', 'Open': ui_t(ui_and([ui_eq(v_expand, 'first'), ui_eq(v_i, 0)])), 'Attrs': ui_attrs(['data-testid', 'item'])}, 'children': c_4}) }}
{%- endfor %}
{%- endset -%}
{{ ui_include('ui/stack/stack.html.j2', {'p': {'Gap': '0', 'Align': 'stretch', 'Class': ui_s(('lg:col-span-2' if ui_t(ui_eq(v_layout, 'split')) else '')), 'Attrs': ui_attrs(['data-testid', 'items'])}, 'children': c_5}) }}
{%- set c_11 -%}
{%- set c_6 -%}
{{ ui_text(ui_get(v_labels, ['specs'])) }}
{%- endset -%}
{{ ui_include('ui/title/title.html.j2', {'p': {'As': ui_i(3), 'Size': 'lg', 'Weight': 'bold'}, 'children': c_6}) }}
{%- set c_10 -%}
{%- for v_s in ui_l(v_specs) %}
{%- set c_9 -%}
{%- set c_7 -%}
{{ ui_text(ui_get(v_s, ['label'])) }}
{%- endset -%}
{{ ui_include('ui/inline/inline.html.j2', {'p': {'Class': 'text-muted-foreground'}, 'children': c_7}) }}
{%- set c_8 -%}
{{ ui_text(ui_get(v_s, ['value'])) }}
{%- endset -%}
{{ ui_include('ui/inline/inline.html.j2', {'p': {'Class': 'font-medium'}, 'children': c_8}) }}
{%- endset -%}
{{ ui_include('ui/list/list-item.html.j2', {'p': {'Class': 'flex items-center justify-between gap-4 border-b border-border py-2 text-sm last:border-b-0', 'Attrs': ui_attrs(['data-testid', 'spec'])}, 'children': c_9}) }}
{%- endfor %}
{%- endset -%}
{{ ui_include('ui/list/list.html.j2', {'p': {'Tag': 'ul', 'Class': 'flex flex-col'}, 'children': c_10}) }}
{%- endset -%}
{{ ui_include('ui/stack/stack.html.j2', {'p': {'Gap': '4', 'Align': 'stretch', 'Class': 'rounded bg-card inset-ring inset-ring-border p-6', 'Attrs': ui_attrs(['data-testid', 'specs'])}, 'children': c_11}) }}
{%- endset -%}
{{ ui_include('ui/box/box.html.j2', {'p': {'Class': ui_s(('grid grid-cols-1 items-start gap-8 lg:grid-cols-3' if ui_t(ui_eq(v_layout, 'split')) else 'grid grid-cols-1 gap-8'))}, 'children': c_12}) }}
{%- endset -%}
{{ ui_include('blocks/section-frame.html.j2', {'p': {'id': v_id, 'title': v_title, 'tone': v_tone, 'landmarkLabel': v_landmarkLabel}, 'children': c_13}) }}
{#- Code generated by xgen. DO NOT EDIT.
Source: xgen/specs/organisms/review-list.json
Customer reviews as cards or plain entries: rating, title, text, author and date. Axes: layout (list, grid), columns, item (card, plain), avatar (none, image), tone, density.
Props (p): id, title, reviews, labels, layout, item, avatar, tone, density, landmarkLabel. -#}
{%- set v_id = ui_def(p['id'], none) -%}
{%- set v_title = ui_def(p['title'], none) -%}
{%- set v_reviews = ui_def(p['reviews'], none) -%}
{%- set v_labels = ui_def(p['labels'], none) -%}
{%- set v_layout = ui_def(p['layout'], 'list') -%}
{%- set v_item = ui_def(p['item'], 'card') -%}
{%- set v_avatar = ui_def(p['avatar'], 'none') -%}
{%- set v_tone = ui_def(p['tone'], 'default') -%}
{%- set v_density = ui_def(p['density'], 'default') -%}
{%- set v_landmarkLabel = ui_def(p['landmarkLabel'], none) -%}
{%- set c_9 -%}
{%- set c_8 -%}
{%- for v_r in ui_l(v_reviews) %}
{%- set c_7 -%}
{{ ui_include('blocks/rating.html.j2', {'p': {'value': ui_get(v_r, ['rating']), 'label': ui_tpl(ui_get(v_labels, ['ratingLabel']), [ui_get(v_r, ['rating'])])}}) }}
{%- set c_1 -%}
{{ ui_text(ui_get(v_r, ['title'])) }}
{%- endset -%}
{{ ui_include('ui/title/title.html.j2', {'p': {'As': ui_i(3), 'Size': 'base', 'Weight': 'bold'}, 'children': c_1}) }}
{%- set c_2 -%}
{{ ui_text(ui_get(v_r, ['text'])) }}
{%- endset -%}
{{ ui_include('ui/text/text.html.j2', {'p': {'Size': 'sm', 'Class': 'text-muted-foreground'}, 'children': c_2}) }}
{%- set c_6 -%}
{%- if ui_t(ui_eq(v_avatar, 'image')) %}
{{ ui_include('blocks/media-frame.html.j2', {'p': {'alt': ui_get(v_r, ['author']), 'ratio': '1/1', 'className': ui_cnv(['size-10 shrink-0 rounded-full'])}}) }}
{%- endif %}
{%- set c_5 -%}
{%- set c_3 -%}
{{ ui_text(ui_get(v_r, ['author'])) }}
{%- endset -%}
{{ ui_include('ui/text/text.html.j2', {'p': {'Size': 'sm', 'Weight': 'semibold'}, 'children': c_3}) }}
{%- set c_4 -%}
{{ ui_text(ui_get(v_r, ['date'])) }}
{%- endset -%}
{{ ui_include('ui/text/text.html.j2', {'p': {'Size': 'xs', 'Class': 'text-muted-foreground'}, 'children': c_4}) }}
{%- endset -%}
{{ ui_include('ui/stack/stack.html.j2', {'p': {'Gap': '0'}, 'children': c_5}) }}
{%- endset -%}
{{ ui_include('ui/group/group.html.j2', {'p': {'Gap': '4', 'Align': 'center', 'Class': 'mt-auto'}, 'children': c_6}) }}
{%- endset -%}
{{ ui_include('blocks/article-block.html.j2', {'p': {'className': ui_cnv([ui_cnv(['flex h-full flex-col gap-4', ('rounded bg-card p-6 inset-ring inset-ring-border' if ui_t(ui_eq(v_item, 'card')) else 'border-b border-border pb-4')])]), 'testid': 'item'}, 'children': c_7}) }}
{%- endfor %}
{%- endset -%}
{{ ui_include('ui/grid/grid.html.j2', {'p': {'Cols': ui_s(('1-3' if ui_t(ui_eq(v_layout, 'grid')) else '1')), 'Class': 'gap-4', 'Attrs': ui_attrs(['data-testid', 'items'])}, 'children': c_8}) }}
{%- endset -%}
{{ ui_include('blocks/section-frame.html.j2', {'p': {'id': v_id, 'title': v_title, 'tone': v_tone, 'density': v_density, 'measure': ('2xl' if ui_t(ui_eq(v_layout, 'list')) else 'default'), 'landmarkLabel': v_landmarkLabel}, 'children': c_9}) }}
{#- Code generated by xgen. DO NOT EDIT.
Source: xgen/specs/organisms/product-grid.json
A section with a heading and the products as cards in a grid, as a list of horizontal cards, or as a rail that scrolls sideways. Axes: layout (grid, list, rail), columns, ratio, rating, action, tone, density.
Props (p): id, title, products, labels, badges, layout, cols, ratio, rating, action, tone, density, landmarkLabel. -#}
{%- set v_id = ui_def(p['id'], none) -%}
{%- set v_title = ui_def(p['title'], none) -%}
{%- set v_products = ui_def(p['products'], none) -%}
{%- set v_labels = ui_def(p['labels'], none) -%}
{%- set v_badges = ui_def(p['badges'], none) -%}
{%- set v_layout = ui_def(p['layout'], 'grid') -%}
{%- set v_cols = ui_def(p['cols'], '1-3') -%}
{%- set v_ratio = ui_def(p['ratio'], '4/3') -%}
{%- set v_rating = ui_def(p['rating'], 'show') -%}
{%- set v_action = ui_def(p['action'], 'button') -%}
{%- set v_tone = ui_def(p['tone'], 'default') -%}
{%- set v_density = ui_def(p['density'], 'default') -%}
{%- set v_landmarkLabel = ui_def(p['landmarkLabel'], none) -%}
{%- set c_4 -%}
{%- if ui_t(ui_eq(v_layout, 'rail')) %}
{%- set c_2 -%}
{%- for v_p in ui_l(v_products) %}
{%- set c_1 -%}
{{ ui_include('blocks/product-card.html.j2', {'p': {'product': v_p, 'labels': v_labels, 'badges': v_badges, 'layout': ('horizontal' if ui_t(ui_eq(v_layout, 'list')) else 'vertical'), 'ratio': v_ratio, 'rating': v_rating, 'action': v_action, 'density': ('compact' if ui_t(ui_eq(v_density, 'compact')) else 'default')}}) }}
{%- endset -%}
{{ ui_include('ui/box/box.html.j2', {'p': {'Class': 'w-64 shrink-0 snap-start'}, 'children': c_1}) }}
{%- endfor %}
{%- endset -%}
{{ ui_include('ui/box/box.html.j2', {'p': {'Class': 'flex snap-x gap-4 overflow-x-auto pb-4', 'Attrs': ui_attrs(['data-testid', 'items'])}, 'children': c_2}) }}
{%- else %}
{%- set c_3 -%}
{%- for v_p in ui_l(v_products) %}
{{ ui_include('blocks/product-card.html.j2', {'p': {'product': v_p, 'labels': v_labels, 'badges': v_badges, 'layout': ('horizontal' if ui_t(ui_eq(v_layout, 'list')) else 'vertical'), 'ratio': v_ratio, 'rating': v_rating, 'action': v_action, 'density': ('compact' if ui_t(ui_eq(v_density, 'compact')) else 'default')}}) }}
{%- endfor %}
{%- endset -%}
{{ ui_include('ui/grid/grid.html.j2', {'p': {'Cols': ui_s(('1' if ui_t(ui_eq(v_layout, 'list')) else v_cols)), 'Class': 'gap-4', 'Attrs': ui_attrs(['data-testid', 'items'])}, 'children': c_3}) }}
{%- endif %}
{%- endset -%}
{{ ui_include('blocks/section-frame.html.j2', {'p': {'id': v_id, 'title': v_title, 'tone': v_tone, 'density': v_density, 'landmarkLabel': v_landmarkLabel}, 'children': c_4}) }}
{#- Code generated by xgen. DO NOT EDIT.
Source: xgen/specs/organisms/sitemap-footer.json
A footer with the brand, a tagline, groups of links and the copyright. Axes: layout (columns: brand above, equal columns per group, row: the brand, the group names and the copyright in one row), signup mode (none, first: a sign-up above the links), status mode (none, show: a live status pill), density. The live status itself is a port contract.
Props (p): label, brand, tagline, copyright, groups, signup, status, id, layout, density, landmarkLabel. -#}
{%- set v_label = ui_def(p['label'], none) -%}
{%- set v_brand = ui_def(p['brand'], none) -%}
{%- set v_tagline = ui_def(p['tagline'], none) -%}
{%- set v_copyright = ui_def(p['copyright'], none) -%}
{%- set v_groups = ui_def(p['groups'], none) -%}
{%- set v_signup = ui_def(p['signup'], none) -%}
{%- set v_status = ui_def(p['status'], none) -%}
{%- set v_id = ui_def(p['id'], 'footer') -%}
{%- set v_layout = ui_def(p['layout'], 'columns') -%}
{%- set v_density = ui_def(p['density'], 'default') -%}
{%- set v_landmarkLabel = ui_def(p['landmarkLabel'], none) -%}
{%- if ui_t(ui_eq(v_layout, 'card')) %}
{{ ui_include('blocks/footer-card.html.j2', {'p': {'label': v_label, 'brand': v_brand, 'groups': v_groups, 'landmarkLabel': v_landmarkLabel}}) }}
{%- else %}
{%- set c_21 -%}
{%- set c_20 -%}
{%- if ui_t(ui_eq(ui_get(v_signup, ['mode']), 'first')) %}
{%- set c_6 -%}
{%- set c_1 -%}
{{ ui_text(ui_get(v_signup, ['title'])) }}
{%- endset -%}
{{ ui_include('ui/title/title.html.j2', {'p': {'As': ui_i(3), 'Size': 'xl', 'Weight': 'bold'}, 'children': c_1}) }}
{%- set c_5 -%}
{%- set c_2 -%}
{{ ui_text(ui_get(v_signup, ['label'])) }}
{%- endset -%}
{{ ui_include('ui/label/label.html.j2', {'p': {'HTMLFor': ui_s(ui_tpl('{0}-email', [v_id])), 'Class': 'sr-only'}, 'children': c_2}) }}
{%- set c_4 -%}
{{ ui_include('ui/input/input.html.j2', {'p': {'Type': 'email', 'Name': 'email', 'Class': 'min-w-0 flex-1', 'Attrs': ui_attrs(['id', ui_tpl('{0}-email', [v_id]), 'data-testid', 'field'])}}) }}
{%- set c_3 -%}
{{ ui_text(ui_get(v_signup, ['submit'])) }}
{%- endset -%}
{{ ui_include('ui/button/button.html.j2', {'p': {'Variant': 'default', 'Size': 'default', 'Type': 'submit', 'Attrs': ui_attrs(['data-testid', 'submit'])}, 'children': c_3}) }}
{%- endset -%}
{{ ui_include('ui/group/group.html.j2', {'p': {'Gap': '2', 'Align': 'start', 'Class': 'w-full flex-wrap'}, 'children': c_4}) }}
{%- endset -%}
{{ ui_include('ui/form/form.html.j2', {'p': {'Method': 'dialog', 'Class': ui_s(ui_cnv(['w-full max-w-md', ('mx-auto' if ui_t(false) else '')])), 'Attrs': ui_attrs(['data-testid', 'email-form'])}, 'children': c_5}) }}
{%- endset -%}
{{ ui_include('ui/stack/stack.html.j2', {'p': {'Gap': '4', 'Class': 'max-w-md', 'Attrs': ui_attrs(['data-testid', 'signup'])}, 'children': c_6}) }}
{%- endif %}
{%- if ui_t(ui_eq(v_layout, 'columns')) %}
{%- set c_11 -%}
{%- set c_9 -%}
{%- set c_7 -%}
{{ ui_text(v_brand) }}
{%- endset -%}
{{ ui_include('ui/text/text.html.j2', {'p': {'Size': 'xl', 'Weight': 'bold'}, 'children': c_7}) }}
{%- set c_8 -%}
{{ ui_text(v_tagline) }}
{%- endset -%}
{{ ui_include('ui/text/text.html.j2', {'p': {'Size': 'sm', 'Class': 'text-muted-foreground'}, 'children': c_8}) }}
{%- endset -%}
{{ ui_include('ui/stack/stack.html.j2', {'p': {'Gap': '2', 'Class': 'md:w-64 md:shrink-0'}, 'children': c_9}) }}
{%- set c_10 -%}
{{ ui_include('blocks/footer-columns.html.j2', {'p': {'label': v_label, 'groups': v_groups, 'landmarkLabel': v_landmarkLabel}}) }}
{%- endset -%}
{{ ui_include('ui/box/box.html.j2', {'p': {'Class': 'min-w-0 flex-1'}, 'children': c_10}) }}
{%- endset -%}
{{ ui_include('ui/box/box.html.j2', {'p': {'Class': 'flex flex-col gap-8 md:flex-row md:items-start md:gap-12', 'Attrs': ui_attrs(['data-slot', 'footer-top'])}, 'children': c_11}) }}
{%- else %}
{%- set c_16 -%}
{%- set c_12 -%}
{{ ui_text(v_brand) }}
{%- endset -%}
{{ ui_include('ui/text/text.html.j2', {'p': {'Size': 'base', 'Weight': 'bold'}, 'children': c_12}) }}
{%- set c_15 -%}
{%- set c_14 -%}
{%- for v_g in ui_l(v_groups) %}
{%- set c_13 -%}
{{ ui_text(ui_get(v_g, ['title'])) }}
{%- endset -%}
{{ ui_include('ui/link/link.html.j2', {'p': {'Href': '#/', 'Variant': 'default', 'Class': 'text-sm', 'Attrs': ui_attrs(['data-testid', 'group'])}, 'children': c_13}) }}
{%- endfor %}
{%- endset -%}
{{ ui_include('ui/group/group.html.j2', {'p': {'Gap': '4', 'Class': 'flex-wrap'}, 'children': c_14}) }}
{%- endset -%}
{{ ui_include('blocks/nav-block.html.j2', {'p': {'label': (ui_uniq(ui_tpl('{0}, {1}', [v_label, v_landmarkLabel])) if ui_t(v_landmarkLabel) else v_label)}, 'children': c_15}) }}
{%- endset -%}
{{ ui_include('ui/group/group.html.j2', {'p': {'Gap': '6', 'Align': 'center', 'Justify': 'between', 'Class': 'flex-wrap'}, 'children': c_16}) }}
{%- endif %}
{%- set c_19 -%}
{%- set c_17 -%}
{{ ui_text(v_copyright) }}
{%- endset -%}
{{ ui_include('ui/text/text.html.j2', {'p': {'Size': 'sm', 'Class': 'text-muted-foreground'}, 'children': c_17}) }}
{%- if ui_t(ui_eq(ui_get(v_status, ['mode']), 'show')) %}
{%- set c_18 -%}
{{ ui_text(ui_get(v_status, ['label'])) }}
{%- endset -%}
{{ ui_include('blocks/pill.html.j2', {'p': {'tone': 'green', 'icon': 'circle-check'}, 'children': c_18}) }}
{%- endif %}
{%- endset -%}
{{ ui_include('ui/group/group.html.j2', {'p': {'Gap': '4', 'Align': 'center', 'Justify': 'between', 'Class': 'flex-wrap border-t border-border pt-6'}, 'children': c_19}) }}
{%- endset -%}
{{ ui_include('ui/container/container.html.j2', {'p': {'Class': ui_s(ui_cnv(['mx-auto w-full max-w-6xl px-4', 'flex flex-col gap-8', ('py-6' if ui_t(ui_eq(v_density, 'compact')) else 'py-12')])), 'Attrs': ui_attrs(['data-slot', 'container'])}, 'children': c_20}) }}
{%- endset -%}
{{ ui_include('ui/block/block.html.j2', {'p': {'Tag': 'footer', 'Class': 'mt-12 border-t border-border', 'Attrs': ui_attrs(['data-testid', 'site-footer', 'data-layout', v_layout, 'aria-label', v_landmarkLabel])}, 'children': c_21}) }}
{%- endif %}
Latte is not installed by the CLI. Copy the template files below into your Latte templates, together with these helper files from packages/latte/ui of the source (the Runtime, CnMerge and the Latte extension):
- php/CnMerge.php
- php/Extension.php
- php/Runtime.php
{* Code generated by xgen. DO NOT EDIT.
Source: xgen/specs/organisms/nav-bar.json
A top bar in four shapes. Axes: layout (inline: brand left, links, button right; split: the brand in the middle with the links on both sides; search: a search field with its shortcut in the middle), over (none, media: the bar sits over a picture, transparent), actions mode (none, cta), tone (default, inverse: on a dark hero band). Turning solid on scroll is a port contract.
Props (p): label, brand, links, current, actions, search, tone, layout, over, skip, landmarkLabel. *}
{var $v_label = ($p['label'] ?? null)}
{var $v_brand = ($p['brand'] ?? null)}
{var $v_links = ($p['links'] ?? null)}
{var $v_current = ($p['current'] ?? '')}
{var $v_actions = ($p['actions'] ?? null)}
{var $v_search = ($p['search'] ?? null)}
{var $v_tone = ($p['tone'] ?? 'default')}
{var $v_layout = ($p['layout'] ?? 'inline')}
{var $v_over = ($p['over'] ?? 'none')}
{var $v_skip = ($p['skip'] ?? null)}
{var $v_landmarkLabel = ($p['landmarkLabel'] ?? null)}
{capture $c_13}
{=ui_include('blocks/over-media.latte', ['p' => ['on' => ui_eq($v_over, 'media'), 'alt' => $v_brand]])|noescape}
{if ui_t($v_skip)}
{capture $c_1}
{=ui_text($v_skip)}
{/capture}
{=ui_include('ui/link-plain/link-plain.latte', ['p' => ['Href' => '#main-content', 'Class' => 'sr-only focus:not-sr-only focus:fixed focus:left-2 focus:top-2 focus:z-50 focus:rounded focus:bg-background focus:px-4 focus:py-2 focus:text-sm focus:inset-ring focus:inset-ring-border', 'Attrs' => ui_attrs(['data-testid', 'skip-link'])], 'children' => $c_1])|noescape}
{/if}
{capture $c_12}
{capture $c_11}
{if ui_t(ui_eq($v_layout, 'split'))}
{capture $c_8}
{capture $c_7}
{capture $c_2}
{=ui_include('blocks/nav-links.latte', ['p' => ['links' => $v_links, 'current' => $v_current, 'side' => 'left']])|noescape}
{/capture}
{=ui_include('ui/box/box.latte', ['p' => ['Class' => 'md:justify-self-start'], 'children' => $c_2])|noescape}
{capture $c_4}
{capture $c_3}
{=ui_text($v_brand)}
{/capture}
{=ui_include('ui/link/link.latte', ['p' => ['Href' => '#/', 'Variant' => 'default', 'Class' => 'text-lg font-medium', 'Attrs' => ui_attrs(['data-testid', 'brand'])], 'children' => $c_3])|noescape}
{/capture}
{=ui_include('ui/box/box.latte', ['p' => ['Class' => 'text-center'], 'children' => $c_4])|noescape}
{capture $c_6}
{capture $c_5}
{=ui_include('blocks/nav-links.latte', ['p' => ['links' => $v_links, 'current' => $v_current, 'side' => 'right']])|noescape}
{/capture}
{=ui_include('ui/box/box.latte', ['p' => [], 'children' => $c_5])|noescape}
{=ui_include('blocks/nav-actions.latte', ['p' => ['login' => ui_get($v_actions, ['login']), 'loginHref' => ui_get($v_actions, ['loginHref']), 'cta' => ui_get($v_actions, ['cta']), 'ctaHref' => ui_get($v_actions, ['href']), 'actions' => ui_get($v_actions, ['mode']), 'tone' => $v_tone, 'themeLabel' => ui_get($v_actions, ['themeLabel'])]])|noescape}
{/capture}
{=ui_include('ui/group/group.latte', ['p' => ['Gap' => '4', 'Align' => 'center', 'Justify' => 'end', 'Class' => 'flex-wrap md:justify-self-end'], 'children' => $c_6])|noescape}
{/capture}
{=ui_include('ui/grid/grid.latte', ['p' => ['Cols' => '1-3', 'Class' => 'w-full items-center gap-4'], 'children' => $c_7])|noescape}
{/capture}
{=ui_include('blocks/nav-block.latte', ['p' => ['label' => (ui_t($v_landmarkLabel) ? ui_uniq(ui_tpl('{0}, {1}', [$v_label, $v_landmarkLabel])) : $v_label), 'className' => ui_cnv(['w-full']), 'testid' => 'site-nav'], 'children' => $c_8])|noescape}
{else}
{capture $c_9}
{=ui_text($v_brand)}
{/capture}
{=ui_include('ui/link/link.latte', ['p' => ['Href' => '#/', 'Variant' => 'default', 'Class' => 'text-lg font-medium', 'Attrs' => ui_attrs(['data-testid', 'brand'])], 'children' => $c_9])|noescape}
{if ui_t(ui_eq($v_layout, 'search'))}
{=ui_include('blocks/search-palette.latte', ['p' => ['label' => ui_get($v_search, ['label']), 'shortcut' => ui_get($v_search, ['shortcut'])]])|noescape}
{/if}
{capture $c_10}
{=ui_include('blocks/nav-links.latte', ['p' => ['links' => $v_links, 'current' => $v_current]])|noescape}
{/capture}
{=ui_include('blocks/nav-block.latte', ['p' => ['label' => (ui_t($v_landmarkLabel) ? ui_uniq(ui_tpl('{0}, {1}', [$v_label, $v_landmarkLabel])) : $v_label), 'className' => ui_cnv(['order-last w-full overflow-x-auto md:order-none md:w-auto [&>div]:flex-nowrap md:[&>div]:flex-wrap [&_a]:shrink-0']), 'testid' => 'site-nav'], 'children' => $c_10])|noescape}
{=ui_include('blocks/nav-actions.latte', ['p' => ['login' => ui_get($v_actions, ['login']), 'loginHref' => ui_get($v_actions, ['loginHref']), 'cta' => ui_get($v_actions, ['cta']), 'ctaHref' => ui_get($v_actions, ['href']), 'actions' => ui_get($v_actions, ['mode']), 'tone' => $v_tone, 'themeLabel' => ui_get($v_actions, ['themeLabel'])]])|noescape}
{/if}
{/capture}
{=ui_include('ui/box/box.latte', ['p' => ['Class' => ui_s(ui_cnv(['flex flex-wrap items-center justify-between gap-4', 'py-4']))], 'children' => $c_11])|noescape}
{/capture}
{=ui_include('ui/container/container.latte', ['p' => ['Class' => 'mx-auto w-full max-w-6xl px-4', 'Attrs' => ui_attrs(['data-slot', 'container'])], 'children' => $c_12])|noescape}
{/capture}
{=ui_include('ui/block/block.latte', ['p' => ['Tag' => 'header', 'Class' => ui_s(ui_cnv(['relative', (ui_t(ui_eq($v_tone, 'inverse')) ? 'border-b border-transparent bg-foreground text-background [&_a]:text-background [&_button]:text-background' : 'border-b border-border bg-background'), (ui_t(ui_eq($v_over, 'media')) ? 'isolate overflow-hidden border-0 bg-transparent' : '')])), 'Attrs' => ui_attrs(['data-testid', 'nav-bar', 'data-layout', $v_layout, 'data-tone', $v_tone, 'aria-label', $v_landmarkLabel])], 'children' => $c_13])|noescape}
{* Code generated by xgen. DO NOT EDIT.
Source: xgen/specs/organisms/product-detail.json
A product page: a gallery (the main picture and optional thumbnails) beside the buy box (badge, rating, price, stock, quantity, add button, shipping and returns notes). Axes: layout (split, stacked), media side, thumbs (none, below), buy (full, compact), tone, density.
Props (p): id, product, labels, badges, level, layout, mediaSide, thumbs, buy, tone, density, landmarkLabel. *}
{var $v_id = ($p['id'] ?? null)}
{var $v_product = ($p['product'] ?? null)}
{var $v_labels = ($p['labels'] ?? null)}
{var $v_badges = ($p['badges'] ?? null)}
{var $v_level = ($p['level'] ?? 1)}
{var $v_layout = ($p['layout'] ?? 'split')}
{var $v_mediaSide = ($p['mediaSide'] ?? 'start')}
{var $v_thumbs = ($p['thumbs'] ?? 'below')}
{var $v_buy = ($p['buy'] ?? 'full')}
{var $v_tone = ($p['tone'] ?? 'default')}
{var $v_density = ($p['density'] ?? 'default')}
{var $v_landmarkLabel = ($p['landmarkLabel'] ?? null)}
{capture $f_15}
{capture $c_17}
{=ui_include('blocks/media-frame.latte', ['p' => ['alt' => ui_get($v_product, ['name']), 'ratio' => '1/1']])|noescape}
{if ui_t(ui_eq($v_thumbs, 'below'))}
{capture $c_16}
{=ui_include('blocks/media-frame.latte', ['p' => ['alt' => ui_get($v_product, ['name']), 'ratio' => '1/1', 'className' => ui_cnv(['ring-2 ring-foreground'])]])|noescape}
{=ui_include('blocks/media-frame.latte', ['p' => ['alt' => ui_get($v_product, ['name']), 'ratio' => '1/1']])|noescape}
{=ui_include('blocks/media-frame.latte', ['p' => ['alt' => ui_get($v_product, ['name']), 'ratio' => '1/1']])|noescape}
{/capture}
{=ui_include('ui/grid/grid.latte', ['p' => ['Cols' => '3', 'Class' => 'gap-4', 'Attrs' => ui_attrs(['data-testid', 'thumbs'])], 'children' => $c_16])|noescape}
{/if}
{/capture}
{=ui_include('ui/stack/stack.latte', ['p' => ['Gap' => '4', 'Align' => 'stretch', 'Attrs' => ui_attrs(['data-testid', 'gallery'])], 'children' => $c_17])|noescape}
{/capture}
{capture $c_18}
{capture $c_14}
{capture $c_3}
{capture $c_1}
{=ui_text(ui_money(ui_get($v_product, ['price']), ui_get($v_product, ['currency'])))}
{/capture}
{=ui_include('ui/text/text.latte', ['p' => ['Size' => '4xl', 'Weight' => 'bold'], 'children' => $c_1])|noescape}
{if ui_t(ui_get($v_product, ['badge']))}
{capture $c_2}
{=ui_text(ui_at($v_badges, ui_get($v_product, ['badge'])))}
{/capture}
{=ui_include('ui/badge/badge.latte', ['p' => ['Variant' => 'default', 'Size' => 'default'], 'children' => $c_2])|noescape}
{/if}
{/capture}
{=ui_include('ui/group/group.latte', ['p' => ['Gap' => '4', 'Align' => 'center', 'Class' => 'flex-wrap'], 'children' => $c_3])|noescape}
{capture $c_5}
{=ui_include('blocks/rating.latte', ['p' => ['value' => ui_get($v_product, ['rating']), 'label' => ui_tpl(ui_get($v_labels, ['ratingLabel']), [ui_get($v_product, ['rating'])])]])|noescape}
{capture $c_4}
{=ui_text(ui_tpl(ui_get($v_labels, ['reviews']), [ui_get($v_product, ['reviews'])]))}
{/capture}
{=ui_include('ui/text/text.latte', ['p' => ['Size' => 'sm', 'Class' => 'text-muted-foreground'], 'children' => $c_4])|noescape}
{/capture}
{=ui_include('ui/group/group.latte', ['p' => ['Gap' => '2'], 'children' => $c_5])|noescape}
{capture $c_6}
{=ui_text((ui_t(ui_get($v_product, ['inStock'])) ? ui_get($v_labels, ['inStock']) : ui_get($v_labels, ['soldOut'])))}
{/capture}
{=ui_include('ui/text/text.latte', ['p' => ['Size' => 'sm', 'Weight' => 'medium', 'Class' => ui_s((ui_t(ui_get($v_product, ['inStock'])) ? 'text-foreground' : 'text-destructive')), 'Attrs' => ui_attrs(['data-testid', 'stock'])], 'children' => $c_6])|noescape}
{capture $c_8}
{if ui_t(ui_eq($v_buy, 'full'))}
{=ui_include('blocks/number-field.latte', ['p' => ['value' => '1', 'name' => ui_tpl('{0}-qty', [$v_id]), 'min' => '1', 'label' => ui_get($v_labels, ['qty']), 'decrease' => ui_get($v_labels, ['decrease']), 'increase' => ui_get($v_labels, ['increase'])]])|noescape}
{/if}
{capture $c_7}
{=ui_text(ui_get($v_labels, ['add']))}
{/capture}
{=ui_include('ui/button/button.latte', ['p' => ['Disabled' => ui_t(!(ui_t(ui_get($v_product, ['inStock'])))), 'Attrs' => ui_attrs(['data-testid', 'add'])], 'children' => $c_7])|noescape}
{/capture}
{=ui_include('ui/group/group.latte', ['p' => ['Gap' => '4', 'Class' => 'flex-wrap'], 'children' => $c_8])|noescape}
{if ui_t(ui_eq($v_buy, 'full'))}
{capture $c_13}
{capture $c_10}
{=ui_include('ui/lucide-icon/lucide-icon.latte', ['p' => ['Name' => 'truck', 'Size' => 16]])|noescape}
{capture $c_9}
{=ui_text(ui_get($v_labels, ['shipping']))}
{/capture}
{=ui_include('ui/inline/inline.latte', ['p' => [], 'children' => $c_9])|noescape}
{/capture}
{=ui_include('ui/list/list-item.latte', ['p' => ['Class' => 'flex items-center gap-2'], 'children' => $c_10])|noescape}
{capture $c_12}
{=ui_include('ui/lucide-icon/lucide-icon.latte', ['p' => ['Name' => 'shield-check', 'Size' => 16]])|noescape}
{capture $c_11}
{=ui_text(ui_get($v_labels, ['returns']))}
{/capture}
{=ui_include('ui/inline/inline.latte', ['p' => [], 'children' => $c_11])|noescape}
{/capture}
{=ui_include('ui/list/list-item.latte', ['p' => ['Class' => 'flex items-center gap-2'], 'children' => $c_12])|noescape}
{/capture}
{=ui_include('ui/list/list.latte', ['p' => ['Tag' => 'ul', 'Class' => 'flex flex-col gap-2 text-sm text-muted-foreground'], 'children' => $c_13])|noescape}
{/if}
{/capture}
{=ui_include('ui/stack/stack.latte', ['p' => ['Gap' => '4', 'Align' => 'stretch', 'Attrs' => ui_attrs(['data-testid', 'buy-box'])], 'children' => $c_14])|noescape}
{/capture}
{=ui_include('blocks/section-frame.latte', ['p' => ['id' => $v_id, 'title' => ui_get($v_product, ['name']), 'lead' => ui_get($v_product, ['summary']), 'heading' => ['level' => $v_level], 'layout' => (ui_t(ui_eq($v_layout, 'split')) ? 'split' : 'stack'), 'media' => ['show' => true, 'side' => $v_mediaSide, 'align' => 'start'], 'tone' => $v_tone, 'density' => $v_density, 'landmarkLabel' => $v_landmarkLabel, 'aside' => $f_15], 'children' => $c_18])|noescape}
{* Code generated by xgen. DO NOT EDIT.
Source: xgen/specs/organisms/product-info.json
The details of a product under its buy box: texts in an accordion (native details) beside a card with the specs. Axes: layout (split: the specs beside the texts, stacked: below them), expand (first: the first text open, none), tone.
Props (p): id, title, details, specs, labels, layout, expand, tone, landmarkLabel. *}
{var $v_id = ($p['id'] ?? null)}
{var $v_title = ($p['title'] ?? null)}
{var $v_details = ($p['details'] ?? null)}
{var $v_specs = ($p['specs'] ?? null)}
{var $v_labels = ($p['labels'] ?? null)}
{var $v_layout = ($p['layout'] ?? 'split')}
{var $v_expand = ($p['expand'] ?? 'first')}
{var $v_tone = ($p['tone'] ?? 'default')}
{var $v_landmarkLabel = ($p['landmarkLabel'] ?? null)}
{capture $c_13}
{capture $c_12}
{capture $c_5}
{foreach ui_l($v_details) as $v_d}
{var $v_i = $iterator->counter0}
{capture $c_4}
{capture $c_2}
{capture $c_1}
{=ui_text(ui_get($v_d, ['title']))}
{/capture}
{=ui_include('ui/inline/inline.latte', ['p' => ['Class' => 'text-base font-semibold'], 'children' => $c_1])|noescape}
{/capture}
{=ui_include('ui/disclosure/summary.latte', ['p' => ['Variant' => 'item'], 'children' => $c_2])|noescape}
{capture $c_3}
{=ui_text(ui_get($v_d, ['text']))}
{/capture}
{=ui_include('ui/text/text.latte', ['p' => ['Size' => 'sm', 'Class' => 'pb-4 text-muted-foreground'], 'children' => $c_3])|noescape}
{/capture}
{=ui_include('ui/disclosure/disclosure.latte', ['p' => ['Variant' => 'item', 'Open' => ui_t(ui_and([ui_eq($v_expand, 'first'), ui_eq($v_i, 0)])), 'Attrs' => ui_attrs(['data-testid', 'item'])], 'children' => $c_4])|noescape}
{/foreach}
{/capture}
{=ui_include('ui/stack/stack.latte', ['p' => ['Gap' => '0', 'Align' => 'stretch', 'Class' => ui_s((ui_t(ui_eq($v_layout, 'split')) ? 'lg:col-span-2' : '')), 'Attrs' => ui_attrs(['data-testid', 'items'])], 'children' => $c_5])|noescape}
{capture $c_11}
{capture $c_6}
{=ui_text(ui_get($v_labels, ['specs']))}
{/capture}
{=ui_include('ui/title/title.latte', ['p' => ['As' => ui_i(3), 'Size' => 'lg', 'Weight' => 'bold'], 'children' => $c_6])|noescape}
{capture $c_10}
{foreach ui_l($v_specs) as $v_s}
{capture $c_9}
{capture $c_7}
{=ui_text(ui_get($v_s, ['label']))}
{/capture}
{=ui_include('ui/inline/inline.latte', ['p' => ['Class' => 'text-muted-foreground'], 'children' => $c_7])|noescape}
{capture $c_8}
{=ui_text(ui_get($v_s, ['value']))}
{/capture}
{=ui_include('ui/inline/inline.latte', ['p' => ['Class' => 'font-medium'], 'children' => $c_8])|noescape}
{/capture}
{=ui_include('ui/list/list-item.latte', ['p' => ['Class' => 'flex items-center justify-between gap-4 border-b border-border py-2 text-sm last:border-b-0', 'Attrs' => ui_attrs(['data-testid', 'spec'])], 'children' => $c_9])|noescape}
{/foreach}
{/capture}
{=ui_include('ui/list/list.latte', ['p' => ['Tag' => 'ul', 'Class' => 'flex flex-col'], 'children' => $c_10])|noescape}
{/capture}
{=ui_include('ui/stack/stack.latte', ['p' => ['Gap' => '4', 'Align' => 'stretch', 'Class' => 'rounded bg-card inset-ring inset-ring-border p-6', 'Attrs' => ui_attrs(['data-testid', 'specs'])], 'children' => $c_11])|noescape}
{/capture}
{=ui_include('ui/box/box.latte', ['p' => ['Class' => ui_s((ui_t(ui_eq($v_layout, 'split')) ? 'grid grid-cols-1 items-start gap-8 lg:grid-cols-3' : 'grid grid-cols-1 gap-8'))], 'children' => $c_12])|noescape}
{/capture}
{=ui_include('blocks/section-frame.latte', ['p' => ['id' => $v_id, 'title' => $v_title, 'tone' => $v_tone, 'landmarkLabel' => $v_landmarkLabel], 'children' => $c_13])|noescape}
{* Code generated by xgen. DO NOT EDIT.
Source: xgen/specs/organisms/review-list.json
Customer reviews as cards or plain entries: rating, title, text, author and date. Axes: layout (list, grid), columns, item (card, plain), avatar (none, image), tone, density.
Props (p): id, title, reviews, labels, layout, item, avatar, tone, density, landmarkLabel. *}
{var $v_id = ($p['id'] ?? null)}
{var $v_title = ($p['title'] ?? null)}
{var $v_reviews = ($p['reviews'] ?? null)}
{var $v_labels = ($p['labels'] ?? null)}
{var $v_layout = ($p['layout'] ?? 'list')}
{var $v_item = ($p['item'] ?? 'card')}
{var $v_avatar = ($p['avatar'] ?? 'none')}
{var $v_tone = ($p['tone'] ?? 'default')}
{var $v_density = ($p['density'] ?? 'default')}
{var $v_landmarkLabel = ($p['landmarkLabel'] ?? null)}
{capture $c_9}
{capture $c_8}
{foreach ui_l($v_reviews) as $v_r}
{capture $c_7}
{=ui_include('blocks/rating.latte', ['p' => ['value' => ui_get($v_r, ['rating']), 'label' => ui_tpl(ui_get($v_labels, ['ratingLabel']), [ui_get($v_r, ['rating'])])]])|noescape}
{capture $c_1}
{=ui_text(ui_get($v_r, ['title']))}
{/capture}
{=ui_include('ui/title/title.latte', ['p' => ['As' => ui_i(3), 'Size' => 'base', 'Weight' => 'bold'], 'children' => $c_1])|noescape}
{capture $c_2}
{=ui_text(ui_get($v_r, ['text']))}
{/capture}
{=ui_include('ui/text/text.latte', ['p' => ['Size' => 'sm', 'Class' => 'text-muted-foreground'], 'children' => $c_2])|noescape}
{capture $c_6}
{if ui_t(ui_eq($v_avatar, 'image'))}
{=ui_include('blocks/media-frame.latte', ['p' => ['alt' => ui_get($v_r, ['author']), 'ratio' => '1/1', 'className' => ui_cnv(['size-10 shrink-0 rounded-full'])]])|noescape}
{/if}
{capture $c_5}
{capture $c_3}
{=ui_text(ui_get($v_r, ['author']))}
{/capture}
{=ui_include('ui/text/text.latte', ['p' => ['Size' => 'sm', 'Weight' => 'semibold'], 'children' => $c_3])|noescape}
{capture $c_4}
{=ui_text(ui_get($v_r, ['date']))}
{/capture}
{=ui_include('ui/text/text.latte', ['p' => ['Size' => 'xs', 'Class' => 'text-muted-foreground'], 'children' => $c_4])|noescape}
{/capture}
{=ui_include('ui/stack/stack.latte', ['p' => ['Gap' => '0'], 'children' => $c_5])|noescape}
{/capture}
{=ui_include('ui/group/group.latte', ['p' => ['Gap' => '4', 'Align' => 'center', 'Class' => 'mt-auto'], 'children' => $c_6])|noescape}
{/capture}
{=ui_include('blocks/article-block.latte', ['p' => ['className' => ui_cnv([ui_cnv(['flex h-full flex-col gap-4', (ui_t(ui_eq($v_item, 'card')) ? 'rounded bg-card p-6 inset-ring inset-ring-border' : 'border-b border-border pb-4')])]), 'testid' => 'item'], 'children' => $c_7])|noescape}
{/foreach}
{/capture}
{=ui_include('ui/grid/grid.latte', ['p' => ['Cols' => ui_s((ui_t(ui_eq($v_layout, 'grid')) ? '1-3' : '1')), 'Class' => 'gap-4', 'Attrs' => ui_attrs(['data-testid', 'items'])], 'children' => $c_8])|noescape}
{/capture}
{=ui_include('blocks/section-frame.latte', ['p' => ['id' => $v_id, 'title' => $v_title, 'tone' => $v_tone, 'density' => $v_density, 'measure' => (ui_t(ui_eq($v_layout, 'list')) ? '2xl' : 'default'), 'landmarkLabel' => $v_landmarkLabel], 'children' => $c_9])|noescape}
{* Code generated by xgen. DO NOT EDIT.
Source: xgen/specs/organisms/product-grid.json
A section with a heading and the products as cards in a grid, as a list of horizontal cards, or as a rail that scrolls sideways. Axes: layout (grid, list, rail), columns, ratio, rating, action, tone, density.
Props (p): id, title, products, labels, badges, layout, cols, ratio, rating, action, tone, density, landmarkLabel. *}
{var $v_id = ($p['id'] ?? null)}
{var $v_title = ($p['title'] ?? null)}
{var $v_products = ($p['products'] ?? null)}
{var $v_labels = ($p['labels'] ?? null)}
{var $v_badges = ($p['badges'] ?? null)}
{var $v_layout = ($p['layout'] ?? 'grid')}
{var $v_cols = ($p['cols'] ?? '1-3')}
{var $v_ratio = ($p['ratio'] ?? '4/3')}
{var $v_rating = ($p['rating'] ?? 'show')}
{var $v_action = ($p['action'] ?? 'button')}
{var $v_tone = ($p['tone'] ?? 'default')}
{var $v_density = ($p['density'] ?? 'default')}
{var $v_landmarkLabel = ($p['landmarkLabel'] ?? null)}
{capture $c_4}
{if ui_t(ui_eq($v_layout, 'rail'))}
{capture $c_2}
{foreach ui_l($v_products) as $v_p}
{capture $c_1}
{=ui_include('blocks/product-card.latte', ['p' => ['product' => $v_p, 'labels' => $v_labels, 'badges' => $v_badges, 'layout' => (ui_t(ui_eq($v_layout, 'list')) ? 'horizontal' : 'vertical'), 'ratio' => $v_ratio, 'rating' => $v_rating, 'action' => $v_action, 'density' => (ui_t(ui_eq($v_density, 'compact')) ? 'compact' : 'default')]])|noescape}
{/capture}
{=ui_include('ui/box/box.latte', ['p' => ['Class' => 'w-64 shrink-0 snap-start'], 'children' => $c_1])|noescape}
{/foreach}
{/capture}
{=ui_include('ui/box/box.latte', ['p' => ['Class' => 'flex snap-x gap-4 overflow-x-auto pb-4', 'Attrs' => ui_attrs(['data-testid', 'items'])], 'children' => $c_2])|noescape}
{else}
{capture $c_3}
{foreach ui_l($v_products) as $v_p}
{=ui_include('blocks/product-card.latte', ['p' => ['product' => $v_p, 'labels' => $v_labels, 'badges' => $v_badges, 'layout' => (ui_t(ui_eq($v_layout, 'list')) ? 'horizontal' : 'vertical'), 'ratio' => $v_ratio, 'rating' => $v_rating, 'action' => $v_action, 'density' => (ui_t(ui_eq($v_density, 'compact')) ? 'compact' : 'default')]])|noescape}
{/foreach}
{/capture}
{=ui_include('ui/grid/grid.latte', ['p' => ['Cols' => ui_s((ui_t(ui_eq($v_layout, 'list')) ? '1' : $v_cols)), 'Class' => 'gap-4', 'Attrs' => ui_attrs(['data-testid', 'items'])], 'children' => $c_3])|noescape}
{/if}
{/capture}
{=ui_include('blocks/section-frame.latte', ['p' => ['id' => $v_id, 'title' => $v_title, 'tone' => $v_tone, 'density' => $v_density, 'landmarkLabel' => $v_landmarkLabel], 'children' => $c_4])|noescape}
{* Code generated by xgen. DO NOT EDIT.
Source: xgen/specs/organisms/sitemap-footer.json
A footer with the brand, a tagline, groups of links and the copyright. Axes: layout (columns: brand above, equal columns per group, row: the brand, the group names and the copyright in one row), signup mode (none, first: a sign-up above the links), status mode (none, show: a live status pill), density. The live status itself is a port contract.
Props (p): label, brand, tagline, copyright, groups, signup, status, id, layout, density, landmarkLabel. *}
{var $v_label = ($p['label'] ?? null)}
{var $v_brand = ($p['brand'] ?? null)}
{var $v_tagline = ($p['tagline'] ?? null)}
{var $v_copyright = ($p['copyright'] ?? null)}
{var $v_groups = ($p['groups'] ?? null)}
{var $v_signup = ($p['signup'] ?? null)}
{var $v_status = ($p['status'] ?? null)}
{var $v_id = ($p['id'] ?? 'footer')}
{var $v_layout = ($p['layout'] ?? 'columns')}
{var $v_density = ($p['density'] ?? 'default')}
{var $v_landmarkLabel = ($p['landmarkLabel'] ?? null)}
{if ui_t(ui_eq($v_layout, 'card'))}
{=ui_include('blocks/footer-card.latte', ['p' => ['label' => $v_label, 'brand' => $v_brand, 'groups' => $v_groups, 'landmarkLabel' => $v_landmarkLabel]])|noescape}
{else}
{capture $c_21}
{capture $c_20}
{if ui_t(ui_eq(ui_get($v_signup, ['mode']), 'first'))}
{capture $c_6}
{capture $c_1}
{=ui_text(ui_get($v_signup, ['title']))}
{/capture}
{=ui_include('ui/title/title.latte', ['p' => ['As' => ui_i(3), 'Size' => 'xl', 'Weight' => 'bold'], 'children' => $c_1])|noescape}
{capture $c_5}
{capture $c_2}
{=ui_text(ui_get($v_signup, ['label']))}
{/capture}
{=ui_include('ui/label/label.latte', ['p' => ['HTMLFor' => ui_s(ui_tpl('{0}-email', [$v_id])), 'Class' => 'sr-only'], 'children' => $c_2])|noescape}
{capture $c_4}
{=ui_include('ui/input/input.latte', ['p' => ['Type' => 'email', 'Name' => 'email', 'Class' => 'min-w-0 flex-1', 'Attrs' => ui_attrs(['id', ui_tpl('{0}-email', [$v_id]), 'data-testid', 'field'])]])|noescape}
{capture $c_3}
{=ui_text(ui_get($v_signup, ['submit']))}
{/capture}
{=ui_include('ui/button/button.latte', ['p' => ['Variant' => 'default', 'Size' => 'default', 'Type' => 'submit', 'Attrs' => ui_attrs(['data-testid', 'submit'])], 'children' => $c_3])|noescape}
{/capture}
{=ui_include('ui/group/group.latte', ['p' => ['Gap' => '2', 'Align' => 'start', 'Class' => 'w-full flex-wrap'], 'children' => $c_4])|noescape}
{/capture}
{=ui_include('ui/form/form.latte', ['p' => ['Method' => 'dialog', 'Class' => ui_s(ui_cnv(['w-full max-w-md', (ui_t(false) ? 'mx-auto' : '')])), 'Attrs' => ui_attrs(['data-testid', 'email-form'])], 'children' => $c_5])|noescape}
{/capture}
{=ui_include('ui/stack/stack.latte', ['p' => ['Gap' => '4', 'Class' => 'max-w-md', 'Attrs' => ui_attrs(['data-testid', 'signup'])], 'children' => $c_6])|noescape}
{/if}
{if ui_t(ui_eq($v_layout, 'columns'))}
{capture $c_11}
{capture $c_9}
{capture $c_7}
{=ui_text($v_brand)}
{/capture}
{=ui_include('ui/text/text.latte', ['p' => ['Size' => 'xl', 'Weight' => 'bold'], 'children' => $c_7])|noescape}
{capture $c_8}
{=ui_text($v_tagline)}
{/capture}
{=ui_include('ui/text/text.latte', ['p' => ['Size' => 'sm', 'Class' => 'text-muted-foreground'], 'children' => $c_8])|noescape}
{/capture}
{=ui_include('ui/stack/stack.latte', ['p' => ['Gap' => '2', 'Class' => 'md:w-64 md:shrink-0'], 'children' => $c_9])|noescape}
{capture $c_10}
{=ui_include('blocks/footer-columns.latte', ['p' => ['label' => $v_label, 'groups' => $v_groups, 'landmarkLabel' => $v_landmarkLabel]])|noescape}
{/capture}
{=ui_include('ui/box/box.latte', ['p' => ['Class' => 'min-w-0 flex-1'], 'children' => $c_10])|noescape}
{/capture}
{=ui_include('ui/box/box.latte', ['p' => ['Class' => 'flex flex-col gap-8 md:flex-row md:items-start md:gap-12', 'Attrs' => ui_attrs(['data-slot', 'footer-top'])], 'children' => $c_11])|noescape}
{else}
{capture $c_16}
{capture $c_12}
{=ui_text($v_brand)}
{/capture}
{=ui_include('ui/text/text.latte', ['p' => ['Size' => 'base', 'Weight' => 'bold'], 'children' => $c_12])|noescape}
{capture $c_15}
{capture $c_14}
{foreach ui_l($v_groups) as $v_g}
{capture $c_13}
{=ui_text(ui_get($v_g, ['title']))}
{/capture}
{=ui_include('ui/link/link.latte', ['p' => ['Href' => '#/', 'Variant' => 'default', 'Class' => 'text-sm', 'Attrs' => ui_attrs(['data-testid', 'group'])], 'children' => $c_13])|noescape}
{/foreach}
{/capture}
{=ui_include('ui/group/group.latte', ['p' => ['Gap' => '4', 'Class' => 'flex-wrap'], 'children' => $c_14])|noescape}
{/capture}
{=ui_include('blocks/nav-block.latte', ['p' => ['label' => (ui_t($v_landmarkLabel) ? ui_uniq(ui_tpl('{0}, {1}', [$v_label, $v_landmarkLabel])) : $v_label)], 'children' => $c_15])|noescape}
{/capture}
{=ui_include('ui/group/group.latte', ['p' => ['Gap' => '6', 'Align' => 'center', 'Justify' => 'between', 'Class' => 'flex-wrap'], 'children' => $c_16])|noescape}
{/if}
{capture $c_19}
{capture $c_17}
{=ui_text($v_copyright)}
{/capture}
{=ui_include('ui/text/text.latte', ['p' => ['Size' => 'sm', 'Class' => 'text-muted-foreground'], 'children' => $c_17])|noescape}
{if ui_t(ui_eq(ui_get($v_status, ['mode']), 'show'))}
{capture $c_18}
{=ui_text(ui_get($v_status, ['label']))}
{/capture}
{=ui_include('blocks/pill.latte', ['p' => ['tone' => 'green', 'icon' => 'circle-check'], 'children' => $c_18])|noescape}
{/if}
{/capture}
{=ui_include('ui/group/group.latte', ['p' => ['Gap' => '4', 'Align' => 'center', 'Justify' => 'between', 'Class' => 'flex-wrap border-t border-border pt-6'], 'children' => $c_19])|noescape}
{/capture}
{=ui_include('ui/container/container.latte', ['p' => ['Class' => ui_s(ui_cnv(['mx-auto w-full max-w-6xl px-4', 'flex flex-col gap-8', (ui_t(ui_eq($v_density, 'compact')) ? 'py-6' : 'py-12')])), 'Attrs' => ui_attrs(['data-slot', 'container'])], 'children' => $c_20])|noescape}
{/capture}
{=ui_include('ui/block/block.latte', ['p' => ['Tag' => 'footer', 'Class' => 'mt-12 border-t border-border', 'Attrs' => ui_attrs(['data-testid', 'site-footer', 'data-layout', $v_layout, 'aria-label', $v_landmarkLabel])], 'children' => $c_21])|noescape}
{/if}