Cart Table
Cart Table component
Install
npx ui8kit add cart-tablePulls in: box, button, cart-list, compose, group, inline, kit-box, kit-button, kit-text, lucide-icon, media-frame, number-field, stack, table, table-body, table-caption, table-cell, table-head, table-head-cell, table-row, text, utils
Preview
| Product | Quantity | Total | Remove |
|---|---|---|---|
Arc desk lamp Brass | $89 | ||
Field backpack Olive | $129 | ||
Desk mat Charcoal | $70 |
Subtotal $288
Code
Point the CLI at this runtime once, then add the item:
npx ui8kit init --yes --framework svelte --dir src --registry-url https://registry.buildy.tw/svelte --strict-cdnnpx ui8kit add cart-table<!-- Code generated by packages/kit-compose/src/organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT. -->
<!--
The lines of a cart as a table (the table layout of CartList): product, price, quantity, line total and a
remove button.
-->
<script lang="ts" module>
import type { Snippet } from "svelte";
import type { CartLine, CartLabels } from "../blocks/cart-list.types";
export type CartTableProps = {
lines: CartLine[];
labels: CartLabels;
media?: "image" | "none";
density?: "default" | "compact";
field?: string;
onremove?: (id: string) => void;
};
</script>
<script lang="ts">
import Box from "../compose/Box.svelte";
import Button from "../compose/Button.svelte";
import Group from "../compose/Group.svelte";
import Inline from "../compose/Inline.svelte";
import LucideIcon from "../icons/LucideIcon.svelte";
import Stack from "../compose/Stack.svelte";
import Table from "../compose/Table.svelte";
import TableBody from "../compose/TableBody.svelte";
import TableCaption from "../compose/TableCaption.svelte";
import TableCell from "../compose/TableCell.svelte";
import TableHead from "../compose/TableHead.svelte";
import TableHeadCell from "../compose/TableHeadCell.svelte";
import TableRow from "../compose/TableRow.svelte";
import Text from "../compose/Text.svelte";
import MediaFrame from "../components/media-frame.svelte";
import NumberField from "../components/number-field.svelte";
import { cn, fmtMoney, tpl } from "../utils";
let {
lines,
labels,
media = "image",
density = "default",
field = "qty",
onremove,
}: CartTableProps = $props();
</script>
<Box class="w-full overflow-x-auto" data-slot="cart-table-root">
<Table class="w-full text-left text-sm" data-slot="cart-table">
<TableCaption class="sr-only">
{labels.caption}
</TableCaption>
<TableHead>
<TableRow>
<TableHeadCell scope="col" class="py-2">
{labels.product}
</TableHeadCell>
<TableHeadCell scope="col" class="hidden py-2 sm:table-cell">
{labels.price}
</TableHeadCell>
<TableHeadCell scope="col" class="py-2">
{labels.qty}
</TableHeadCell>
<TableHeadCell scope="col" class="py-2">
{labels.total}
</TableHeadCell>
<TableHeadCell scope="col" class="py-2">
<Inline class="sr-only">
{labels.remove}
</Inline>
</TableHeadCell>
</TableRow>
</TableHead>
<TableBody>
{#each lines as line (line.id)}
<TableRow class="border-t border-border" data-slot="item">
<TableCell class={cn((((density as string) === "compact") ? "py-2" : "py-4"))}>
<Group gap="4" align="center">
{#if ((media as string) === "image")}
<MediaFrame alt={line.name} src={line.image} ratio="1/1" class="hidden size-14 shrink-0 sm:block" />
{/if}
<Stack gap="0">
<Text size="sm" weight="semibold">
{line.name}
</Text>
<Text size="xs" class="text-muted-foreground">
{line.variant}
</Text>
</Stack>
</Group>
</TableCell>
<TableCell class="hidden sm:table-cell">
{fmtMoney(line.price, line.currency)}
</TableCell>
<TableCell>
<NumberField
value={(line.qty == null ? undefined : String(line.qty))}
name={tpl("{0}-{1}", field, line.id)}
min="1"
label={labels.qty}
decrease={labels.decrease}
increase={labels.increase}
/>
</TableCell>
<TableCell class="font-semibold">
{fmtMoney((line.price * line.qty), line.currency)}
</TableCell>
<TableCell class="text-right">
<Button variant="ghost" size="sm" layout="icon" aria-label={labels.remove} onclick={() => onremove?.(line.id)}>
<LucideIcon name="x" size={16} />
</Button>
</TableCell>
</TableRow>
{/each}
</TableBody>
</Table>
</Box>
{#if ((lines?.length ?? 0) > 0)}
<Group
gap="4"
align="center"
justify="between"
class="mt-4 flex-wrap border-t border-border pt-4"
data-slot="cart-footer"
>
<Text size="base" weight="bold" data-slot="subtotal">
{labels.subtotal}
{" "}
{fmtMoney(lines.reduce((s, i) => s + i.price * i.qty, 0), lines[0]?.currency ?? "")}
</Text>
<Button variant="default" size="default">
{labels.checkout}
</Button>
</Group>
{/if}
Point the CLI at this runtime once, then add the item:
npx ui8kit init --yes --framework react --dir src --registry-url https://registry.buildy.tw/react --strict-cdnnpx ui8kit add cart-table// Code generated by packages/kit-compose/src/organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT.
/**
* The lines of a cart as a table (the table layout of CartList): product, price, quantity, line total and a
* remove button.
*/
import { type ReactNode } from "react";
import { Box, Button, Group, Inline, Stack, Table, TableBody, TableCaption, TableCell, TableHead, TableHeadCell, TableRow, Text } from "../compose";
import { LucideIcon } from "../icons/LucideIcon";
import { MediaFrame } from "../components/media-frame";
import { NumberField } from "../components/number-field";
import { cn, fmtMoney, tpl } from "../utils";
import type { CartLine, CartLabels } from "../blocks/cart-list.types";
export type CartTableProps = {
lines: CartLine[];
labels: CartLabels;
media?: "image" | "none";
density?: "default" | "compact";
field?: string;
onRemove?: (id: string) => void;
};
export function CartTable({
lines,
labels,
media = "image",
density = "default",
field = "qty",
onRemove,
}: CartTableProps) {
return (
<>
<Box className="w-full overflow-x-auto" data-slot="cart-table-root">
<Table className="w-full text-left text-sm" data-slot="cart-table">
<TableCaption className="sr-only">
{labels.caption}
</TableCaption>
<TableHead>
<TableRow>
<TableHeadCell scope="col" className="py-2">
{labels.product}
</TableHeadCell>
<TableHeadCell scope="col" className="hidden py-2 sm:table-cell">
{labels.price}
</TableHeadCell>
<TableHeadCell scope="col" className="py-2">
{labels.qty}
</TableHeadCell>
<TableHeadCell scope="col" className="py-2">
{labels.total}
</TableHeadCell>
<TableHeadCell scope="col" className="py-2">
<Inline className="sr-only">
{labels.remove}
</Inline>
</TableHeadCell>
</TableRow>
</TableHead>
<TableBody>
{(lines ?? []).map((line) => (
<TableRow key={line.id} className="border-t border-border" data-slot="item">
<TableCell className={cn((((density as string) === "compact") ? "py-2" : "py-4"))}>
<Group gap="4" align="center">
{((media as string) === "image") ? (
<MediaFrame alt={line.name} src={line.image} ratio="1/1" className="hidden size-14 shrink-0 sm:block" />
) : null}
<Stack gap="0">
<Text size="sm" weight="semibold">
{line.name}
</Text>
<Text size="xs" className="text-muted-foreground">
{line.variant}
</Text>
</Stack>
</Group>
</TableCell>
<TableCell className="hidden sm:table-cell">
{fmtMoney(line.price, line.currency)}
</TableCell>
<TableCell>
<NumberField
value={(line.qty == null ? undefined : String(line.qty))}
name={tpl("{0}-{1}", field, line.id)}
min="1"
label={labels.qty}
decrease={labels.decrease}
increase={labels.increase}
/>
</TableCell>
<TableCell className="font-semibold">
{fmtMoney((line.price * line.qty), line.currency)}
</TableCell>
<TableCell className="text-right">
<Button variant="ghost" size="sm" layout="icon" aria-label={labels.remove} onClick={() => onRemove?.(line.id)}>
<LucideIcon name="x" size={16} />
</Button>
</TableCell>
</TableRow>
))}
</TableBody>
</Table>
</Box>
{((lines?.length ?? 0) > 0) ? (
<Group
gap="4"
align="center"
justify="between"
className="mt-4 flex-wrap border-t border-border pt-4"
data-slot="cart-footer"
>
<Text size="base" weight="bold" data-slot="subtotal">
{labels.subtotal}
{" "}
{fmtMoney(lines.reduce((s, i) => s + i.price * i.qty, 0), lines[0]?.currency ?? "")}
</Text>
<Button variant="default" size="default">
{labels.checkout}
</Button>
</Group>
) : null}
</>
);
}
Point the CLI at this runtime once, then add the item:
npx ui8kit init --yes --framework vue --dir src --registry-url https://registry.buildy.tw/vue --strict-cdnnpx ui8kit add cart-table<!-- Code generated by packages/kit-compose/src/organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT. -->
<!--
The lines of a cart as a table (the table layout of CartList): product, price, quantity, line total and a
remove button.
-->
<script lang="ts">
import type { CartLine, CartLabels } from "../blocks/cart-list.types";
export type CartTableProps = {
lines: CartLine[];
labels: CartLabels;
media?: "image" | "none";
density?: "default" | "compact";
field?: string;
};
</script>
<script setup lang="ts">
import Box from "../compose/Box.vue";
import Button from "../compose/Button.vue";
import Group from "../compose/Group.vue";
import Inline from "../compose/Inline.vue";
import LucideIcon from "../icons/LucideIcon.vue";
import Stack from "../compose/Stack.vue";
import Table from "../compose/Table.vue";
import TableBody from "../compose/TableBody.vue";
import TableCaption from "../compose/TableCaption.vue";
import TableCell from "../compose/TableCell.vue";
import TableHead from "../compose/TableHead.vue";
import TableHeadCell from "../compose/TableHeadCell.vue";
import TableRow from "../compose/TableRow.vue";
import Text from "../compose/Text.vue";
import MediaFrame from "../components/media-frame.vue";
import NumberField from "../components/number-field.vue";
import { cn, fmtMoney, tpl } from "../utils";
const { lines, labels, media = "image", density = "default", field = "qty" } = defineProps<CartTableProps>();
const emit = defineEmits<{ remove: [id: string] }>();
</script>
<template>
<Box class="w-full overflow-x-auto" data-slot="cart-table-root">
<Table class="w-full text-left text-sm" data-slot="cart-table">
<TableCaption class="sr-only">
{{ labels.caption }}
</TableCaption>
<TableHead>
<TableRow>
<TableHeadCell scope="col" class="py-2">
{{ labels.product }}
</TableHeadCell>
<TableHeadCell scope="col" class="hidden py-2 sm:table-cell">
{{ labels.price }}
</TableHeadCell>
<TableHeadCell scope="col" class="py-2">
{{ labels.qty }}
</TableHeadCell>
<TableHeadCell scope="col" class="py-2">
{{ labels.total }}
</TableHeadCell>
<TableHeadCell scope="col" class="py-2">
<Inline class="sr-only">
{{ labels.remove }}
</Inline>
</TableHeadCell>
</TableRow>
</TableHead>
<TableBody>
<TableRow v-for="line in lines" :key="line.id" class="border-t border-border" data-slot="item">
<TableCell :class="cn((((density as string) === 'compact') ? 'py-2' : 'py-4'))">
<Group gap="4" align="center">
<MediaFrame
v-if="((media as string) === 'image')"
:alt="line.name"
:src="line.image"
ratio="1/1"
class="hidden size-14 shrink-0 sm:block"
/>
<Stack gap="0">
<Text size="sm" weight="semibold">
{{ line.name }}
</Text>
<Text size="xs" class="text-muted-foreground">
{{ line.variant }}
</Text>
</Stack>
</Group>
</TableCell>
<TableCell class="hidden sm:table-cell">
{{ fmtMoney(line.price, line.currency) }}
</TableCell>
<TableCell>
<NumberField
:value="(line.qty == null ? undefined : String(line.qty))"
:name="tpl('{0}-{1}', field, line.id)"
min="1"
:label="labels.qty"
:decrease="labels.decrease"
:increase="labels.increase"
/>
</TableCell>
<TableCell class="font-semibold">
{{ fmtMoney((line.price * line.qty), line.currency) }}
</TableCell>
<TableCell class="text-right">
<Button
variant="ghost"
size="sm"
layout="icon"
:aria-label="labels.remove"
@click="() => emit('remove', line.id)"
>
<LucideIcon name="x" :size="16" />
</Button>
</TableCell>
</TableRow>
</TableBody>
</Table>
</Box>
<Group v-if="((lines?.length ?? 0) > 0)"
gap="4"
align="center"
justify="between"
class="mt-4 flex-wrap border-t border-border pt-4"
data-slot="cart-footer"
>
<Text size="base" weight="bold" data-slot="subtotal">
{{ labels.subtotal }}
{{ " " }}
{{ fmtMoney(lines.reduce((s, i) => s + i.price * i.qty, 0), lines[0]?.currency ?? "") }}
</Text>
<Button variant="default" size="default">
{{ labels.checkout }}
</Button>
</Group>
</template>
Point the CLI at this runtime once, then add the item:
npx ui8kit init --yes --framework solid --dir src --registry-url https://registry.buildy.tw/solid --strict-cdnnpx ui8kit add cart-table// Code generated by packages/kit-compose/src/organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT.
/**
* The lines of a cart as a table (the table layout of CartList): product, price, quantity, line total and a
* remove button.
*/
import { For, type JSX } from "solid-js";
import { Box, Button, Group, Inline, Stack, Table, TableBody, TableCaption, TableCell, TableHead, TableHeadCell, TableRow, Text } from "../compose";
import { LucideIcon } from "../icons/LucideIcon";
import { MediaFrame } from "../components/media-frame";
import { NumberField } from "../components/number-field";
import { cn, fmtMoney, tpl } from "../utils";
import type { CartLine, CartLabels } from "../blocks/cart-list.types";
export type CartTableProps = {
lines: CartLine[];
labels: CartLabels;
media?: "image" | "none";
density?: "default" | "compact";
field?: string;
onRemove?: (id: string) => void;
};
export function CartTable({
lines,
labels,
media = "image",
density = "default",
field = "qty",
onRemove,
}: CartTableProps) {
return (
<>
<Box class="w-full overflow-x-auto" data-slot="cart-table-root">
<Table class="w-full text-left text-sm" data-slot="cart-table">
<TableCaption class="sr-only">
{labels.caption}
</TableCaption>
<TableHead>
<TableRow>
<TableHeadCell scope="col" class="py-2">
{labels.product}
</TableHeadCell>
<TableHeadCell scope="col" class="hidden py-2 sm:table-cell">
{labels.price}
</TableHeadCell>
<TableHeadCell scope="col" class="py-2">
{labels.qty}
</TableHeadCell>
<TableHeadCell scope="col" class="py-2">
{labels.total}
</TableHeadCell>
<TableHeadCell scope="col" class="py-2">
<Inline class="sr-only">
{labels.remove}
</Inline>
</TableHeadCell>
</TableRow>
</TableHead>
<TableBody>
<For each={lines ?? []}>{(line) => (
<TableRow class="border-t border-border" data-slot="item">
<TableCell class={cn((((density as string) === "compact") ? "py-2" : "py-4"))}>
<Group gap="4" align="center">
{((media as string) === "image") ? (
<MediaFrame alt={line.name} src={line.image} ratio="1/1" class="hidden size-14 shrink-0 sm:block" />
) : null}
<Stack gap="0">
<Text size="sm" weight="semibold">
{line.name}
</Text>
<Text size="xs" class="text-muted-foreground">
{line.variant}
</Text>
</Stack>
</Group>
</TableCell>
<TableCell class="hidden sm:table-cell">
{fmtMoney(line.price, line.currency)}
</TableCell>
<TableCell>
<NumberField
value={(line.qty == null ? undefined : String(line.qty))}
name={tpl("{0}-{1}", field, line.id)}
min="1"
label={labels.qty}
decrease={labels.decrease}
increase={labels.increase}
/>
</TableCell>
<TableCell class="font-semibold">
{fmtMoney((line.price * line.qty), line.currency)}
</TableCell>
<TableCell class="text-right">
<Button variant="ghost" size="sm" layout="icon" aria-label={labels.remove} onClick={() => onRemove?.(line.id)}>
<LucideIcon name="x" size={16} />
</Button>
</TableCell>
</TableRow>
)}</For>
</TableBody>
</Table>
</Box>
{((lines?.length ?? 0) > 0) ? (
<Group
gap="4"
align="center"
justify="between"
class="mt-4 flex-wrap border-t border-border pt-4"
data-slot="cart-footer"
>
<Text size="base" weight="bold" data-slot="subtotal">
{labels.subtotal}
{" "}
{fmtMoney(lines.reduce((s, i) => s + i.price * i.qty, 0), lines[0]?.currency ?? "")}
</Text>
<Button variant="default" size="default">
{labels.checkout}
</Button>
</Group>
) : null}
</>
);
}
Point the CLI at this runtime once, then add the item:
npx ui8kit init --yes --framework templ --dir src --registry-url https://registry.buildy.tw/templ --strict-cdnnpx ui8kit add cart-table// Code generated by packages/kit-compose/src/server-organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT.
// Source: packages/compose-gen/specs/organisms/cart-table.json
package blocks
import (
"github.com/ui8kit/codegen/generated/templ/ui/box"
"github.com/ui8kit/codegen/generated/templ/ui/button"
"github.com/ui8kit/codegen/generated/templ/compose"
"github.com/ui8kit/codegen/generated/templ/icons"
"github.com/ui8kit/codegen/generated/templ/ui/text"
uiutils "github.com/ui8kit/codegen/generated/templ/orgutils"
)
// CartTableProps are the props of CartTable; the values are the JSON shapes of the TypeScript props.
type CartTableProps struct {
Lines any `json:"lines"`
Labels any `json:"labels"`
Media any `json:"media"`
Density any `json:"density"`
Field any `json:"field"`
}
// The lines of a cart as a table (the table layout of CartList): product, price, quantity, line total and a remove button.
templ CartTable(p CartTableProps) {
{{ vLines := p.Lines }}
{{ vLabels := p.Labels }}
{{ vMedia := uiutils.Def(p.Media, "image") }}
{{ vDensity := uiutils.Def(p.Density, "default") }}
{{ vField := uiutils.Def(p.Field, "qty") }}
@compose.Box(compose.BoxProps{BoxProps: box.BoxProps{Class: "w-full overflow-x-auto", Attrs: uiutils.Attrs("data-slot", "cart-table-root")}}) {
@compose.Table(compose.TableProps{BoxProps: box.BoxProps{Class: "w-full text-left text-sm", Attrs: uiutils.Attrs("data-slot", "cart-table")}}) {
@compose.TableCaption(compose.TableCaptionProps{BoxProps: box.BoxProps{Class: "sr-only"}}) {
{ uiutils.Text(uiutils.Get(vLabels, "caption")) }
}
@compose.TableHead(compose.TableHeadProps{BoxProps: box.BoxProps{}}) {
@compose.TableRow(compose.TableRowProps{BoxProps: box.BoxProps{}}) {
@compose.TableHeadCell(compose.TableHeadCellProps{BoxProps: box.BoxProps{Class: "py-2", Attrs: uiutils.Attrs("scope", "col")}}) {
{ uiutils.Text(uiutils.Get(vLabels, "product")) }
}
@compose.TableHeadCell(compose.TableHeadCellProps{BoxProps: box.BoxProps{Class: "hidden py-2 sm:table-cell", Attrs: uiutils.Attrs("scope", "col")}}) {
{ uiutils.Text(uiutils.Get(vLabels, "price")) }
}
@compose.TableHeadCell(compose.TableHeadCellProps{BoxProps: box.BoxProps{Class: "py-2", Attrs: uiutils.Attrs("scope", "col")}}) {
{ uiutils.Text(uiutils.Get(vLabels, "qty")) }
}
@compose.TableHeadCell(compose.TableHeadCellProps{BoxProps: box.BoxProps{Class: "py-2", Attrs: uiutils.Attrs("scope", "col")}}) {
{ uiutils.Text(uiutils.Get(vLabels, "total")) }
}
@compose.TableHeadCell(compose.TableHeadCellProps{BoxProps: box.BoxProps{Class: "py-2", Attrs: uiutils.Attrs("scope", "col")}}) {
@compose.Inline(compose.InlineProps{TextProps: text.TextProps{Class: "sr-only"}}) {
{ uiutils.Text(uiutils.Get(vLabels, "remove")) }
}
}
}
}
@compose.TableBody(compose.TableBodyProps{BoxProps: box.BoxProps{}}) {
for _, vLine := range uiutils.L(vLines) {
@compose.TableRow(compose.TableRowProps{BoxProps: box.BoxProps{Class: "border-t border-border", Attrs: uiutils.Attrs("data-slot", "item")}}) {
@compose.TableCell(compose.TableCellProps{BoxProps: box.BoxProps{Class: uiutils.S(uiutils.Cnv(uiutils.Cond(uiutils.T(uiutils.Eq(vDensity, "compact")), "py-2", "py-4")))}}) {
@compose.Group(compose.GroupProps{Gap: "4", Align: "center", BoxProps: box.BoxProps{}}) {
if uiutils.Eq(vMedia, "image") {
@MediaFrame(MediaFrameProps{Alt: uiutils.Get(vLine, "name"), Src: uiutils.Get(vLine, "image"), Ratio: "1/1", Class: uiutils.Cnv("hidden size-14 shrink-0 sm:block")})
}
@compose.Stack(compose.StackProps{Gap: "0", BoxProps: box.BoxProps{}}) {
@compose.Text(compose.TextProps{Size: "sm", Weight: "semibold", TextProps: text.TextProps{}}) {
{ uiutils.Text(uiutils.Get(vLine, "name")) }
}
@compose.Text(compose.TextProps{Size: "xs", TextProps: text.TextProps{Class: "text-muted-foreground"}}) {
{ uiutils.Text(uiutils.Get(vLine, "variant")) }
}
}
}
}
@compose.TableCell(compose.TableCellProps{BoxProps: box.BoxProps{Class: "hidden sm:table-cell"}}) {
{ uiutils.Text(uiutils.Money(uiutils.Get(vLine, "price"), uiutils.Get(vLine, "currency"))) }
}
@compose.TableCell(compose.TableCellProps{BoxProps: box.BoxProps{}}) {
@NumberField(NumberFieldProps{Value: uiutils.Str(uiutils.Get(vLine, "qty")), Name: uiutils.Tpl("{0}-{1}", vField, uiutils.Get(vLine, "id")), Min: "1", Label: uiutils.Get(vLabels, "qty"), Decrease: uiutils.Get(vLabels, "decrease"), Increase: uiutils.Get(vLabels, "increase")})
}
@compose.TableCell(compose.TableCellProps{BoxProps: box.BoxProps{Class: "font-semibold"}}) {
{ uiutils.Text(uiutils.Money(uiutils.Mul(uiutils.Get(vLine, "price"), uiutils.Get(vLine, "qty")), uiutils.Get(vLine, "currency"))) }
}
@compose.TableCell(compose.TableCellProps{BoxProps: box.BoxProps{Class: "text-right"}}) {
@compose.Button(compose.ButtonProps{Variant: "ghost", Size: "sm", Layout: "icon", ButtonProps: button.ButtonProps{AriaLabel: uiutils.S(uiutils.Get(vLabels, "remove"))}}) {
@icons.LucideIcon(icons.LucideIconProps{Name: "x", Size: 16})
}
}
}
}
}
}
}
if uiutils.Gt(uiutils.Len(vLines), float64(0)) {
@compose.Group(compose.GroupProps{Gap: "4", Align: "center", Justify: "between", BoxProps: box.BoxProps{Class: "mt-4 flex-wrap border-t border-border pt-4", Attrs: uiutils.Attrs("data-slot", "cart-footer")}}) {
@compose.Text(compose.TextProps{Size: "base", Weight: "bold", TextProps: text.TextProps{Attrs: uiutils.Attrs("data-slot", "subtotal")}}) {
{ uiutils.Text(uiutils.Get(vLabels, "subtotal")) }
{ uiutils.Text(" ") }
{ uiutils.Text(uiutils.Money(uiutils.SumBy(vLines, "price", "qty"), uiutils.FirstOf(vLines, "currency"))) }
}
@compose.Button(compose.ButtonProps{Variant: "default", Size: "default", ButtonProps: button.ButtonProps{}}) {
{ uiutils.Text(uiutils.Get(vLabels, "checkout")) }
}
}
}
}
Point the CLI at this runtime once, then add the item:
npx ui8kit init --yes --framework twig --dir src --registry-url https://registry.buildy.tw/twig --strict-cdnnpx ui8kit add cart-table{#- Code generated by packages/kit-compose/src/server-organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT.
Source: packages/compose-gen/specs/organisms/cart-table.json
The lines of a cart as a table (the table layout of CartList): product, price, quantity, line total and a remove button.
Props (p): lines, labels, media, density, field. -#}
{%- set v_lines = (p.lines ?? null) -%}
{%- set v_labels = (p.labels ?? null) -%}
{%- set v_media = (p.media ?? 'image') -%}
{%- set v_density = (p.density ?? 'default') -%}
{%- set v_field = (p.field ?? 'qty') -%}
{%- set c_23 -%}
{%- set c_22 -%}
{%- set c_1 -%}
{{ og_text(og_get(v_labels, ['caption'])) }}
{%- endset -%}
{{ include('compose/TableCaption.html.twig', {'class': 'sr-only', 'children': c_1}, with_context = false) }}
{%- set c_9 -%}
{%- set c_8 -%}
{%- set c_2 -%}
{{ og_text(og_get(v_labels, ['product'])) }}
{%- endset -%}
{{ include('compose/TableHeadCell.html.twig', {'class': 'py-2', 'attrs': og_attrs(['scope', 'col']), 'children': c_2}, with_context = false) }}
{%- set c_3 -%}
{{ og_text(og_get(v_labels, ['price'])) }}
{%- endset -%}
{{ include('compose/TableHeadCell.html.twig', {'class': 'hidden py-2 sm:table-cell', 'attrs': og_attrs(['scope', 'col']), 'children': c_3}, with_context = false) }}
{%- set c_4 -%}
{{ og_text(og_get(v_labels, ['qty'])) }}
{%- endset -%}
{{ include('compose/TableHeadCell.html.twig', {'class': 'py-2', 'attrs': og_attrs(['scope', 'col']), 'children': c_4}, with_context = false) }}
{%- set c_5 -%}
{{ og_text(og_get(v_labels, ['total'])) }}
{%- endset -%}
{{ include('compose/TableHeadCell.html.twig', {'class': 'py-2', 'attrs': og_attrs(['scope', 'col']), 'children': c_5}, with_context = false) }}
{%- set c_7 -%}
{%- set c_6 -%}
{{ og_text(og_get(v_labels, ['remove'])) }}
{%- endset -%}
{{ include('compose/Inline.html.twig', {'class': 'sr-only', 'children': c_6}, with_context = false) }}
{%- endset -%}
{{ include('compose/TableHeadCell.html.twig', {'class': 'py-2', 'attrs': og_attrs(['scope', 'col']), 'children': c_7}, with_context = false) }}
{%- endset -%}
{{ include('compose/TableRow.html.twig', {'children': c_8}, with_context = false) }}
{%- endset -%}
{{ include('compose/TableHead.html.twig', {'children': c_9}, with_context = false) }}
{%- set c_21 -%}
{%- for v_line in og_l(v_lines) %}
{%- set c_20 -%}
{%- set c_14 -%}
{%- set c_13 -%}
{%- if og_t(og_eq(v_media, 'image')) %}
{{ include('blocks/media-frame.html.twig', {'p': {'alt': og_get(v_line, ['name']), 'src': og_get(v_line, ['image']), 'ratio': '1/1', 'className': og_cnv(['hidden size-14 shrink-0 sm:block'])}}, with_context = false) }}
{%- endif %}
{%- set c_12 -%}
{%- set c_10 -%}
{{ og_text(og_get(v_line, ['name'])) }}
{%- endset -%}
{{ include('compose/Text.html.twig', {'size': 'sm', 'weight': 'semibold', 'children': c_10}, with_context = false) }}
{%- set c_11 -%}
{{ og_text(og_get(v_line, ['variant'])) }}
{%- endset -%}
{{ include('compose/Text.html.twig', {'size': 'xs', 'class': 'text-muted-foreground', 'children': c_11}, with_context = false) }}
{%- endset -%}
{{ include('compose/Stack.html.twig', {'gap': '0', 'children': c_12}, with_context = false) }}
{%- endset -%}
{{ include('compose/Group.html.twig', {'gap': '4', 'align': 'center', 'children': c_13}, with_context = false) }}
{%- endset -%}
{{ include('compose/TableCell.html.twig', {'class': og_s(og_cnv([(og_t(og_eq(v_density, 'compact')) ? 'py-2' : 'py-4')])), 'children': c_14}, with_context = false) }}
{%- set c_15 -%}
{{ og_text(og_money(og_get(v_line, ['price']), og_get(v_line, ['currency']))) }}
{%- endset -%}
{{ include('compose/TableCell.html.twig', {'class': 'hidden sm:table-cell', 'children': c_15}, with_context = false) }}
{%- set c_16 -%}
{{ include('blocks/number-field.html.twig', {'p': {'value': og_str(og_get(v_line, ['qty'])), 'name': og_tpl('{0}-{1}', [v_field, og_get(v_line, ['id'])]), 'min': '1', 'label': og_get(v_labels, ['qty']), 'decrease': og_get(v_labels, ['decrease']), 'increase': og_get(v_labels, ['increase'])}}, with_context = false) }}
{%- endset -%}
{{ include('compose/TableCell.html.twig', {'children': c_16}, with_context = false) }}
{%- set c_17 -%}
{{ og_text(og_money(og_mul(og_get(v_line, ['price']), og_get(v_line, ['qty'])), og_get(v_line, ['currency']))) }}
{%- endset -%}
{{ include('compose/TableCell.html.twig', {'class': 'font-semibold', 'children': c_17}, with_context = false) }}
{%- set c_19 -%}
{%- set c_18 -%}
{{ include('icons/LucideIcon.html.twig', {'name': 'x', 'size': 16}, with_context = false) }}
{%- endset -%}
{{ include('compose/Button.html.twig', {'variant': 'ghost', 'size': 'sm', 'layout': 'icon', 'ariaLabel': og_s(og_get(v_labels, ['remove'])), 'children': c_18}, with_context = false) }}
{%- endset -%}
{{ include('compose/TableCell.html.twig', {'class': 'text-right', 'children': c_19}, with_context = false) }}
{%- endset -%}
{{ include('compose/TableRow.html.twig', {'class': 'border-t border-border', 'attrs': og_attrs(['data-slot', 'item']), 'children': c_20}, with_context = false) }}
{%- endfor %}
{%- endset -%}
{{ include('compose/TableBody.html.twig', {'children': c_21}, with_context = false) }}
{%- endset -%}
{{ include('compose/Table.html.twig', {'class': 'w-full text-left text-sm', 'attrs': og_attrs(['data-slot', 'cart-table']), 'children': c_22}, with_context = false) }}
{%- endset -%}
{{ include('compose/Box.html.twig', {'class': 'w-full overflow-x-auto', 'attrs': og_attrs(['data-slot', 'cart-table-root']), 'children': c_23}, with_context = false) }}
{%- if og_t(og_gt(og_len(v_lines), 0)) %}
{%- set c_26 -%}
{%- set c_24 -%}
{{ og_text(og_get(v_labels, ['subtotal'])) }}
{{ og_text(' ') }}
{{ og_text(og_money(og_sum_by(v_lines, 'price', 'qty'), og_first_of(v_lines, 'currency'))) }}
{%- endset -%}
{{ include('compose/Text.html.twig', {'size': 'base', 'weight': 'bold', 'attrs': og_attrs(['data-slot', 'subtotal']), 'children': c_24}, with_context = false) }}
{%- set c_25 -%}
{{ og_text(og_get(v_labels, ['checkout'])) }}
{%- endset -%}
{{ include('compose/Button.html.twig', {'variant': 'default', 'size': 'default', 'children': c_25}, with_context = false) }}
{%- endset -%}
{{ include('compose/Group.html.twig', {'gap': '4', 'align': 'center', 'justify': 'between', 'class': 'mt-4 flex-wrap border-t border-border pt-4', 'attrs': og_attrs(['data-slot', 'cart-footer']), 'children': c_26}, with_context = false) }}
{%- endif %}
Point the CLI at this runtime once, then add the item:
npx ui8kit init --yes --framework latte --dir src --registry-url https://registry.buildy.tw/latte --strict-cdnnpx ui8kit add cart-table{* Code generated by packages/kit-compose/src/server-organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT.
Source: packages/compose-gen/specs/organisms/cart-table.json
The lines of a cart as a table (the table layout of CartList): product, price, quantity, line total and a remove button.
Props (p): lines, labels, media, density, field. *}
{var $v_lines = ($p['lines'] ?? null)}
{var $v_labels = ($p['labels'] ?? null)}
{var $v_media = ($p['media'] ?? 'image')}
{var $v_density = ($p['density'] ?? 'default')}
{var $v_field = ($p['field'] ?? 'qty')}
{capture $c_23}
{capture $c_22}
{capture $c_1}
{=og_text(og_get($v_labels, ['caption']))}
{/capture}
{=og_include('compose/TableCaption.latte', ['class' => 'sr-only', 'children' => (string) $c_1])|noescape}
{capture $c_9}
{capture $c_8}
{capture $c_2}
{=og_text(og_get($v_labels, ['product']))}
{/capture}
{=og_include('compose/TableHeadCell.latte', ['class' => 'py-2', 'attrs' => og_attrs(['scope', 'col']), 'children' => (string) $c_2])|noescape}
{capture $c_3}
{=og_text(og_get($v_labels, ['price']))}
{/capture}
{=og_include('compose/TableHeadCell.latte', ['class' => 'hidden py-2 sm:table-cell', 'attrs' => og_attrs(['scope', 'col']), 'children' => (string) $c_3])|noescape}
{capture $c_4}
{=og_text(og_get($v_labels, ['qty']))}
{/capture}
{=og_include('compose/TableHeadCell.latte', ['class' => 'py-2', 'attrs' => og_attrs(['scope', 'col']), 'children' => (string) $c_4])|noescape}
{capture $c_5}
{=og_text(og_get($v_labels, ['total']))}
{/capture}
{=og_include('compose/TableHeadCell.latte', ['class' => 'py-2', 'attrs' => og_attrs(['scope', 'col']), 'children' => (string) $c_5])|noescape}
{capture $c_7}
{capture $c_6}
{=og_text(og_get($v_labels, ['remove']))}
{/capture}
{=og_include('compose/Inline.latte', ['class' => 'sr-only', 'children' => (string) $c_6])|noescape}
{/capture}
{=og_include('compose/TableHeadCell.latte', ['class' => 'py-2', 'attrs' => og_attrs(['scope', 'col']), 'children' => (string) $c_7])|noescape}
{/capture}
{=og_include('compose/TableRow.latte', ['children' => (string) $c_8])|noescape}
{/capture}
{=og_include('compose/TableHead.latte', ['children' => (string) $c_9])|noescape}
{capture $c_21}
{foreach og_l($v_lines) as $v_line}
{capture $c_20}
{capture $c_14}
{capture $c_13}
{if og_t(og_eq($v_media, 'image'))}
{=og_include('blocks/media-frame.latte', ['p' => ['alt' => og_get($v_line, ['name']), 'src' => og_get($v_line, ['image']), 'ratio' => '1/1', 'className' => og_cnv(['hidden size-14 shrink-0 sm:block'])]])|noescape}
{/if}
{capture $c_12}
{capture $c_10}
{=og_text(og_get($v_line, ['name']))}
{/capture}
{=og_include('compose/Text.latte', ['size' => 'sm', 'weight' => 'semibold', 'children' => (string) $c_10])|noescape}
{capture $c_11}
{=og_text(og_get($v_line, ['variant']))}
{/capture}
{=og_include('compose/Text.latte', ['size' => 'xs', 'class' => 'text-muted-foreground', 'children' => (string) $c_11])|noescape}
{/capture}
{=og_include('compose/Stack.latte', ['gap' => '0', 'children' => (string) $c_12])|noescape}
{/capture}
{=og_include('compose/Group.latte', ['gap' => '4', 'align' => 'center', 'children' => (string) $c_13])|noescape}
{/capture}
{=og_include('compose/TableCell.latte', ['class' => og_s(og_cnv([(og_t(og_eq($v_density, 'compact')) ? 'py-2' : 'py-4')])), 'children' => (string) $c_14])|noescape}
{capture $c_15}
{=og_text(og_money(og_get($v_line, ['price']), og_get($v_line, ['currency'])))}
{/capture}
{=og_include('compose/TableCell.latte', ['class' => 'hidden sm:table-cell', 'children' => (string) $c_15])|noescape}
{capture $c_16}
{=og_include('blocks/number-field.latte', ['p' => ['value' => og_str(og_get($v_line, ['qty'])), 'name' => og_tpl('{0}-{1}', [$v_field, og_get($v_line, ['id'])]), 'min' => '1', 'label' => og_get($v_labels, ['qty']), 'decrease' => og_get($v_labels, ['decrease']), 'increase' => og_get($v_labels, ['increase'])]])|noescape}
{/capture}
{=og_include('compose/TableCell.latte', ['children' => (string) $c_16])|noescape}
{capture $c_17}
{=og_text(og_money(og_mul(og_get($v_line, ['price']), og_get($v_line, ['qty'])), og_get($v_line, ['currency'])))}
{/capture}
{=og_include('compose/TableCell.latte', ['class' => 'font-semibold', 'children' => (string) $c_17])|noescape}
{capture $c_19}
{capture $c_18}
{=og_include('icons/LucideIcon.latte', ['name' => 'x', 'size' => 16])|noescape}
{/capture}
{=og_include('compose/Button.latte', ['variant' => 'ghost', 'size' => 'sm', 'layout' => 'icon', 'ariaLabel' => og_s(og_get($v_labels, ['remove'])), 'children' => (string) $c_18])|noescape}
{/capture}
{=og_include('compose/TableCell.latte', ['class' => 'text-right', 'children' => (string) $c_19])|noescape}
{/capture}
{=og_include('compose/TableRow.latte', ['class' => 'border-t border-border', 'attrs' => og_attrs(['data-slot', 'item']), 'children' => (string) $c_20])|noescape}
{/foreach}
{/capture}
{=og_include('compose/TableBody.latte', ['children' => (string) $c_21])|noescape}
{/capture}
{=og_include('compose/Table.latte', ['class' => 'w-full text-left text-sm', 'attrs' => og_attrs(['data-slot', 'cart-table']), 'children' => (string) $c_22])|noescape}
{/capture}
{=og_include('compose/Box.latte', ['class' => 'w-full overflow-x-auto', 'attrs' => og_attrs(['data-slot', 'cart-table-root']), 'children' => (string) $c_23])|noescape}
{if og_t(og_gt(og_len($v_lines), 0))}
{capture $c_26}
{capture $c_24}
{=og_text(og_get($v_labels, ['subtotal']))}
{=og_text(' ')}
{=og_text(og_money(og_sum_by($v_lines, 'price', 'qty'), og_first_of($v_lines, 'currency')))}
{/capture}
{=og_include('compose/Text.latte', ['size' => 'base', 'weight' => 'bold', 'attrs' => og_attrs(['data-slot', 'subtotal']), 'children' => (string) $c_24])|noescape}
{capture $c_25}
{=og_text(og_get($v_labels, ['checkout']))}
{/capture}
{=og_include('compose/Button.latte', ['variant' => 'default', 'size' => 'default', 'children' => (string) $c_25])|noescape}
{/capture}
{=og_include('compose/Group.latte', ['gap' => '4', 'align' => 'center', 'justify' => 'between', 'class' => 'mt-4 flex-wrap border-t border-border pt-4', 'attrs' => og_attrs(['data-slot', 'cart-footer']), 'children' => (string) $c_26])|noescape}
{/if}
Point the CLI at this runtime once, then add the item:
npx ui8kit init --yes --framework jinja2 --dir src --registry-url https://registry.buildy.tw/jinja2 --strict-cdnnpx ui8kit add cart-table{#- Code generated by packages/kit-compose/src/server-organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT.
Source: packages/compose-gen/specs/organisms/cart-table.json
The lines of a cart as a table (the table layout of CartList): product, price, quantity, line total and a remove button.
Props (p): lines, labels, media, density, field. -#}
{%- set v_lines = og_def(p['lines'], none) -%}
{%- set v_labels = og_def(p['labels'], none) -%}
{%- set v_media = og_def(p['media'], 'image') -%}
{%- set v_density = og_def(p['density'], 'default') -%}
{%- set v_field = og_def(p['field'], 'qty') -%}
{%- set c_23 -%}
{%- set c_22 -%}
{%- set c_1 -%}
{{ og_text(og_get(v_labels, ['caption'])) }}
{%- endset -%}
{{ og_include('compose/table-caption.html.j2', {'p': {'Class': 'sr-only'}, 'children': c_1}) }}
{%- set c_9 -%}
{%- set c_8 -%}
{%- set c_2 -%}
{{ og_text(og_get(v_labels, ['product'])) }}
{%- endset -%}
{{ og_include('compose/table-head-cell.html.j2', {'p': {'Class': 'py-2', 'Attrs': og_attrs(['scope', 'col'])}, 'children': c_2}) }}
{%- set c_3 -%}
{{ og_text(og_get(v_labels, ['price'])) }}
{%- endset -%}
{{ og_include('compose/table-head-cell.html.j2', {'p': {'Class': 'hidden py-2 sm:table-cell', 'Attrs': og_attrs(['scope', 'col'])}, 'children': c_3}) }}
{%- set c_4 -%}
{{ og_text(og_get(v_labels, ['qty'])) }}
{%- endset -%}
{{ og_include('compose/table-head-cell.html.j2', {'p': {'Class': 'py-2', 'Attrs': og_attrs(['scope', 'col'])}, 'children': c_4}) }}
{%- set c_5 -%}
{{ og_text(og_get(v_labels, ['total'])) }}
{%- endset -%}
{{ og_include('compose/table-head-cell.html.j2', {'p': {'Class': 'py-2', 'Attrs': og_attrs(['scope', 'col'])}, 'children': c_5}) }}
{%- set c_7 -%}
{%- set c_6 -%}
{{ og_text(og_get(v_labels, ['remove'])) }}
{%- endset -%}
{{ og_include('compose/inline.html.j2', {'p': {'Class': 'sr-only'}, 'children': c_6}) }}
{%- endset -%}
{{ og_include('compose/table-head-cell.html.j2', {'p': {'Class': 'py-2', 'Attrs': og_attrs(['scope', 'col'])}, 'children': c_7}) }}
{%- endset -%}
{{ og_include('compose/table-row.html.j2', {'p': {}, 'children': c_8}) }}
{%- endset -%}
{{ og_include('compose/table-head.html.j2', {'p': {}, 'children': c_9}) }}
{%- set c_21 -%}
{%- for v_line in og_l(v_lines) %}
{%- set c_20 -%}
{%- set c_14 -%}
{%- set c_13 -%}
{%- if og_t(og_eq(v_media, 'image')) %}
{{ og_include('blocks/media-frame.html.j2', {'p': {'alt': og_get(v_line, ['name']), 'src': og_get(v_line, ['image']), 'ratio': '1/1', 'className': og_cnv(['hidden size-14 shrink-0 sm:block'])}}) }}
{%- endif %}
{%- set c_12 -%}
{%- set c_10 -%}
{{ og_text(og_get(v_line, ['name'])) }}
{%- endset -%}
{{ og_include('compose/text.html.j2', {'p': {'Size': 'sm', 'Weight': 'semibold'}, 'children': c_10}) }}
{%- set c_11 -%}
{{ og_text(og_get(v_line, ['variant'])) }}
{%- endset -%}
{{ og_include('compose/text.html.j2', {'p': {'Size': 'xs', 'Class': 'text-muted-foreground'}, 'children': c_11}) }}
{%- endset -%}
{{ og_include('compose/stack.html.j2', {'p': {'Gap': '0'}, 'children': c_12}) }}
{%- endset -%}
{{ og_include('compose/group.html.j2', {'p': {'Gap': '4', 'Align': 'center'}, 'children': c_13}) }}
{%- endset -%}
{{ og_include('compose/table-cell.html.j2', {'p': {'Class': og_s(og_cnv([('py-2' if og_t(og_eq(v_density, 'compact')) else 'py-4')]))}, 'children': c_14}) }}
{%- set c_15 -%}
{{ og_text(og_money(og_get(v_line, ['price']), og_get(v_line, ['currency']))) }}
{%- endset -%}
{{ og_include('compose/table-cell.html.j2', {'p': {'Class': 'hidden sm:table-cell'}, 'children': c_15}) }}
{%- set c_16 -%}
{{ og_include('blocks/number-field.html.j2', {'p': {'value': og_str(og_get(v_line, ['qty'])), 'name': og_tpl('{0}-{1}', [v_field, og_get(v_line, ['id'])]), 'min': '1', 'label': og_get(v_labels, ['qty']), 'decrease': og_get(v_labels, ['decrease']), 'increase': og_get(v_labels, ['increase'])}}) }}
{%- endset -%}
{{ og_include('compose/table-cell.html.j2', {'p': {}, 'children': c_16}) }}
{%- set c_17 -%}
{{ og_text(og_money(og_mul(og_get(v_line, ['price']), og_get(v_line, ['qty'])), og_get(v_line, ['currency']))) }}
{%- endset -%}
{{ og_include('compose/table-cell.html.j2', {'p': {'Class': 'font-semibold'}, 'children': c_17}) }}
{%- set c_19 -%}
{%- set c_18 -%}
{{ og_include('icons/lucide-icon.html.j2', {'p': {'Name': 'x', 'Size': 16}}) }}
{%- endset -%}
{{ og_include('compose/button.html.j2', {'p': {'Variant': 'ghost', 'Size': 'sm', 'Layout': 'icon', 'AriaLabel': og_s(og_get(v_labels, ['remove']))}, 'children': c_18}) }}
{%- endset -%}
{{ og_include('compose/table-cell.html.j2', {'p': {'Class': 'text-right'}, 'children': c_19}) }}
{%- endset -%}
{{ og_include('compose/table-row.html.j2', {'p': {'Class': 'border-t border-border', 'Attrs': og_attrs(['data-slot', 'item'])}, 'children': c_20}) }}
{%- endfor %}
{%- endset -%}
{{ og_include('compose/table-body.html.j2', {'p': {}, 'children': c_21}) }}
{%- endset -%}
{{ og_include('compose/table.html.j2', {'p': {'Class': 'w-full text-left text-sm', 'Attrs': og_attrs(['data-slot', 'cart-table'])}, 'children': c_22}) }}
{%- endset -%}
{{ og_include('compose/box.html.j2', {'p': {'Class': 'w-full overflow-x-auto', 'Attrs': og_attrs(['data-slot', 'cart-table-root'])}, 'children': c_23}) }}
{%- if og_t(og_gt(og_len(v_lines), 0)) %}
{%- set c_26 -%}
{%- set c_24 -%}
{{ og_text(og_get(v_labels, ['subtotal'])) }}
{{ og_text(' ') }}
{{ og_text(og_money(og_sum_by(v_lines, 'price', 'qty'), og_first_of(v_lines, 'currency'))) }}
{%- endset -%}
{{ og_include('compose/text.html.j2', {'p': {'Size': 'base', 'Weight': 'bold', 'Attrs': og_attrs(['data-slot', 'subtotal'])}, 'children': c_24}) }}
{%- set c_25 -%}
{{ og_text(og_get(v_labels, ['checkout'])) }}
{%- endset -%}
{{ og_include('compose/button.html.j2', {'p': {'Variant': 'default', 'Size': 'default'}, 'children': c_25}) }}
{%- endset -%}
{{ og_include('compose/group.html.j2', {'p': {'Gap': '4', 'Align': 'center', 'Justify': 'between', 'Class': 'mt-4 flex-wrap border-t border-border pt-4', 'Attrs': og_attrs(['data-slot', 'cart-footer'])}, 'children': c_26}) }}
{%- endif %}
Props
Names and types come from the xgen specs of the source. Standard HTML attributes (id, role, tabIndex, aria-*) pass through to the root element; the class prop is className in React.
The lines of a cart as a table (the table layout of CartList): product, price, quantity, line total and a remove button.
| Prop | Type | Default | Description |
|---|---|---|---|
| lines (required) | CartLine[] | - | |
| labels (required) | CartLabels | - | |
| media | "image" | "none" | "image" | |
| density | "default" | "compact" | "default" | |
| field | string | "qty" | prefix of the quantity field names (one name per line: <field>-<line id>) |