Cut Cards
Cut Cards component
Install
npx ui8kit add cut-cardsPulls in: badge, compose, dish-showcase, grid, inline, kit-box, kit-text, list, list-item, lucide-icon, media-frame, stack, text, utils
Preview
Pork neck
Juicy and forgiving on the coals.
- Weight500 g
- Heatmedium heat
- Price$18.90
Chicken thigh
Tender, cooks fast.
- Weight500 g
- Heatmedium heat
- Price$12.90
Lamb rack
Rich, best pink inside.
- Weight500 g
- Heathigh heat
- Price$34.90
Beef sirloin
Lean, for steaks on a skewer.
- Weight500 g
- Heathigh heat
- Price$29.90
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 cut-cards<!-- 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 cards layout of DishCompare: one compare card per cut with a picture, the name, the summary, the weight,
heat and price as a description list, and the cooking time.
-->
<script lang="ts" module>
import type { Snippet } from "svelte";
import type { Dish, FoodLabels } from "../blocks/dish-showcase.types";
export type CutCardsProps = {
dishes: Dish[];
labels: FoodLabels;
};
</script>
<script lang="ts">
import Badge from "../compose/Badge.svelte";
import Grid from "../compose/Grid.svelte";
import Inline from "../compose/Inline.svelte";
import List from "../compose/List.svelte";
import ListItem from "../compose/ListItem.svelte";
import LucideIcon from "../icons/LucideIcon.svelte";
import Stack from "../compose/Stack.svelte";
import Text from "../compose/Text.svelte";
import MediaFrame from "../components/media-frame.svelte";
import { fmtMoney, tpl } from "../utils";
let { dishes, labels }: CutCardsProps = $props();
</script>
<Grid cols="1-4" class="gap-4" data-slot="items">
{#each dishes as d (d.id)}
<Stack gap="4" class="rounded bg-card inset-ring inset-ring-border p-4" data-slot="item">
<MediaFrame alt={d.name} src={d.image} ratio="4/3" />
<Text size="lg" weight="semibold">
{d.name}
</Text>
<Text size="sm" class="text-muted-foreground">
{d.summary}
</Text>
<List tag="ul" class="flex flex-col gap-2 text-sm">
<ListItem class="flex items-center justify-between gap-4">
<Inline class="text-muted-foreground">
{labels.weight}
</Inline>
<Inline class="font-semibold">
{d.weight}
</Inline>
</ListItem>
<ListItem class="flex items-center justify-between gap-4">
<Inline class="text-muted-foreground">
{labels.heat}
</Inline>
<Inline class="font-semibold">
{d.tag}
</Inline>
</ListItem>
<ListItem class="flex items-center justify-between gap-4">
<Inline class="text-muted-foreground">
{labels.price}
</Inline>
<Inline class="font-semibold">
{fmtMoney(d.price, d.currency)}
</Inline>
</ListItem>
</List>
<Badge variant="secondary" size="default" class="w-fit">
<LucideIcon name="timer" size={16} />
{tpl(labels.minutes, (d.minutes == null ? undefined : String(d.minutes)))}
</Badge>
</Stack>
{/each}
</Grid>
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 cut-cards// 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 cards layout of DishCompare: one compare card per cut with a picture, the name, the summary, the weight,
* heat and price as a description list, and the cooking time.
*/
import { type ReactNode } from "react";
import { Badge, Grid, Inline, List, ListItem, Stack, Text } from "../compose";
import { LucideIcon } from "../icons/LucideIcon";
import { MediaFrame } from "../components/media-frame";
import { fmtMoney, tpl } from "../utils";
import type { Dish, FoodLabels } from "../blocks/dish-showcase.types";
export type CutCardsProps = {
dishes: Dish[];
labels: FoodLabels;
};
export function CutCards({ dishes, labels }: CutCardsProps) {
return (
<Grid cols="1-4" className="gap-4" data-slot="items">
{(dishes ?? []).map((d) => (
<Stack key={d.id} gap="4" className="rounded bg-card inset-ring inset-ring-border p-4" data-slot="item">
<MediaFrame alt={d.name} src={d.image} ratio="4/3" />
<Text size="lg" weight="semibold">
{d.name}
</Text>
<Text size="sm" className="text-muted-foreground">
{d.summary}
</Text>
<List tag="ul" className="flex flex-col gap-2 text-sm">
<ListItem className="flex items-center justify-between gap-4">
<Inline className="text-muted-foreground">
{labels.weight}
</Inline>
<Inline className="font-semibold">
{d.weight}
</Inline>
</ListItem>
<ListItem className="flex items-center justify-between gap-4">
<Inline className="text-muted-foreground">
{labels.heat}
</Inline>
<Inline className="font-semibold">
{d.tag}
</Inline>
</ListItem>
<ListItem className="flex items-center justify-between gap-4">
<Inline className="text-muted-foreground">
{labels.price}
</Inline>
<Inline className="font-semibold">
{fmtMoney(d.price, d.currency)}
</Inline>
</ListItem>
</List>
<Badge variant="secondary" size="default" className="w-fit">
<LucideIcon name="timer" size={16} />
{tpl(labels.minutes, (d.minutes == null ? undefined : String(d.minutes)))}
</Badge>
</Stack>
))}
</Grid>
);
}
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 cut-cards<!-- 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 cards layout of DishCompare: one compare card per cut with a picture, the name, the summary, the weight,
heat and price as a description list, and the cooking time.
-->
<script lang="ts">
import type { Dish, FoodLabels } from "../blocks/dish-showcase.types";
export type CutCardsProps = {
dishes: Dish[];
labels: FoodLabels;
};
</script>
<script setup lang="ts">
import Badge from "../compose/Badge.vue";
import Grid from "../compose/Grid.vue";
import Inline from "../compose/Inline.vue";
import List from "../compose/List.vue";
import ListItem from "../compose/ListItem.vue";
import LucideIcon from "../icons/LucideIcon.vue";
import Stack from "../compose/Stack.vue";
import Text from "../compose/Text.vue";
import MediaFrame from "../components/media-frame.vue";
import { fmtMoney, tpl } from "../utils";
const { dishes, labels } = defineProps<CutCardsProps>();
</script>
<template>
<Grid cols="1-4" class="gap-4" data-slot="items">
<Stack
v-for="d in dishes"
:key="d.id"
gap="4"
class="rounded bg-card inset-ring inset-ring-border p-4"
data-slot="item"
>
<MediaFrame :alt="d.name" :src="d.image" ratio="4/3" />
<Text size="lg" weight="semibold">
{{ d.name }}
</Text>
<Text size="sm" class="text-muted-foreground">
{{ d.summary }}
</Text>
<List tag="ul" class="flex flex-col gap-2 text-sm">
<ListItem class="flex items-center justify-between gap-4">
<Inline class="text-muted-foreground">
{{ labels.weight }}
</Inline>
<Inline class="font-semibold">
{{ d.weight }}
</Inline>
</ListItem>
<ListItem class="flex items-center justify-between gap-4">
<Inline class="text-muted-foreground">
{{ labels.heat }}
</Inline>
<Inline class="font-semibold">
{{ d.tag }}
</Inline>
</ListItem>
<ListItem class="flex items-center justify-between gap-4">
<Inline class="text-muted-foreground">
{{ labels.price }}
</Inline>
<Inline class="font-semibold">
{{ fmtMoney(d.price, d.currency) }}
</Inline>
</ListItem>
</List>
<Badge variant="secondary" size="default" class="w-fit">
<LucideIcon name="timer" :size="16" />
{{ tpl(labels.minutes, (d.minutes == null ? undefined : String(d.minutes))) }}
</Badge>
</Stack>
</Grid>
</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 cut-cards// 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 cards layout of DishCompare: one compare card per cut with a picture, the name, the summary, the weight,
* heat and price as a description list, and the cooking time.
*/
import { For, type JSX } from "solid-js";
import { Badge, Grid, Inline, List, ListItem, Stack, Text } from "../compose";
import { LucideIcon } from "../icons/LucideIcon";
import { MediaFrame } from "../components/media-frame";
import { fmtMoney, tpl } from "../utils";
import type { Dish, FoodLabels } from "../blocks/dish-showcase.types";
export type CutCardsProps = {
dishes: Dish[];
labels: FoodLabels;
};
export function CutCards({ dishes, labels }: CutCardsProps) {
return (
<Grid cols="1-4" class="gap-4" data-slot="items">
<For each={dishes ?? []}>{(d) => (
<Stack gap="4" class="rounded bg-card inset-ring inset-ring-border p-4" data-slot="item">
<MediaFrame alt={d.name} src={d.image} ratio="4/3" />
<Text size="lg" weight="semibold">
{d.name}
</Text>
<Text size="sm" class="text-muted-foreground">
{d.summary}
</Text>
<List tag="ul" class="flex flex-col gap-2 text-sm">
<ListItem class="flex items-center justify-between gap-4">
<Inline class="text-muted-foreground">
{labels.weight}
</Inline>
<Inline class="font-semibold">
{d.weight}
</Inline>
</ListItem>
<ListItem class="flex items-center justify-between gap-4">
<Inline class="text-muted-foreground">
{labels.heat}
</Inline>
<Inline class="font-semibold">
{d.tag}
</Inline>
</ListItem>
<ListItem class="flex items-center justify-between gap-4">
<Inline class="text-muted-foreground">
{labels.price}
</Inline>
<Inline class="font-semibold">
{fmtMoney(d.price, d.currency)}
</Inline>
</ListItem>
</List>
<Badge variant="secondary" size="default" class="w-fit">
<LucideIcon name="timer" size={16} />
{tpl(labels.minutes, (d.minutes == null ? undefined : String(d.minutes)))}
</Badge>
</Stack>
)}</For>
</Grid>
);
}
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 cut-cards// 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/cut-cards.json
package blocks
import (
"github.com/ui8kit/codegen/generated/templ/ui/box"
"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"
)
// CutCardsProps are the props of CutCards; the values are the JSON shapes of the TypeScript props.
type CutCardsProps struct {
Dishes any `json:"dishes"`
Labels any `json:"labels"`
}
// The cards layout of DishCompare: one compare card per cut with a picture, the name, the summary, the weight, heat and price as a description list, and the cooking time.
templ CutCards(p CutCardsProps) {
{{ vDishes := p.Dishes }}
{{ vLabels := p.Labels }}
@compose.Grid(compose.GridProps{Cols: "1-4", BoxProps: box.BoxProps{Class: "gap-4", Attrs: uiutils.Attrs("data-slot", "items")}}) {
for _, vD := range uiutils.L(vDishes) {
@compose.Stack(compose.StackProps{Gap: "4", BoxProps: box.BoxProps{Class: "rounded bg-card inset-ring inset-ring-border p-4", Attrs: uiutils.Attrs("data-slot", "item")}}) {
@MediaFrame(MediaFrameProps{Alt: uiutils.Get(vD, "name"), Src: uiutils.Get(vD, "image"), Ratio: "4/3"})
@compose.Text(compose.TextProps{Size: "lg", Weight: "semibold", TextProps: text.TextProps{}}) {
{ uiutils.Text(uiutils.Get(vD, "name")) }
}
@compose.Text(compose.TextProps{Size: "sm", TextProps: text.TextProps{Class: "text-muted-foreground"}}) {
{ uiutils.Text(uiutils.Get(vD, "summary")) }
}
@compose.List(compose.ListProps{BoxProps: box.BoxProps{Tag: "ul", Class: "flex flex-col gap-2 text-sm"}}) {
@compose.ListItem(compose.ListItemProps{BoxProps: box.BoxProps{Class: "flex items-center justify-between gap-4"}}) {
@compose.Inline(compose.InlineProps{TextProps: text.TextProps{Class: "text-muted-foreground"}}) {
{ uiutils.Text(uiutils.Get(vLabels, "weight")) }
}
@compose.Inline(compose.InlineProps{TextProps: text.TextProps{Class: "font-semibold"}}) {
{ uiutils.Text(uiutils.Get(vD, "weight")) }
}
}
@compose.ListItem(compose.ListItemProps{BoxProps: box.BoxProps{Class: "flex items-center justify-between gap-4"}}) {
@compose.Inline(compose.InlineProps{TextProps: text.TextProps{Class: "text-muted-foreground"}}) {
{ uiutils.Text(uiutils.Get(vLabels, "heat")) }
}
@compose.Inline(compose.InlineProps{TextProps: text.TextProps{Class: "font-semibold"}}) {
{ uiutils.Text(uiutils.Get(vD, "tag")) }
}
}
@compose.ListItem(compose.ListItemProps{BoxProps: box.BoxProps{Class: "flex items-center justify-between gap-4"}}) {
@compose.Inline(compose.InlineProps{TextProps: text.TextProps{Class: "text-muted-foreground"}}) {
{ uiutils.Text(uiutils.Get(vLabels, "price")) }
}
@compose.Inline(compose.InlineProps{TextProps: text.TextProps{Class: "font-semibold"}}) {
{ uiutils.Text(uiutils.Money(uiutils.Get(vD, "price"), uiutils.Get(vD, "currency"))) }
}
}
}
@compose.Badge(compose.BadgeProps{Variant: "secondary", Size: "default", TextProps: text.TextProps{Class: "w-fit"}}) {
@icons.LucideIcon(icons.LucideIconProps{Name: "timer", Size: 16})
{ uiutils.Text(uiutils.Tpl(uiutils.Get(vLabels, "minutes"), uiutils.Str(uiutils.Get(vD, "minutes")))) }
}
}
}
}
}
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 cut-cards{#- 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/cut-cards.json
The cards layout of DishCompare: one compare card per cut with a picture, the name, the summary, the weight, heat and price as a description list, and the cooking time.
Props (p): dishes, labels. -#}
{%- set v_dishes = (p.dishes ?? null) -%}
{%- set v_labels = (p.labels ?? null) -%}
{%- set c_15 -%}
{%- for v_d in og_l(v_dishes) %}
{%- set c_14 -%}
{{ include('blocks/media-frame.html.twig', {'p': {'alt': og_get(v_d, ['name']), 'src': og_get(v_d, ['image']), 'ratio': '4/3'}}, with_context = false) }}
{%- set c_1 -%}
{{ og_text(og_get(v_d, ['name'])) }}
{%- endset -%}
{{ include('compose/Text.html.twig', {'size': 'lg', 'weight': 'semibold', 'children': c_1}, with_context = false) }}
{%- set c_2 -%}
{{ og_text(og_get(v_d, ['summary'])) }}
{%- endset -%}
{{ include('compose/Text.html.twig', {'size': 'sm', 'class': 'text-muted-foreground', 'children': c_2}, with_context = false) }}
{%- set c_12 -%}
{%- set c_5 -%}
{%- set c_3 -%}
{{ og_text(og_get(v_labels, ['weight'])) }}
{%- endset -%}
{{ include('compose/Inline.html.twig', {'class': 'text-muted-foreground', 'children': c_3}, with_context = false) }}
{%- set c_4 -%}
{{ og_text(og_get(v_d, ['weight'])) }}
{%- endset -%}
{{ include('compose/Inline.html.twig', {'class': 'font-semibold', 'children': c_4}, with_context = false) }}
{%- endset -%}
{{ include('compose/ListItem.html.twig', {'class': 'flex items-center justify-between gap-4', 'children': c_5}, with_context = false) }}
{%- set c_8 -%}
{%- set c_6 -%}
{{ og_text(og_get(v_labels, ['heat'])) }}
{%- endset -%}
{{ include('compose/Inline.html.twig', {'class': 'text-muted-foreground', 'children': c_6}, with_context = false) }}
{%- set c_7 -%}
{{ og_text(og_get(v_d, ['tag'])) }}
{%- endset -%}
{{ include('compose/Inline.html.twig', {'class': 'font-semibold', 'children': c_7}, with_context = false) }}
{%- endset -%}
{{ include('compose/ListItem.html.twig', {'class': 'flex items-center justify-between gap-4', 'children': c_8}, with_context = false) }}
{%- set c_11 -%}
{%- set c_9 -%}
{{ og_text(og_get(v_labels, ['price'])) }}
{%- endset -%}
{{ include('compose/Inline.html.twig', {'class': 'text-muted-foreground', 'children': c_9}, with_context = false) }}
{%- set c_10 -%}
{{ og_text(og_money(og_get(v_d, ['price']), og_get(v_d, ['currency']))) }}
{%- endset -%}
{{ include('compose/Inline.html.twig', {'class': 'font-semibold', 'children': c_10}, with_context = false) }}
{%- endset -%}
{{ include('compose/ListItem.html.twig', {'class': 'flex items-center justify-between gap-4', 'children': c_11}, with_context = false) }}
{%- endset -%}
{{ include('compose/List.html.twig', {'tag': 'ul', 'class': 'flex flex-col gap-2 text-sm', 'children': c_12}, with_context = false) }}
{%- set c_13 -%}
{{ include('icons/LucideIcon.html.twig', {'name': 'timer', 'size': 16}, with_context = false) }}
{{ og_text(og_tpl(og_get(v_labels, ['minutes']), [og_str(og_get(v_d, ['minutes']))])) }}
{%- endset -%}
{{ include('compose/Badge.html.twig', {'variant': 'secondary', 'size': 'default', 'class': 'w-fit', 'children': c_13}, with_context = false) }}
{%- endset -%}
{{ include('compose/Stack.html.twig', {'gap': '4', 'class': 'rounded bg-card inset-ring inset-ring-border p-4', 'attrs': og_attrs(['data-slot', 'item']), 'children': c_14}, with_context = false) }}
{%- endfor %}
{%- endset -%}
{{ include('compose/Grid.html.twig', {'cols': '1-4', 'class': 'gap-4', 'attrs': og_attrs(['data-slot', 'items']), 'children': c_15}, with_context = false) }}
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 cut-cards{* 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/cut-cards.json
The cards layout of DishCompare: one compare card per cut with a picture, the name, the summary, the weight, heat and price as a description list, and the cooking time.
Props (p): dishes, labels. *}
{var $v_dishes = ($p['dishes'] ?? null)}
{var $v_labels = ($p['labels'] ?? null)}
{capture $c_15}
{foreach og_l($v_dishes) as $v_d}
{capture $c_14}
{=og_include('blocks/media-frame.latte', ['p' => ['alt' => og_get($v_d, ['name']), 'src' => og_get($v_d, ['image']), 'ratio' => '4/3']])|noescape}
{capture $c_1}
{=og_text(og_get($v_d, ['name']))}
{/capture}
{=og_include('compose/Text.latte', ['size' => 'lg', 'weight' => 'semibold', 'children' => (string) $c_1])|noescape}
{capture $c_2}
{=og_text(og_get($v_d, ['summary']))}
{/capture}
{=og_include('compose/Text.latte', ['size' => 'sm', 'class' => 'text-muted-foreground', 'children' => (string) $c_2])|noescape}
{capture $c_12}
{capture $c_5}
{capture $c_3}
{=og_text(og_get($v_labels, ['weight']))}
{/capture}
{=og_include('compose/Inline.latte', ['class' => 'text-muted-foreground', 'children' => (string) $c_3])|noescape}
{capture $c_4}
{=og_text(og_get($v_d, ['weight']))}
{/capture}
{=og_include('compose/Inline.latte', ['class' => 'font-semibold', 'children' => (string) $c_4])|noescape}
{/capture}
{=og_include('compose/ListItem.latte', ['class' => 'flex items-center justify-between gap-4', 'children' => (string) $c_5])|noescape}
{capture $c_8}
{capture $c_6}
{=og_text(og_get($v_labels, ['heat']))}
{/capture}
{=og_include('compose/Inline.latte', ['class' => 'text-muted-foreground', 'children' => (string) $c_6])|noescape}
{capture $c_7}
{=og_text(og_get($v_d, ['tag']))}
{/capture}
{=og_include('compose/Inline.latte', ['class' => 'font-semibold', 'children' => (string) $c_7])|noescape}
{/capture}
{=og_include('compose/ListItem.latte', ['class' => 'flex items-center justify-between gap-4', 'children' => (string) $c_8])|noescape}
{capture $c_11}
{capture $c_9}
{=og_text(og_get($v_labels, ['price']))}
{/capture}
{=og_include('compose/Inline.latte', ['class' => 'text-muted-foreground', 'children' => (string) $c_9])|noescape}
{capture $c_10}
{=og_text(og_money(og_get($v_d, ['price']), og_get($v_d, ['currency'])))}
{/capture}
{=og_include('compose/Inline.latte', ['class' => 'font-semibold', 'children' => (string) $c_10])|noescape}
{/capture}
{=og_include('compose/ListItem.latte', ['class' => 'flex items-center justify-between gap-4', 'children' => (string) $c_11])|noescape}
{/capture}
{=og_include('compose/List.latte', ['tag' => 'ul', 'class' => 'flex flex-col gap-2 text-sm', 'children' => (string) $c_12])|noescape}
{capture $c_13}
{=og_include('icons/LucideIcon.latte', ['name' => 'timer', 'size' => 16])|noescape}
{=og_text(og_tpl(og_get($v_labels, ['minutes']), [og_str(og_get($v_d, ['minutes']))]))}
{/capture}
{=og_include('compose/Badge.latte', ['variant' => 'secondary', 'size' => 'default', 'class' => 'w-fit', 'children' => (string) $c_13])|noescape}
{/capture}
{=og_include('compose/Stack.latte', ['gap' => '4', 'class' => 'rounded bg-card inset-ring inset-ring-border p-4', 'attrs' => og_attrs(['data-slot', 'item']), 'children' => (string) $c_14])|noescape}
{/foreach}
{/capture}
{=og_include('compose/Grid.latte', ['cols' => '1-4', 'class' => 'gap-4', 'attrs' => og_attrs(['data-slot', 'items']), 'children' => (string) $c_15])|noescape}
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 cut-cards{#- 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/cut-cards.json
The cards layout of DishCompare: one compare card per cut with a picture, the name, the summary, the weight, heat and price as a description list, and the cooking time.
Props (p): dishes, labels. -#}
{%- set v_dishes = og_def(p['dishes'], none) -%}
{%- set v_labels = og_def(p['labels'], none) -%}
{%- set c_15 -%}
{%- for v_d in og_l(v_dishes) %}
{%- set c_14 -%}
{{ og_include('blocks/media-frame.html.j2', {'p': {'alt': og_get(v_d, ['name']), 'src': og_get(v_d, ['image']), 'ratio': '4/3'}}) }}
{%- set c_1 -%}
{{ og_text(og_get(v_d, ['name'])) }}
{%- endset -%}
{{ og_include('compose/text.html.j2', {'p': {'Size': 'lg', 'Weight': 'semibold'}, 'children': c_1}) }}
{%- set c_2 -%}
{{ og_text(og_get(v_d, ['summary'])) }}
{%- endset -%}
{{ og_include('compose/text.html.j2', {'p': {'Size': 'sm', 'Class': 'text-muted-foreground'}, 'children': c_2}) }}
{%- set c_12 -%}
{%- set c_5 -%}
{%- set c_3 -%}
{{ og_text(og_get(v_labels, ['weight'])) }}
{%- endset -%}
{{ og_include('compose/inline.html.j2', {'p': {'Class': 'text-muted-foreground'}, 'children': c_3}) }}
{%- set c_4 -%}
{{ og_text(og_get(v_d, ['weight'])) }}
{%- endset -%}
{{ og_include('compose/inline.html.j2', {'p': {'Class': 'font-semibold'}, 'children': c_4}) }}
{%- endset -%}
{{ og_include('compose/list-item.html.j2', {'p': {'Class': 'flex items-center justify-between gap-4'}, 'children': c_5}) }}
{%- set c_8 -%}
{%- set c_6 -%}
{{ og_text(og_get(v_labels, ['heat'])) }}
{%- endset -%}
{{ og_include('compose/inline.html.j2', {'p': {'Class': 'text-muted-foreground'}, 'children': c_6}) }}
{%- set c_7 -%}
{{ og_text(og_get(v_d, ['tag'])) }}
{%- endset -%}
{{ og_include('compose/inline.html.j2', {'p': {'Class': 'font-semibold'}, 'children': c_7}) }}
{%- endset -%}
{{ og_include('compose/list-item.html.j2', {'p': {'Class': 'flex items-center justify-between gap-4'}, 'children': c_8}) }}
{%- set c_11 -%}
{%- set c_9 -%}
{{ og_text(og_get(v_labels, ['price'])) }}
{%- endset -%}
{{ og_include('compose/inline.html.j2', {'p': {'Class': 'text-muted-foreground'}, 'children': c_9}) }}
{%- set c_10 -%}
{{ og_text(og_money(og_get(v_d, ['price']), og_get(v_d, ['currency']))) }}
{%- endset -%}
{{ og_include('compose/inline.html.j2', {'p': {'Class': 'font-semibold'}, 'children': c_10}) }}
{%- endset -%}
{{ og_include('compose/list-item.html.j2', {'p': {'Class': 'flex items-center justify-between gap-4'}, 'children': c_11}) }}
{%- endset -%}
{{ og_include('compose/list.html.j2', {'p': {'Tag': 'ul', 'Class': 'flex flex-col gap-2 text-sm'}, 'children': c_12}) }}
{%- set c_13 -%}
{{ og_include('icons/lucide-icon.html.j2', {'p': {'Name': 'timer', 'Size': 16}}) }}
{{ og_text(og_tpl(og_get(v_labels, ['minutes']), [og_str(og_get(v_d, ['minutes']))])) }}
{%- endset -%}
{{ og_include('compose/badge.html.j2', {'p': {'Variant': 'secondary', 'Size': 'default', 'Class': 'w-fit'}, 'children': c_13}) }}
{%- endset -%}
{{ og_include('compose/stack.html.j2', {'p': {'Gap': '4', 'Class': 'rounded bg-card inset-ring inset-ring-border p-4', 'Attrs': og_attrs(['data-slot', 'item'])}, 'children': c_14}) }}
{%- endfor %}
{%- endset -%}
{{ og_include('compose/grid.html.j2', {'p': {'Cols': '1-4', 'Class': 'gap-4', 'Attrs': og_attrs(['data-slot', 'items'])}, 'children': c_15}) }}
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 cards layout of DishCompare: one compare card per cut with a picture, the name, the summary, the weight, heat and price as a description list, and the cooking time.
| Prop | Type | Default | Description |
|---|---|---|---|
| dishes (required) | Dish[] | - | |
| labels (required) | FoodLabels | - |