Skip to content
ui8kit

component / components

Zone Rows

Zone Rows component

Install

npx ui8kit add zone-rows

Pulls in: badge, box, compose, kit-box, kit-text, stack, table, table-body, table-caption, table-cell, table-head, table-head-cell, table-row, text, utils, zone-table

Preview

Delivery price by zone
ZoneDeliveryFree fromTime

Central zone

Old Town, Riverside, Market Square

$12$7590 minutes

Inner suburbs

Northfield, Elm Park, Harbour

$15$1002 hours

Outer towns

Westbrook, Hillside, Lakeview

$19$150Same day

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-cdn
npx ui8kit add zone-rows
components/zone-rows.svelte
<!-- 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 zones as a table (the table layout of ZoneTable): the zone and its areas, the price, free from, the
  minimum order, the time and an express badge.
-->
<script lang="ts" module>
  import type { Snippet } from "svelte";
  import type { Zone, ZoneLabels } from "../blocks/zone-table.types";

  export type ZoneRowsProps = {
    zones: Zone[];
    labels: ZoneLabels;
  };
</script>

<script lang="ts">
  import Badge from "../compose/Badge.svelte";
  import Box from "../compose/Box.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 { fmtMoney } from "../utils";

  let { zones, labels }: ZoneRowsProps = $props();
</script>

<Box class="w-full overflow-x-auto rounded inset-ring inset-ring-border" data-slot="zone-rows">
  <Table class="w-full text-left text-sm" data-slot="zone-table">
    <TableCaption class="sr-only">
      {labels.caption}
    </TableCaption>
    <TableHead class="bg-muted">
      <TableRow>
        <TableHeadCell scope="col" class="px-4 py-2">
          {labels.zone}
        </TableHeadCell>
        <TableHeadCell scope="col" class="py-2">
          {labels.price}
        </TableHeadCell>
        <TableHeadCell scope="col" class="py-2">
          {labels.freeFrom}
        </TableHeadCell>
        <TableHeadCell scope="col" class="hidden py-2 md:table-cell">
          {labels.minOrder}
        </TableHeadCell>
        <TableHeadCell scope="col" class="py-2">
          {labels.time}
        </TableHeadCell>
        <TableHeadCell scope="col" class="hidden py-2 pr-4 sm:table-cell">
          {labels.express}
        </TableHeadCell>
      </TableRow>
    </TableHead>
    <TableBody>
      {#each zones as z (z.id)}
        <TableRow class="border-t border-border" data-slot="item">
          <TableCell class="px-4 py-4">
            <Stack gap="0">
              <Text size="sm" weight="semibold">
                {z.name}
              </Text>
              <Text size="xs" class="text-muted-foreground">
                {z.area}
              </Text>
            </Stack>
          </TableCell>
          <TableCell class="font-medium">
            {fmtMoney(z.price, z.currency)}
          </TableCell>
          <TableCell>
            {fmtMoney(z.freeFrom, z.currency)}
          </TableCell>
          <TableCell class="hidden md:table-cell">
            {fmtMoney(z.minOrder, z.currency)}
          </TableCell>
          <TableCell>
            {z.time}
          </TableCell>
          <TableCell class="hidden pr-4 sm:table-cell">
            {#if z.express}
              <Badge variant="secondary" size="default">
                {z.express}
              </Badge>
            {/if}
          </TableCell>
        </TableRow>
      {/each}
    </TableBody>
  </Table>
</Box>

Svelte registry item (JSON)

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-cdn
npx ui8kit add zone-rows
components/zone-rows.tsx
// 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 zones as a table (the table layout of ZoneTable): the zone and its areas, the price, free from, the
 * minimum order, the time and an express badge.
 */
import { type ReactNode } from "react";
import { Badge, Box, Stack, Table, TableBody, TableCaption, TableCell, TableHead, TableHeadCell, TableRow, Text } from "../compose";
import { fmtMoney } from "../utils";
import type { Zone, ZoneLabels } from "../blocks/zone-table.types";

export type ZoneRowsProps = {
  zones: Zone[];
  labels: ZoneLabels;
};

export function ZoneRows({ zones, labels }: ZoneRowsProps) {
  return (
    <Box className="w-full overflow-x-auto rounded inset-ring inset-ring-border" data-slot="zone-rows">
      <Table className="w-full text-left text-sm" data-slot="zone-table">
        <TableCaption className="sr-only">
          {labels.caption}
        </TableCaption>
        <TableHead className="bg-muted">
          <TableRow>
            <TableHeadCell scope="col" className="px-4 py-2">
              {labels.zone}
            </TableHeadCell>
            <TableHeadCell scope="col" className="py-2">
              {labels.price}
            </TableHeadCell>
            <TableHeadCell scope="col" className="py-2">
              {labels.freeFrom}
            </TableHeadCell>
            <TableHeadCell scope="col" className="hidden py-2 md:table-cell">
              {labels.minOrder}
            </TableHeadCell>
            <TableHeadCell scope="col" className="py-2">
              {labels.time}
            </TableHeadCell>
            <TableHeadCell scope="col" className="hidden py-2 pr-4 sm:table-cell">
              {labels.express}
            </TableHeadCell>
          </TableRow>
        </TableHead>
        <TableBody>
          {(zones ?? []).map((z) => (
            <TableRow key={z.id} className="border-t border-border" data-slot="item">
              <TableCell className="px-4 py-4">
                <Stack gap="0">
                  <Text size="sm" weight="semibold">
                    {z.name}
                  </Text>
                  <Text size="xs" className="text-muted-foreground">
                    {z.area}
                  </Text>
                </Stack>
              </TableCell>
              <TableCell className="font-medium">
                {fmtMoney(z.price, z.currency)}
              </TableCell>
              <TableCell>
                {fmtMoney(z.freeFrom, z.currency)}
              </TableCell>
              <TableCell className="hidden md:table-cell">
                {fmtMoney(z.minOrder, z.currency)}
              </TableCell>
              <TableCell>
                {z.time}
              </TableCell>
              <TableCell className="hidden pr-4 sm:table-cell">
                {z.express ? (
                  <Badge variant="secondary" size="default">
                    {z.express}
                  </Badge>
                ) : null}
              </TableCell>
            </TableRow>
          ))}
        </TableBody>
      </Table>
    </Box>
  );
}

React registry item (JSON)

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-cdn
npx ui8kit add zone-rows
components/zone-rows.vue
<!-- 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 zones as a table (the table layout of ZoneTable): the zone and its areas, the price, free from, the
  minimum order, the time and an express badge.
-->
<script lang="ts">
import type { Zone, ZoneLabels } from "../blocks/zone-table.types";

export type ZoneRowsProps = {
  zones: Zone[];
  labels: ZoneLabels;
};
</script>

<script setup lang="ts">
import Badge from "../compose/Badge.vue";
import Box from "../compose/Box.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 { fmtMoney } from "../utils";

const { zones, labels } = defineProps<ZoneRowsProps>();
</script>

<template>
  <Box class="w-full overflow-x-auto rounded inset-ring inset-ring-border" data-slot="zone-rows">
    <Table class="w-full text-left text-sm" data-slot="zone-table">
      <TableCaption class="sr-only">
        {{ labels.caption }}
      </TableCaption>
      <TableHead class="bg-muted">
        <TableRow>
          <TableHeadCell scope="col" class="px-4 py-2">
            {{ labels.zone }}
          </TableHeadCell>
          <TableHeadCell scope="col" class="py-2">
            {{ labels.price }}
          </TableHeadCell>
          <TableHeadCell scope="col" class="py-2">
            {{ labels.freeFrom }}
          </TableHeadCell>
          <TableHeadCell scope="col" class="hidden py-2 md:table-cell">
            {{ labels.minOrder }}
          </TableHeadCell>
          <TableHeadCell scope="col" class="py-2">
            {{ labels.time }}
          </TableHeadCell>
          <TableHeadCell scope="col" class="hidden py-2 pr-4 sm:table-cell">
            {{ labels.express }}
          </TableHeadCell>
        </TableRow>
      </TableHead>
      <TableBody>
        <TableRow v-for="z in zones" :key="z.id" class="border-t border-border" data-slot="item">
          <TableCell class="px-4 py-4">
            <Stack gap="0">
              <Text size="sm" weight="semibold">
                {{ z.name }}
              </Text>
              <Text size="xs" class="text-muted-foreground">
                {{ z.area }}
              </Text>
            </Stack>
          </TableCell>
          <TableCell class="font-medium">
            {{ fmtMoney(z.price, z.currency) }}
          </TableCell>
          <TableCell>
            {{ fmtMoney(z.freeFrom, z.currency) }}
          </TableCell>
          <TableCell class="hidden md:table-cell">
            {{ fmtMoney(z.minOrder, z.currency) }}
          </TableCell>
          <TableCell>
            {{ z.time }}
          </TableCell>
          <TableCell class="hidden pr-4 sm:table-cell">
            <Badge v-if="z.express" variant="secondary" size="default">
              {{ z.express }}
            </Badge>
          </TableCell>
        </TableRow>
      </TableBody>
    </Table>
  </Box>
</template>

Vue registry item (JSON)

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-cdn
npx ui8kit add zone-rows
components/zone-rows.tsx
// 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 zones as a table (the table layout of ZoneTable): the zone and its areas, the price, free from, the
 * minimum order, the time and an express badge.
 */
import { For, type JSX } from "solid-js";
import { Badge, Box, Stack, Table, TableBody, TableCaption, TableCell, TableHead, TableHeadCell, TableRow, Text } from "../compose";
import { fmtMoney } from "../utils";
import type { Zone, ZoneLabels } from "../blocks/zone-table.types";

export type ZoneRowsProps = {
  zones: Zone[];
  labels: ZoneLabels;
};

export function ZoneRows({ zones, labels }: ZoneRowsProps) {
  return (
    <Box class="w-full overflow-x-auto rounded inset-ring inset-ring-border" data-slot="zone-rows">
      <Table class="w-full text-left text-sm" data-slot="zone-table">
        <TableCaption class="sr-only">
          {labels.caption}
        </TableCaption>
        <TableHead class="bg-muted">
          <TableRow>
            <TableHeadCell scope="col" class="px-4 py-2">
              {labels.zone}
            </TableHeadCell>
            <TableHeadCell scope="col" class="py-2">
              {labels.price}
            </TableHeadCell>
            <TableHeadCell scope="col" class="py-2">
              {labels.freeFrom}
            </TableHeadCell>
            <TableHeadCell scope="col" class="hidden py-2 md:table-cell">
              {labels.minOrder}
            </TableHeadCell>
            <TableHeadCell scope="col" class="py-2">
              {labels.time}
            </TableHeadCell>
            <TableHeadCell scope="col" class="hidden py-2 pr-4 sm:table-cell">
              {labels.express}
            </TableHeadCell>
          </TableRow>
        </TableHead>
        <TableBody>
          <For each={zones ?? []}>{(z) => (
            <TableRow class="border-t border-border" data-slot="item">
              <TableCell class="px-4 py-4">
                <Stack gap="0">
                  <Text size="sm" weight="semibold">
                    {z.name}
                  </Text>
                  <Text size="xs" class="text-muted-foreground">
                    {z.area}
                  </Text>
                </Stack>
              </TableCell>
              <TableCell class="font-medium">
                {fmtMoney(z.price, z.currency)}
              </TableCell>
              <TableCell>
                {fmtMoney(z.freeFrom, z.currency)}
              </TableCell>
              <TableCell class="hidden md:table-cell">
                {fmtMoney(z.minOrder, z.currency)}
              </TableCell>
              <TableCell>
                {z.time}
              </TableCell>
              <TableCell class="hidden pr-4 sm:table-cell">
                {z.express ? (
                  <Badge variant="secondary" size="default">
                    {z.express}
                  </Badge>
                ) : null}
              </TableCell>
            </TableRow>
          )}</For>
        </TableBody>
      </Table>
    </Box>
  );
}

Solid registry item (JSON)

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-cdn
npx ui8kit add zone-rows
blocks/zone-rows.templ
// 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/zone-rows.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/ui/text"
	uiutils "github.com/ui8kit/codegen/generated/templ/orgutils"
)

// ZoneRowsProps are the props of ZoneRows; the values are the JSON shapes of the TypeScript props.
type ZoneRowsProps struct {
	Zones any `json:"zones"`
	Labels any `json:"labels"`
}

// The zones as a table (the table layout of ZoneTable): the zone and its areas, the price, free from, the minimum order, the time and an express badge.
templ ZoneRows(p ZoneRowsProps) {
	{{ vZones := p.Zones }}
	{{ vLabels := p.Labels }}
	@compose.Box(compose.BoxProps{BoxProps: box.BoxProps{Class: "w-full overflow-x-auto rounded inset-ring inset-ring-border", Attrs: uiutils.Attrs("data-slot", "zone-rows")}}) {
		@compose.Table(compose.TableProps{BoxProps: box.BoxProps{Class: "w-full text-left text-sm", Attrs: uiutils.Attrs("data-slot", "zone-table")}}) {
			@compose.TableCaption(compose.TableCaptionProps{BoxProps: box.BoxProps{Class: "sr-only"}}) {
				{ uiutils.Text(uiutils.Get(vLabels, "caption")) }
			}
			@compose.TableHead(compose.TableHeadProps{BoxProps: box.BoxProps{Class: "bg-muted"}}) {
				@compose.TableRow(compose.TableRowProps{BoxProps: box.BoxProps{}}) {
					@compose.TableHeadCell(compose.TableHeadCellProps{BoxProps: box.BoxProps{Class: "px-4 py-2", Attrs: uiutils.Attrs("scope", "col")}}) {
						{ uiutils.Text(uiutils.Get(vLabels, "zone")) }
					}
					@compose.TableHeadCell(compose.TableHeadCellProps{BoxProps: box.BoxProps{Class: "py-2", 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, "freeFrom")) }
					}
					@compose.TableHeadCell(compose.TableHeadCellProps{BoxProps: box.BoxProps{Class: "hidden py-2 md:table-cell", Attrs: uiutils.Attrs("scope", "col")}}) {
						{ uiutils.Text(uiutils.Get(vLabels, "minOrder")) }
					}
					@compose.TableHeadCell(compose.TableHeadCellProps{BoxProps: box.BoxProps{Class: "py-2", Attrs: uiutils.Attrs("scope", "col")}}) {
						{ uiutils.Text(uiutils.Get(vLabels, "time")) }
					}
					@compose.TableHeadCell(compose.TableHeadCellProps{BoxProps: box.BoxProps{Class: "hidden py-2 pr-4 sm:table-cell", Attrs: uiutils.Attrs("scope", "col")}}) {
						{ uiutils.Text(uiutils.Get(vLabels, "express")) }
					}
				}
			}
			@compose.TableBody(compose.TableBodyProps{BoxProps: box.BoxProps{}}) {
				for _, vZ := range uiutils.L(vZones) {
					@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: "px-4 py-4"}}) {
							@compose.Stack(compose.StackProps{Gap: "0", BoxProps: box.BoxProps{}}) {
								@compose.Text(compose.TextProps{Size: "sm", Weight: "semibold", TextProps: text.TextProps{}}) {
									{ uiutils.Text(uiutils.Get(vZ, "name")) }
								}
								@compose.Text(compose.TextProps{Size: "xs", TextProps: text.TextProps{Class: "text-muted-foreground"}}) {
									{ uiutils.Text(uiutils.Get(vZ, "area")) }
								}
							}
						}
						@compose.TableCell(compose.TableCellProps{BoxProps: box.BoxProps{Class: "font-medium"}}) {
							{ uiutils.Text(uiutils.Money(uiutils.Get(vZ, "price"), uiutils.Get(vZ, "currency"))) }
						}
						@compose.TableCell(compose.TableCellProps{BoxProps: box.BoxProps{}}) {
							{ uiutils.Text(uiutils.Money(uiutils.Get(vZ, "freeFrom"), uiutils.Get(vZ, "currency"))) }
						}
						@compose.TableCell(compose.TableCellProps{BoxProps: box.BoxProps{Class: "hidden md:table-cell"}}) {
							{ uiutils.Text(uiutils.Money(uiutils.Get(vZ, "minOrder"), uiutils.Get(vZ, "currency"))) }
						}
						@compose.TableCell(compose.TableCellProps{BoxProps: box.BoxProps{}}) {
							{ uiutils.Text(uiutils.Get(vZ, "time")) }
						}
						@compose.TableCell(compose.TableCellProps{BoxProps: box.BoxProps{Class: "hidden pr-4 sm:table-cell"}}) {
							if uiutils.T(uiutils.Get(vZ, "express")) {
								@compose.Badge(compose.BadgeProps{Variant: "secondary", Size: "default", TextProps: text.TextProps{}}) {
									{ uiutils.Text(uiutils.Get(vZ, "express")) }
								}
							}
						}
					}
				}
			}
		}
	}
}

templ registry item (JSON)

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-cdn
npx ui8kit add zone-rows
blocks/zone-rows.html.twig
{#- 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/zone-rows.json
    The zones as a table (the table layout of ZoneTable): the zone and its areas, the price, free from, the minimum order, the time and an express badge.
    Props (p): zones, labels. -#}
{%- set v_zones = (p.zones ?? null) -%}
{%- set v_labels = (p.labels ?? null) -%}
{%- 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, ['zone'])) }}
        {%- endset -%}
        {{ include('compose/TableHeadCell.html.twig', {'class': 'px-4 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': 'py-2', 'attrs': og_attrs(['scope', 'col']), 'children': c_3}, with_context = false) }}
        {%- set c_4 -%}
          {{ og_text(og_get(v_labels, ['freeFrom'])) }}
        {%- 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, ['minOrder'])) }}
        {%- endset -%}
        {{ include('compose/TableHeadCell.html.twig', {'class': 'hidden py-2 md:table-cell', 'attrs': og_attrs(['scope', 'col']), 'children': c_5}, with_context = false) }}
        {%- set c_6 -%}
          {{ og_text(og_get(v_labels, ['time'])) }}
        {%- endset -%}
        {{ include('compose/TableHeadCell.html.twig', {'class': 'py-2', 'attrs': og_attrs(['scope', 'col']), 'children': c_6}, with_context = false) }}
        {%- set c_7 -%}
          {{ og_text(og_get(v_labels, ['express'])) }}
        {%- endset -%}
        {{ include('compose/TableHeadCell.html.twig', {'class': 'hidden py-2 pr-4 sm:table-cell', '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', {'class': 'bg-muted', 'children': c_9}, with_context = false) }}
    {%- set c_21 -%}
      {%- for v_z in og_l(v_zones) %}
        {%- set c_20 -%}
          {%- set c_13 -%}
            {%- set c_12 -%}
              {%- set c_10 -%}
                {{ og_text(og_get(v_z, ['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_z, ['area'])) }}
              {%- 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/TableCell.html.twig', {'class': 'px-4 py-4', 'children': c_13}, with_context = false) }}
          {%- set c_14 -%}
            {{ og_text(og_money(og_get(v_z, ['price']), og_get(v_z, ['currency']))) }}
          {%- endset -%}
          {{ include('compose/TableCell.html.twig', {'class': 'font-medium', 'children': c_14}, with_context = false) }}
          {%- set c_15 -%}
            {{ og_text(og_money(og_get(v_z, ['freeFrom']), og_get(v_z, ['currency']))) }}
          {%- endset -%}
          {{ include('compose/TableCell.html.twig', {'children': c_15}, with_context = false) }}
          {%- set c_16 -%}
            {{ og_text(og_money(og_get(v_z, ['minOrder']), og_get(v_z, ['currency']))) }}
          {%- endset -%}
          {{ include('compose/TableCell.html.twig', {'class': 'hidden md:table-cell', 'children': c_16}, with_context = false) }}
          {%- set c_17 -%}
            {{ og_text(og_get(v_z, ['time'])) }}
          {%- endset -%}
          {{ include('compose/TableCell.html.twig', {'children': c_17}, with_context = false) }}
          {%- set c_19 -%}
            {%- if og_t(og_get(v_z, ['express'])) %}
              {%- set c_18 -%}
                {{ og_text(og_get(v_z, ['express'])) }}
              {%- endset -%}
              {{ include('compose/Badge.html.twig', {'variant': 'secondary', 'size': 'default', 'children': c_18}, with_context = false) }}
            {%- endif %}
          {%- endset -%}
          {{ include('compose/TableCell.html.twig', {'class': 'hidden pr-4 sm:table-cell', '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', 'zone-table']), 'children': c_22}, with_context = false) }}
{%- endset -%}
{{ include('compose/Box.html.twig', {'class': 'w-full overflow-x-auto rounded inset-ring inset-ring-border', 'attrs': og_attrs(['data-slot', 'zone-rows']), 'children': c_23}, with_context = false) }}

Twig registry item (JSON)

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-cdn
npx ui8kit add zone-rows
blocks/zone-rows.latte
{* 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/zone-rows.json
    The zones as a table (the table layout of ZoneTable): the zone and its areas, the price, free from, the minimum order, the time and an express badge.
    Props (p): zones, labels. *}
{var $v_zones = ($p['zones'] ?? null)}
{var $v_labels = ($p['labels'] ?? null)}
{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, ['zone']))}
        {/capture}
        {=og_include('compose/TableHeadCell.latte', ['class' => 'px-4 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' => 'py-2', 'attrs' => og_attrs(['scope', 'col']), 'children' => (string) $c_3])|noescape}
        {capture $c_4}
          {=og_text(og_get($v_labels, ['freeFrom']))}
        {/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, ['minOrder']))}
        {/capture}
        {=og_include('compose/TableHeadCell.latte', ['class' => 'hidden py-2 md:table-cell', 'attrs' => og_attrs(['scope', 'col']), 'children' => (string) $c_5])|noescape}
        {capture $c_6}
          {=og_text(og_get($v_labels, ['time']))}
        {/capture}
        {=og_include('compose/TableHeadCell.latte', ['class' => 'py-2', 'attrs' => og_attrs(['scope', 'col']), 'children' => (string) $c_6])|noescape}
        {capture $c_7}
          {=og_text(og_get($v_labels, ['express']))}
        {/capture}
        {=og_include('compose/TableHeadCell.latte', ['class' => 'hidden py-2 pr-4 sm:table-cell', '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', ['class' => 'bg-muted', 'children' => (string) $c_9])|noescape}
    {capture $c_21}
      {foreach og_l($v_zones) as $v_z}
        {capture $c_20}
          {capture $c_13}
            {capture $c_12}
              {capture $c_10}
                {=og_text(og_get($v_z, ['name']))}
              {/capture}
              {=og_include('compose/Text.latte', ['size' => 'sm', 'weight' => 'semibold', 'children' => (string) $c_10])|noescape}
              {capture $c_11}
                {=og_text(og_get($v_z, ['area']))}
              {/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/TableCell.latte', ['class' => 'px-4 py-4', 'children' => (string) $c_13])|noescape}
          {capture $c_14}
            {=og_text(og_money(og_get($v_z, ['price']), og_get($v_z, ['currency'])))}
          {/capture}
          {=og_include('compose/TableCell.latte', ['class' => 'font-medium', 'children' => (string) $c_14])|noescape}
          {capture $c_15}
            {=og_text(og_money(og_get($v_z, ['freeFrom']), og_get($v_z, ['currency'])))}
          {/capture}
          {=og_include('compose/TableCell.latte', ['children' => (string) $c_15])|noescape}
          {capture $c_16}
            {=og_text(og_money(og_get($v_z, ['minOrder']), og_get($v_z, ['currency'])))}
          {/capture}
          {=og_include('compose/TableCell.latte', ['class' => 'hidden md:table-cell', 'children' => (string) $c_16])|noescape}
          {capture $c_17}
            {=og_text(og_get($v_z, ['time']))}
          {/capture}
          {=og_include('compose/TableCell.latte', ['children' => (string) $c_17])|noescape}
          {capture $c_19}
            {if og_t(og_get($v_z, ['express']))}
              {capture $c_18}
                {=og_text(og_get($v_z, ['express']))}
              {/capture}
              {=og_include('compose/Badge.latte', ['variant' => 'secondary', 'size' => 'default', 'children' => (string) $c_18])|noescape}
            {/if}
          {/capture}
          {=og_include('compose/TableCell.latte', ['class' => 'hidden pr-4 sm:table-cell', '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', 'zone-table']), 'children' => (string) $c_22])|noescape}
{/capture}
{=og_include('compose/Box.latte', ['class' => 'w-full overflow-x-auto rounded inset-ring inset-ring-border', 'attrs' => og_attrs(['data-slot', 'zone-rows']), 'children' => (string) $c_23])|noescape}

Latte registry item (JSON)

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-cdn
npx ui8kit add zone-rows
blocks/zone-rows.html.j2
{#- 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/zone-rows.json
    The zones as a table (the table layout of ZoneTable): the zone and its areas, the price, free from, the minimum order, the time and an express badge.
    Props (p): zones, labels. -#}
{%- set v_zones = og_def(p['zones'], none) -%}
{%- set v_labels = og_def(p['labels'], none) -%}
{%- 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, ['zone'])) }}
        {%- endset -%}
        {{ og_include('compose/table-head-cell.html.j2', {'p': {'Class': 'px-4 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': 'py-2', 'Attrs': og_attrs(['scope', 'col'])}, 'children': c_3}) }}
        {%- set c_4 -%}
          {{ og_text(og_get(v_labels, ['freeFrom'])) }}
        {%- 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, ['minOrder'])) }}
        {%- endset -%}
        {{ og_include('compose/table-head-cell.html.j2', {'p': {'Class': 'hidden py-2 md:table-cell', 'Attrs': og_attrs(['scope', 'col'])}, 'children': c_5}) }}
        {%- set c_6 -%}
          {{ og_text(og_get(v_labels, ['time'])) }}
        {%- endset -%}
        {{ og_include('compose/table-head-cell.html.j2', {'p': {'Class': 'py-2', 'Attrs': og_attrs(['scope', 'col'])}, 'children': c_6}) }}
        {%- set c_7 -%}
          {{ og_text(og_get(v_labels, ['express'])) }}
        {%- endset -%}
        {{ og_include('compose/table-head-cell.html.j2', {'p': {'Class': 'hidden py-2 pr-4 sm:table-cell', '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': {'Class': 'bg-muted'}, 'children': c_9}) }}
    {%- set c_21 -%}
      {%- for v_z in og_l(v_zones) %}
        {%- set c_20 -%}
          {%- set c_13 -%}
            {%- set c_12 -%}
              {%- set c_10 -%}
                {{ og_text(og_get(v_z, ['name'])) }}
              {%- endset -%}
              {{ og_include('compose/text.html.j2', {'p': {'Size': 'sm', 'Weight': 'semibold'}, 'children': c_10}) }}
              {%- set c_11 -%}
                {{ og_text(og_get(v_z, ['area'])) }}
              {%- 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/table-cell.html.j2', {'p': {'Class': 'px-4 py-4'}, 'children': c_13}) }}
          {%- set c_14 -%}
            {{ og_text(og_money(og_get(v_z, ['price']), og_get(v_z, ['currency']))) }}
          {%- endset -%}
          {{ og_include('compose/table-cell.html.j2', {'p': {'Class': 'font-medium'}, 'children': c_14}) }}
          {%- set c_15 -%}
            {{ og_text(og_money(og_get(v_z, ['freeFrom']), og_get(v_z, ['currency']))) }}
          {%- endset -%}
          {{ og_include('compose/table-cell.html.j2', {'p': {}, 'children': c_15}) }}
          {%- set c_16 -%}
            {{ og_text(og_money(og_get(v_z, ['minOrder']), og_get(v_z, ['currency']))) }}
          {%- endset -%}
          {{ og_include('compose/table-cell.html.j2', {'p': {'Class': 'hidden md:table-cell'}, 'children': c_16}) }}
          {%- set c_17 -%}
            {{ og_text(og_get(v_z, ['time'])) }}
          {%- endset -%}
          {{ og_include('compose/table-cell.html.j2', {'p': {}, 'children': c_17}) }}
          {%- set c_19 -%}
            {%- if og_t(og_get(v_z, ['express'])) %}
              {%- set c_18 -%}
                {{ og_text(og_get(v_z, ['express'])) }}
              {%- endset -%}
              {{ og_include('compose/badge.html.j2', {'p': {'Variant': 'secondary', 'Size': 'default'}, 'children': c_18}) }}
            {%- endif %}
          {%- endset -%}
          {{ og_include('compose/table-cell.html.j2', {'p': {'Class': 'hidden pr-4 sm:table-cell'}, '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', 'zone-table'])}, 'children': c_22}) }}
{%- endset -%}
{{ og_include('compose/box.html.j2', {'p': {'Class': 'w-full overflow-x-auto rounded inset-ring inset-ring-border', 'Attrs': og_attrs(['data-slot', 'zone-rows'])}, 'children': c_23}) }}

Jinja2 registry item (JSON)

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 zones as a table (the table layout of ZoneTable): the zone and its areas, the price, free from, the minimum order, the time and an express badge.

Props of ZoneRows
PropTypeDefault Description
zones (required)Zone[]-
labels (required)ZoneLabels-

Used in