Skip to content
ui8kit

block / commerce

Store Locations

The stores with address, hours, phone and services.

Install

npx ui8kit add store-locations

Pulls in: badge, box, compose, empty-state, group, inline, kit-box, kit-link, kit-text, link, list, list-item, lucide-icon, media-frame, section-frame, stack, text, title, utils

Preview

Stores and pickup

Pick up an order in thirty minutes or visit a showroom.

Pickup

Market Street

Five minutes from Central station

Pickup in 30 minutesGift wrappingRepairs
Pickup

Harbour Road

Parking at the back

Pickup in 30 minutesParking
Store only

Hillside Mall

Inside the mall, next to the food court

ShowroomParking
Pickup

North Depot

Delivery hub with a pickup desk

Delivery hubReturns desk

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 store-locations
blocks/store-locations.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 stores of a shop: name, a badge of its kind (pickup or store only), address, hours, phone, a note and the
  services. Axes: layout (cards, list: one row per store, map: compact cards beside a map picture), tone.
-->
<script lang="ts" module>
  import type { Snippet } from "svelte";
  import type { Store, StoreLabels } from "./store-locations.types";

  export type StoreLocationsProps = {
    id: string;
    title: string;
    lead?: string;
    stores: Store[];
    empty?: string;
    kinds: Record<string, string>;
    labels: StoreLabels;
    layout?: "cards" | "list" | "map";
    tone?: "default" | "muted";
    landmarkLabel?: string;
  };
</script>

<script lang="ts">
  import Badge from "../compose/Badge.svelte";
  import Box from "../compose/Box.svelte";
  import Group from "../compose/Group.svelte";
  import Inline from "../compose/Inline.svelte";
  import Link from "../compose/Link.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 Title from "../compose/Title.svelte";
  import EmptyState from "../components/empty-state.svelte";
  import MediaFrame from "../components/media-frame.svelte";
  import SectionFrame from "../components/section-frame.svelte";
  import { at, cn, tpl, urlOf } from "../utils";

  let {
    id,
    title,
    lead = "",
    stores,
    empty = "",
    kinds,
    labels,
    layout = "cards",
    tone = "default",
    landmarkLabel,
  }: StoreLocationsProps = $props();
</script>

<SectionFrame id={id} title={title} lead={lead} tone={tone} landmarkLabel={landmarkLabel}>
  {#if ((stores?.length ?? 0) === 0)}
    <EmptyState icon="store" title={empty} />
  {:else}
    <Box
      class={cn(
        "grid grid-cols-1 gap-8",
        (((layout as string) === "map") ? "items-start md:grid-cols-2" : "")
      )}
    >
      <Box
        class={
          (layout as string) === "cards" ? "grid grid-cols-1 gap-4 md:grid-cols-2"
          : "flex flex-col gap-4"
        }
        data-slot="items"
      >
        {#each stores as s (s.id)}
          <Stack
            gap="4"
            class={
              (layout as string) === "list" ? "border-b border-border pb-4"
              : "rounded bg-card inset-ring inset-ring-border p-6"
            }
            data-slot="item"
          >
            <Stack gap="2">
              <Badge variant="outline" size="default" class="w-fit">
                {at(kinds, s.kind)}
              </Badge>
              <Title as={3} size="lg" weight="bold">
                {s.name}
              </Title>
            </Stack>
            <List
              tag="ul"
              class={
                (layout as string) === "list" ? "flex flex-wrap gap-x-8 gap-y-2 text-sm"
                : "flex flex-col gap-2 text-sm"
              }
            >
              <ListItem class="flex items-center gap-2">
                <LucideIcon name="map-pin" size={16} />
                <Inline>
                  {s.address}
                </Inline>
              </ListItem>
              <ListItem class="flex items-center gap-2">
                <LucideIcon name="clock" size={16} />
                <Inline>
                  {s.hours}
                </Inline>
              </ListItem>
              <ListItem class="flex items-center gap-2">
                <LucideIcon name="phone" size={16} />
                <Link href={urlOf(tpl("tel:{0}", s.phone))} variant="default">
                  {(s.phone ?? "").replaceAll(" ", "\u00a0")}
                </Link>
              </ListItem>
            </List>
            {#if ((layout as string) === "cards")}
              <Text size="sm" class="text-muted-foreground">
                {s.note}
              </Text>
              <Group gap="2" class="flex-wrap">
                {#each s.services as v (v)}
                  <Badge variant="secondary" size="default">
                    {v}
                  </Badge>
                {/each}
              </Group>
            {/if}
          </Stack>
        {/each}
      </Box>
      {#if ((layout as string) === "map")}
        <Box class="md:sticky md:top-8">
          <MediaFrame alt={labels.map} ratio="1/1" />
        </Box>
      {/if}
    </Box>
  {/if}
</SectionFrame>
blocks/store-locations.types.ts
// Code generated by packages/kit-compose/src/organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT.

export type Store = {
  id: string;
  name: string;
  kind: string;
  address: string;
  hours: string;
  phone: string;
  note: string;
  services: string[];
};

export type StoreLabels = {
  map: string;
};

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 store-locations
blocks/store-locations.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 stores of a shop: name, a badge of its kind (pickup or store only), address, hours, phone, a note and the
 * services. Axes: layout (cards, list: one row per store, map: compact cards beside a map picture), tone.
 */
import { type ReactNode } from "react";
import { Badge, Box, Group, Inline, Link, List, ListItem, Stack, Text, Title } from "../compose";
import { LucideIcon } from "../icons/LucideIcon";
import { EmptyState } from "../components/empty-state";
import { MediaFrame } from "../components/media-frame";
import { SectionFrame } from "../components/section-frame";
import { at, cn, tpl, urlOf } from "../utils";
import type { Store, StoreLabels } from "./store-locations.types";

export type StoreLocationsProps = {
  id: string;
  title: string;
  lead?: string;
  stores: Store[];
  empty?: string;
  kinds: Record<string, string>;
  labels: StoreLabels;
  layout?: "cards" | "list" | "map";
  tone?: "default" | "muted";
  landmarkLabel?: string;
};

export function StoreLocations({
  id,
  title,
  lead = "",
  stores,
  empty = "",
  kinds,
  labels,
  layout = "cards",
  tone = "default",
  landmarkLabel,
}: StoreLocationsProps) {
  return (
    <SectionFrame id={id} title={title} lead={lead} tone={tone} landmarkLabel={landmarkLabel}>
      {((stores?.length ?? 0) === 0) ? (
        <EmptyState icon="store" title={empty} />
      ) : (
        <Box
          className={cn(
            "grid grid-cols-1 gap-8",
            (((layout as string) === "map") ? "items-start md:grid-cols-2" : "")
          )}
        >
          <Box
            className={
              (layout as string) === "cards" ? "grid grid-cols-1 gap-4 md:grid-cols-2"
              : "flex flex-col gap-4"
            }
            data-slot="items"
          >
            {(stores ?? []).map((s) => (
              <Stack key={s.id}
                gap="4"
                className={
                  (layout as string) === "list" ? "border-b border-border pb-4"
                  : "rounded bg-card inset-ring inset-ring-border p-6"
                }
                data-slot="item"
              >
                <Stack gap="2">
                  <Badge variant="outline" size="default" className="w-fit">
                    {at(kinds, s.kind)}
                  </Badge>
                  <Title as={3} size="lg" weight="bold">
                    {s.name}
                  </Title>
                </Stack>
                <List
                  tag="ul"
                  className={
                    (layout as string) === "list" ? "flex flex-wrap gap-x-8 gap-y-2 text-sm"
                    : "flex flex-col gap-2 text-sm"
                  }
                >
                  <ListItem className="flex items-center gap-2">
                    <LucideIcon name="map-pin" size={16} />
                    <Inline>
                      {s.address}
                    </Inline>
                  </ListItem>
                  <ListItem className="flex items-center gap-2">
                    <LucideIcon name="clock" size={16} />
                    <Inline>
                      {s.hours}
                    </Inline>
                  </ListItem>
                  <ListItem className="flex items-center gap-2">
                    <LucideIcon name="phone" size={16} />
                    <Link href={urlOf(tpl("tel:{0}", s.phone))} variant="default">
                      {(s.phone ?? "").replaceAll(" ", "\u00a0")}
                    </Link>
                  </ListItem>
                </List>
                {((layout as string) === "cards") ? (
                  <>
                    <Text size="sm" className="text-muted-foreground">
                      {s.note}
                    </Text>
                    <Group gap="2" className="flex-wrap">
                      {(s.services ?? []).map((v) => (
                        <Badge key={v} variant="secondary" size="default">
                          {v}
                        </Badge>
                      ))}
                    </Group>
                  </>
                ) : null}
              </Stack>
            ))}
          </Box>
          {((layout as string) === "map") ? (
            <Box className="md:sticky md:top-8">
              <MediaFrame alt={labels.map} ratio="1/1" />
            </Box>
          ) : null}
        </Box>
      )}
    </SectionFrame>
  );
}
blocks/store-locations.types.ts
// Code generated by packages/kit-compose/src/organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT.

export type Store = {
  id: string;
  name: string;
  kind: string;
  address: string;
  hours: string;
  phone: string;
  note: string;
  services: string[];
};

export type StoreLabels = {
  map: string;
};

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 store-locations
blocks/store-locations.types.ts
// Code generated by packages/kit-compose/src/organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT.

export type Store = {
  id: string;
  name: string;
  kind: string;
  address: string;
  hours: string;
  phone: string;
  note: string;
  services: string[];
};

export type StoreLabels = {
  map: string;
};
blocks/store-locations.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 stores of a shop: name, a badge of its kind (pickup or store only), address, hours, phone, a note and the
  services. Axes: layout (cards, list: one row per store, map: compact cards beside a map picture), tone.
-->
<script lang="ts">
import type { Store, StoreLabels } from "./store-locations.types";

export type StoreLocationsProps = {
  id: string;
  title: string;
  lead?: string;
  stores: Store[];
  empty?: string;
  kinds: Record<string, string>;
  labels: StoreLabels;
  layout?: "cards" | "list" | "map";
  tone?: "default" | "muted";
  landmarkLabel?: string;
};
</script>

<script setup lang="ts">
import Badge from "../compose/Badge.vue";
import Box from "../compose/Box.vue";
import Group from "../compose/Group.vue";
import Inline from "../compose/Inline.vue";
import Link from "../compose/Link.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 Title from "../compose/Title.vue";
import EmptyState from "../components/empty-state.vue";
import MediaFrame from "../components/media-frame.vue";
import SectionFrame from "../components/section-frame.vue";
import { at, cn, tpl, urlOf } from "../utils";

const {
  id,
  title,
  lead = "",
  stores,
  empty = "",
  kinds,
  labels,
  layout = "cards",
  tone = "default",
  landmarkLabel,
} = defineProps<StoreLocationsProps>();
</script>

<template>
  <SectionFrame :id="id" :title="title" :lead="lead" :tone="tone" :landmarkLabel="landmarkLabel">
    <EmptyState v-if="((stores?.length ?? 0) === 0)" icon="store" :title="empty" />
    <Box v-else
      :class="cn(
        'grid grid-cols-1 gap-8',
        (((layout as string) === 'map') ? 'items-start md:grid-cols-2' : '')
      )"
    >
      <Box
        :class="
          (layout as string) === 'cards' ? 'grid grid-cols-1 gap-4 md:grid-cols-2'
          : 'flex flex-col gap-4'
        "
        data-slot="items"
      >
        <Stack v-for="s in stores" :key="s.id"
          gap="4"
          :class="
            (layout as string) === 'list' ? 'border-b border-border pb-4'
            : 'rounded bg-card inset-ring inset-ring-border p-6'
          "
          data-slot="item"
        >
          <Stack gap="2">
            <Badge variant="outline" size="default" class="w-fit">
              {{ at(kinds, s.kind) }}
            </Badge>
            <Title :as="3" size="lg" weight="bold">
              {{ s.name }}
            </Title>
          </Stack>
          <List
            tag="ul"
            :class="
              (layout as string) === 'list' ? 'flex flex-wrap gap-x-8 gap-y-2 text-sm'
              : 'flex flex-col gap-2 text-sm'
            "
          >
            <ListItem class="flex items-center gap-2">
              <LucideIcon name="map-pin" :size="16" />
              <Inline>
                {{ s.address }}
              </Inline>
            </ListItem>
            <ListItem class="flex items-center gap-2">
              <LucideIcon name="clock" :size="16" />
              <Inline>
                {{ s.hours }}
              </Inline>
            </ListItem>
            <ListItem class="flex items-center gap-2">
              <LucideIcon name="phone" :size="16" />
              <Link :href="urlOf(tpl('tel:{0}', s.phone))" variant="default">
                {{ (s.phone ?? "").replaceAll(" ", "\u00a0") }}
              </Link>
            </ListItem>
          </List>
          <template v-if="((layout as string) === 'cards')">
            <Text size="sm" class="text-muted-foreground">
              {{ s.note }}
            </Text>
            <Group gap="2" class="flex-wrap">
              <Badge v-for="v in s.services" :key="v" variant="secondary" size="default">
                {{ v }}
              </Badge>
            </Group>
          </template>
        </Stack>
      </Box>
      <Box v-if="((layout as string) === 'map')" class="md:sticky md:top-8">
        <MediaFrame :alt="labels.map" ratio="1/1" />
      </Box>
    </Box>
  </SectionFrame>
</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 store-locations
blocks/store-locations.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 stores of a shop: name, a badge of its kind (pickup or store only), address, hours, phone, a note and the
 * services. Axes: layout (cards, list: one row per store, map: compact cards beside a map picture), tone.
 */
import { For, type JSX } from "solid-js";
import { Badge, Box, Group, Inline, Link, List, ListItem, Stack, Text, Title } from "../compose";
import { LucideIcon } from "../icons/LucideIcon";
import { EmptyState } from "../components/empty-state";
import { MediaFrame } from "../components/media-frame";
import { SectionFrame } from "../components/section-frame";
import { at, cn, tpl, urlOf } from "../utils";
import type { Store, StoreLabels } from "./store-locations.types";

export type StoreLocationsProps = {
  id: string;
  title: string;
  lead?: string;
  stores: Store[];
  empty?: string;
  kinds: Record<string, string>;
  labels: StoreLabels;
  layout?: "cards" | "list" | "map";
  tone?: "default" | "muted";
  landmarkLabel?: string;
};

export function StoreLocations({
  id,
  title,
  lead = "",
  stores,
  empty = "",
  kinds,
  labels,
  layout = "cards",
  tone = "default",
  landmarkLabel,
}: StoreLocationsProps) {
  return (
    <SectionFrame id={id} title={title} lead={lead} tone={tone} landmarkLabel={landmarkLabel}>
      {((stores?.length ?? 0) === 0) ? (
        <EmptyState icon="store" title={empty} />
      ) : (
        <Box
          class={cn(
            "grid grid-cols-1 gap-8",
            (((layout as string) === "map") ? "items-start md:grid-cols-2" : "")
          )}
        >
          <Box
            class={
              (layout as string) === "cards" ? "grid grid-cols-1 gap-4 md:grid-cols-2"
              : "flex flex-col gap-4"
            }
            data-slot="items"
          >
            <For each={stores ?? []}>{(s) => (
              <Stack
                gap="4"
                class={
                  (layout as string) === "list" ? "border-b border-border pb-4"
                  : "rounded bg-card inset-ring inset-ring-border p-6"
                }
                data-slot="item"
              >
                <Stack gap="2">
                  <Badge variant="outline" size="default" class="w-fit">
                    {at(kinds, s.kind)}
                  </Badge>
                  <Title as={3} size="lg" weight="bold">
                    {s.name}
                  </Title>
                </Stack>
                <List
                  tag="ul"
                  class={
                    (layout as string) === "list" ? "flex flex-wrap gap-x-8 gap-y-2 text-sm"
                    : "flex flex-col gap-2 text-sm"
                  }
                >
                  <ListItem class="flex items-center gap-2">
                    <LucideIcon name="map-pin" size={16} />
                    <Inline>
                      {s.address}
                    </Inline>
                  </ListItem>
                  <ListItem class="flex items-center gap-2">
                    <LucideIcon name="clock" size={16} />
                    <Inline>
                      {s.hours}
                    </Inline>
                  </ListItem>
                  <ListItem class="flex items-center gap-2">
                    <LucideIcon name="phone" size={16} />
                    <Link href={urlOf(tpl("tel:{0}", s.phone))} variant="default">
                      {(s.phone ?? "").replaceAll(" ", "\u00a0")}
                    </Link>
                  </ListItem>
                </List>
                {((layout as string) === "cards") ? (
                  <>
                    <Text size="sm" class="text-muted-foreground">
                      {s.note}
                    </Text>
                    <Group gap="2" class="flex-wrap">
                      <For each={s.services ?? []}>{(v) => (
                        <Badge variant="secondary" size="default">
                          {v}
                        </Badge>
                      )}</For>
                    </Group>
                  </>
                ) : null}
              </Stack>
            )}</For>
          </Box>
          {((layout as string) === "map") ? (
            <Box class="md:sticky md:top-8">
              <MediaFrame alt={labels.map} ratio="1/1" />
            </Box>
          ) : null}
        </Box>
      )}
    </SectionFrame>
  );
}
blocks/store-locations.types.ts
// Code generated by packages/kit-compose/src/organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT.

export type Store = {
  id: string;
  name: string;
  kind: string;
  address: string;
  hours: string;
  phone: string;
  note: string;
  services: string[];
};

export type StoreLabels = {
  map: string;
};

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 store-locations
blocks/store-locations.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/store-locations.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/link"
	"github.com/ui8kit/codegen/generated/templ/ui/text"
	uiutils "github.com/ui8kit/codegen/generated/templ/orgutils"
)

// StoreLocationsProps are the props of StoreLocations; the values are the JSON shapes of the TypeScript props.
type StoreLocationsProps struct {
	Id any `json:"id"`
	Title any `json:"title"`
	Lead any `json:"lead"`
	Stores any `json:"stores"`
	Empty any `json:"empty"`
	Kinds any `json:"kinds"`
	Labels any `json:"labels"`
	Layout any `json:"layout"`
	Tone any `json:"tone"`
	LandmarkLabel any `json:"landmarkLabel"`
}

// The stores of a shop: name, a badge of its kind (pickup or store only), address, hours, phone, a note and the services. Axes: layout (cards, list: one row per store, map: compact cards beside a map picture), tone.
templ StoreLocations(p StoreLocationsProps) {
	{{ vId := p.Id }}
	{{ vTitle := p.Title }}
	{{ vLead := uiutils.Def(p.Lead, "") }}
	{{ vStores := p.Stores }}
	{{ vEmpty := uiutils.Def(p.Empty, "") }}
	{{ vKinds := p.Kinds }}
	{{ vLabels := p.Labels }}
	{{ vLayout := uiutils.Def(p.Layout, "cards") }}
	{{ vTone := uiutils.Def(p.Tone, "default") }}
	{{ vLandmarkLabel := p.LandmarkLabel }}
	@SectionFrame(SectionFrameProps{Id: vId, Title: vTitle, Lead: vLead, Tone: vTone, LandmarkLabel: vLandmarkLabel}) {
		if uiutils.Eq(uiutils.Len(vStores), float64(0)) {
			@EmptyState(EmptyStateProps{Icon: "store", Title: vEmpty})
		} else {
			@compose.Box(compose.BoxProps{BoxProps: box.BoxProps{Class: uiutils.S(uiutils.Cnv("grid grid-cols-1 gap-8", uiutils.Cond(uiutils.T(uiutils.Eq(vLayout, "map")), "items-start md:grid-cols-2", "")))}}) {
				@compose.Box(compose.BoxProps{BoxProps: box.BoxProps{Class: uiutils.S(uiutils.Cond(uiutils.T(uiutils.Eq(vLayout, "cards")), "grid grid-cols-1 gap-4 md:grid-cols-2", "flex flex-col gap-4")), Attrs: uiutils.Attrs("data-slot", "items")}}) {
					for _, vS := range uiutils.L(vStores) {
						@compose.Stack(compose.StackProps{Gap: "4", BoxProps: box.BoxProps{Class: uiutils.S(uiutils.Cond(uiutils.T(uiutils.Eq(vLayout, "list")), "border-b border-border pb-4", "rounded bg-card inset-ring inset-ring-border p-6")), Attrs: uiutils.Attrs("data-slot", "item")}}) {
							@compose.Stack(compose.StackProps{Gap: "2", BoxProps: box.BoxProps{}}) {
								@compose.Badge(compose.BadgeProps{Variant: "outline", Size: "default", TextProps: text.TextProps{Class: "w-fit"}}) {
									{ uiutils.Text(uiutils.At(vKinds, uiutils.Get(vS, "kind"))) }
								}
								@compose.Title(compose.TitleProps{As: "3", Size: "lg", Weight: "bold", TextProps: text.TextProps{}}) {
									{ uiutils.Text(uiutils.Get(vS, "name")) }
								}
							}
							@compose.List(compose.ListProps{BoxProps: box.BoxProps{Tag: "ul", Class: uiutils.S(uiutils.Cond(uiutils.T(uiutils.Eq(vLayout, "list")), "flex flex-wrap gap-x-8 gap-y-2 text-sm", "flex flex-col gap-2 text-sm"))}}) {
								@compose.ListItem(compose.ListItemProps{BoxProps: box.BoxProps{Class: "flex items-center gap-2"}}) {
									@icons.LucideIcon(icons.LucideIconProps{Name: "map-pin", Size: 16})
									@compose.Inline(compose.InlineProps{TextProps: text.TextProps{}}) {
										{ uiutils.Text(uiutils.Get(vS, "address")) }
									}
								}
								@compose.ListItem(compose.ListItemProps{BoxProps: box.BoxProps{Class: "flex items-center gap-2"}}) {
									@icons.LucideIcon(icons.LucideIconProps{Name: "clock", Size: 16})
									@compose.Inline(compose.InlineProps{TextProps: text.TextProps{}}) {
										{ uiutils.Text(uiutils.Get(vS, "hours")) }
									}
								}
								@compose.ListItem(compose.ListItemProps{BoxProps: box.BoxProps{Class: "flex items-center gap-2"}}) {
									@icons.LucideIcon(icons.LucideIconProps{Name: "phone", Size: 16})
									@compose.Link(compose.LinkProps{Variant: "default", LinkProps: link.LinkProps{Href: uiutils.URL(uiutils.Tpl("tel:{0}", uiutils.Get(vS, "phone")), false)}}) {
										{ uiutils.Text(uiutils.Nbsp(uiutils.Get(vS, "phone"))) }
									}
								}
							}
							if uiutils.Eq(vLayout, "cards") {
								@compose.Text(compose.TextProps{Size: "sm", TextProps: text.TextProps{Class: "text-muted-foreground"}}) {
									{ uiutils.Text(uiutils.Get(vS, "note")) }
								}
								@compose.Group(compose.GroupProps{Gap: "2", BoxProps: box.BoxProps{Class: "flex-wrap"}}) {
									for _, vV := range uiutils.L(uiutils.Get(vS, "services")) {
										@compose.Badge(compose.BadgeProps{Variant: "secondary", Size: "default", TextProps: text.TextProps{}}) {
											{ uiutils.Text(vV) }
										}
									}
								}
							}
						}
					}
				}
				if uiutils.Eq(vLayout, "map") {
					@compose.Box(compose.BoxProps{BoxProps: box.BoxProps{Class: "md:sticky md:top-8"}}) {
						@MediaFrame(MediaFrameProps{Alt: uiutils.Get(vLabels, "map"), Ratio: "1/1"})
					}
				}
			}
		}
	}
}

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 store-locations
blocks/store-locations.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/store-locations.json
    The stores of a shop: name, a badge of its kind (pickup or store only), address, hours, phone, a note and the services. Axes: layout (cards, list: one row per store, map: compact cards beside a map picture), tone.
    Props (p): id, title, lead, stores, empty, kinds, labels, layout, tone, landmarkLabel. -#}
{%- set v_id = (p.id ?? null) -%}
{%- set v_title = (p.title ?? null) -%}
{%- set v_lead = (p.lead ?? '') -%}
{%- set v_stores = (p.stores ?? null) -%}
{%- set v_empty = (p.empty ?? '') -%}
{%- set v_kinds = (p.kinds ?? null) -%}
{%- set v_labels = (p.labels ?? null) -%}
{%- set v_layout = (p.layout ?? 'cards') -%}
{%- set v_tone = (p.tone ?? 'default') -%}
{%- set v_landmarkLabel = (p.landmarkLabel ?? null) -%}
{%- set c_18 -%}
  {%- if og_t(og_eq(og_len(v_stores), 0)) %}
    {{ include('blocks/empty-state.html.twig', {'p': {'icon': 'store', 'title': v_empty}}, with_context = false) }}
  {%- else %}
    {%- set c_17 -%}
      {%- set c_15 -%}
        {%- for v_s in og_l(v_stores) %}
          {%- set c_14 -%}
            {%- set c_3 -%}
              {%- set c_1 -%}
                {{ og_text(og_at(v_kinds, og_get(v_s, ['kind']))) }}
              {%- endset -%}
              {{ include('compose/Badge.html.twig', {'variant': 'outline', 'size': 'default', 'class': 'w-fit', 'children': c_1}, with_context = false) }}
              {%- set c_2 -%}
                {{ og_text(og_get(v_s, ['name'])) }}
              {%- endset -%}
              {{ include('compose/Title.html.twig', {'as': 3, 'size': 'lg', 'weight': 'bold', 'children': c_2}, with_context = false) }}
            {%- endset -%}
            {{ include('compose/Stack.html.twig', {'gap': '2', 'children': c_3}, with_context = false) }}
            {%- set c_10 -%}
              {%- set c_5 -%}
                {{ include('icons/LucideIcon.html.twig', {'name': 'map-pin', 'size': 16}, with_context = false) }}
                {%- set c_4 -%}
                  {{ og_text(og_get(v_s, ['address'])) }}
                {%- endset -%}
                {{ include('compose/Inline.html.twig', {'children': c_4}, with_context = false) }}
              {%- endset -%}
              {{ include('compose/ListItem.html.twig', {'class': 'flex items-center gap-2', 'children': c_5}, with_context = false) }}
              {%- set c_7 -%}
                {{ include('icons/LucideIcon.html.twig', {'name': 'clock', 'size': 16}, with_context = false) }}
                {%- set c_6 -%}
                  {{ og_text(og_get(v_s, ['hours'])) }}
                {%- endset -%}
                {{ include('compose/Inline.html.twig', {'children': c_6}, with_context = false) }}
              {%- endset -%}
              {{ include('compose/ListItem.html.twig', {'class': 'flex items-center gap-2', 'children': c_7}, with_context = false) }}
              {%- set c_9 -%}
                {{ include('icons/LucideIcon.html.twig', {'name': 'phone', 'size': 16}, with_context = false) }}
                {%- set c_8 -%}
                  {{ og_text(og_nbsp(og_get(v_s, ['phone']))) }}
                {%- endset -%}
                {{ include('compose/Link.html.twig', {'href': og_url(og_s(og_tpl('tel:{0}', [og_get(v_s, ['phone'])]))), 'variant': 'default', 'children': c_8}, with_context = false) }}
              {%- endset -%}
              {{ include('compose/ListItem.html.twig', {'class': 'flex items-center gap-2', 'children': c_9}, with_context = false) }}
            {%- endset -%}
            {{ include('compose/List.html.twig', {'tag': 'ul', 'class': og_s((og_t(og_eq(v_layout, 'list')) ? 'flex flex-wrap gap-x-8 gap-y-2 text-sm' : 'flex flex-col gap-2 text-sm')), 'children': c_10}, with_context = false) }}
            {%- if og_t(og_eq(v_layout, 'cards')) %}
              {%- set c_11 -%}
                {{ og_text(og_get(v_s, ['note'])) }}
              {%- endset -%}
              {{ include('compose/Text.html.twig', {'size': 'sm', 'class': 'text-muted-foreground', 'children': c_11}, with_context = false) }}
              {%- set c_13 -%}
                {%- for v_v in og_l(og_get(v_s, ['services'])) %}
                  {%- set c_12 -%}
                    {{ og_text(v_v) }}
                  {%- endset -%}
                  {{ include('compose/Badge.html.twig', {'variant': 'secondary', 'size': 'default', 'children': c_12}, with_context = false) }}
                {%- endfor %}
              {%- endset -%}
              {{ include('compose/Group.html.twig', {'gap': '2', 'class': 'flex-wrap', 'children': c_13}, with_context = false) }}
            {%- endif %}
          {%- endset -%}
          {{ include('compose/Stack.html.twig', {'gap': '4', 'class': og_s((og_t(og_eq(v_layout, 'list')) ? 'border-b border-border pb-4' : 'rounded bg-card inset-ring inset-ring-border p-6')), 'attrs': og_attrs(['data-slot', 'item']), 'children': c_14}, with_context = false) }}
        {%- endfor %}
      {%- endset -%}
      {{ include('compose/Box.html.twig', {'class': og_s((og_t(og_eq(v_layout, 'cards')) ? 'grid grid-cols-1 gap-4 md:grid-cols-2' : 'flex flex-col gap-4')), 'attrs': og_attrs(['data-slot', 'items']), 'children': c_15}, with_context = false) }}
      {%- if og_t(og_eq(v_layout, 'map')) %}
        {%- set c_16 -%}
          {{ include('blocks/media-frame.html.twig', {'p': {'alt': og_get(v_labels, ['map']), 'ratio': '1/1'}}, with_context = false) }}
        {%- endset -%}
        {{ include('compose/Box.html.twig', {'class': 'md:sticky md:top-8', 'children': c_16}, with_context = false) }}
      {%- endif %}
    {%- endset -%}
    {{ include('compose/Box.html.twig', {'class': og_s(og_cnv(['grid grid-cols-1 gap-8', (og_t(og_eq(v_layout, 'map')) ? 'items-start md:grid-cols-2' : '')])), 'children': c_17}, with_context = false) }}
  {%- endif %}
{%- endset -%}
{{ include('blocks/section-frame.html.twig', {'p': {'id': v_id, 'title': v_title, 'lead': v_lead, 'tone': v_tone, 'landmarkLabel': v_landmarkLabel}, 'children': og_markup(c_18)}, 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 store-locations
blocks/store-locations.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/store-locations.json
    The stores of a shop: name, a badge of its kind (pickup or store only), address, hours, phone, a note and the services. Axes: layout (cards, list: one row per store, map: compact cards beside a map picture), tone.
    Props (p): id, title, lead, stores, empty, kinds, labels, layout, tone, landmarkLabel. *}
{var $v_id = ($p['id'] ?? null)}
{var $v_title = ($p['title'] ?? null)}
{var $v_lead = ($p['lead'] ?? '')}
{var $v_stores = ($p['stores'] ?? null)}
{var $v_empty = ($p['empty'] ?? '')}
{var $v_kinds = ($p['kinds'] ?? null)}
{var $v_labels = ($p['labels'] ?? null)}
{var $v_layout = ($p['layout'] ?? 'cards')}
{var $v_tone = ($p['tone'] ?? 'default')}
{var $v_landmarkLabel = ($p['landmarkLabel'] ?? null)}
{capture $c_18}
  {if og_t(og_eq(og_len($v_stores), 0))}
    {=og_include('blocks/empty-state.latte', ['p' => ['icon' => 'store', 'title' => $v_empty]])|noescape}
  {else}
    {capture $c_17}
      {capture $c_15}
        {foreach og_l($v_stores) as $v_s}
          {capture $c_14}
            {capture $c_3}
              {capture $c_1}
                {=og_text(og_at($v_kinds, og_get($v_s, ['kind'])))}
              {/capture}
              {=og_include('compose/Badge.latte', ['variant' => 'outline', 'size' => 'default', 'class' => 'w-fit', 'children' => (string) $c_1])|noescape}
              {capture $c_2}
                {=og_text(og_get($v_s, ['name']))}
              {/capture}
              {=og_include('compose/Title.latte', ['as' => 3, 'size' => 'lg', 'weight' => 'bold', 'children' => (string) $c_2])|noescape}
            {/capture}
            {=og_include('compose/Stack.latte', ['gap' => '2', 'children' => (string) $c_3])|noescape}
            {capture $c_10}
              {capture $c_5}
                {=og_include('icons/LucideIcon.latte', ['name' => 'map-pin', 'size' => 16])|noescape}
                {capture $c_4}
                  {=og_text(og_get($v_s, ['address']))}
                {/capture}
                {=og_include('compose/Inline.latte', ['children' => (string) $c_4])|noescape}
              {/capture}
              {=og_include('compose/ListItem.latte', ['class' => 'flex items-center gap-2', 'children' => (string) $c_5])|noescape}
              {capture $c_7}
                {=og_include('icons/LucideIcon.latte', ['name' => 'clock', 'size' => 16])|noescape}
                {capture $c_6}
                  {=og_text(og_get($v_s, ['hours']))}
                {/capture}
                {=og_include('compose/Inline.latte', ['children' => (string) $c_6])|noescape}
              {/capture}
              {=og_include('compose/ListItem.latte', ['class' => 'flex items-center gap-2', 'children' => (string) $c_7])|noescape}
              {capture $c_9}
                {=og_include('icons/LucideIcon.latte', ['name' => 'phone', 'size' => 16])|noescape}
                {capture $c_8}
                  {=og_text(og_nbsp(og_get($v_s, ['phone'])))}
                {/capture}
                {=og_include('compose/Link.latte', ['href' => og_url(og_s(og_tpl('tel:{0}', [og_get($v_s, ['phone'])]))), 'variant' => 'default', 'children' => (string) $c_8])|noescape}
              {/capture}
              {=og_include('compose/ListItem.latte', ['class' => 'flex items-center gap-2', 'children' => (string) $c_9])|noescape}
            {/capture}
            {=og_include('compose/List.latte', ['tag' => 'ul', 'class' => og_s((og_t(og_eq($v_layout, 'list')) ? 'flex flex-wrap gap-x-8 gap-y-2 text-sm' : 'flex flex-col gap-2 text-sm')), 'children' => (string) $c_10])|noescape}
            {if og_t(og_eq($v_layout, 'cards'))}
              {capture $c_11}
                {=og_text(og_get($v_s, ['note']))}
              {/capture}
              {=og_include('compose/Text.latte', ['size' => 'sm', 'class' => 'text-muted-foreground', 'children' => (string) $c_11])|noescape}
              {capture $c_13}
                {foreach og_l(og_get($v_s, ['services'])) as $v_v}
                  {capture $c_12}
                    {=og_text($v_v)}
                  {/capture}
                  {=og_include('compose/Badge.latte', ['variant' => 'secondary', 'size' => 'default', 'children' => (string) $c_12])|noescape}
                {/foreach}
              {/capture}
              {=og_include('compose/Group.latte', ['gap' => '2', 'class' => 'flex-wrap', 'children' => (string) $c_13])|noescape}
            {/if}
          {/capture}
          {=og_include('compose/Stack.latte', ['gap' => '4', 'class' => og_s((og_t(og_eq($v_layout, 'list')) ? 'border-b border-border pb-4' : 'rounded bg-card inset-ring inset-ring-border p-6')), 'attrs' => og_attrs(['data-slot', 'item']), 'children' => (string) $c_14])|noescape}
        {/foreach}
      {/capture}
      {=og_include('compose/Box.latte', ['class' => og_s((og_t(og_eq($v_layout, 'cards')) ? 'grid grid-cols-1 gap-4 md:grid-cols-2' : 'flex flex-col gap-4')), 'attrs' => og_attrs(['data-slot', 'items']), 'children' => (string) $c_15])|noescape}
      {if og_t(og_eq($v_layout, 'map'))}
        {capture $c_16}
          {=og_include('blocks/media-frame.latte', ['p' => ['alt' => og_get($v_labels, ['map']), 'ratio' => '1/1']])|noescape}
        {/capture}
        {=og_include('compose/Box.latte', ['class' => 'md:sticky md:top-8', 'children' => (string) $c_16])|noescape}
      {/if}
    {/capture}
    {=og_include('compose/Box.latte', ['class' => og_s(og_cnv(['grid grid-cols-1 gap-8', (og_t(og_eq($v_layout, 'map')) ? 'items-start md:grid-cols-2' : '')])), 'children' => (string) $c_17])|noescape}
  {/if}
{/capture}
{=og_include('blocks/section-frame.latte', ['p' => ['id' => $v_id, 'title' => $v_title, 'lead' => $v_lead, 'tone' => $v_tone, 'landmarkLabel' => $v_landmarkLabel], 'children' => og_markup($c_18)])|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 store-locations
blocks/store-locations.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/store-locations.json
    The stores of a shop: name, a badge of its kind (pickup or store only), address, hours, phone, a note and the services. Axes: layout (cards, list: one row per store, map: compact cards beside a map picture), tone.
    Props (p): id, title, lead, stores, empty, kinds, labels, layout, tone, landmarkLabel. -#}
{%- set v_id = og_def(p['id'], none) -%}
{%- set v_title = og_def(p['title'], none) -%}
{%- set v_lead = og_def(p['lead'], '') -%}
{%- set v_stores = og_def(p['stores'], none) -%}
{%- set v_empty = og_def(p['empty'], '') -%}
{%- set v_kinds = og_def(p['kinds'], none) -%}
{%- set v_labels = og_def(p['labels'], none) -%}
{%- set v_layout = og_def(p['layout'], 'cards') -%}
{%- set v_tone = og_def(p['tone'], 'default') -%}
{%- set v_landmarkLabel = og_def(p['landmarkLabel'], none) -%}
{%- set c_18 -%}
  {%- if og_t(og_eq(og_len(v_stores), 0)) %}
    {{ og_include('blocks/empty-state.html.j2', {'p': {'icon': 'store', 'title': v_empty}}) }}
  {%- else %}
    {%- set c_17 -%}
      {%- set c_15 -%}
        {%- for v_s in og_l(v_stores) %}
          {%- set c_14 -%}
            {%- set c_3 -%}
              {%- set c_1 -%}
                {{ og_text(og_at(v_kinds, og_get(v_s, ['kind']))) }}
              {%- endset -%}
              {{ og_include('compose/badge.html.j2', {'p': {'Variant': 'outline', 'Size': 'default', 'Class': 'w-fit'}, 'children': c_1}) }}
              {%- set c_2 -%}
                {{ og_text(og_get(v_s, ['name'])) }}
              {%- endset -%}
              {{ og_include('compose/title.html.j2', {'p': {'As': 3, 'Size': 'lg', 'Weight': 'bold'}, 'children': c_2}) }}
            {%- endset -%}
            {{ og_include('compose/stack.html.j2', {'p': {'Gap': '2'}, 'children': c_3}) }}
            {%- set c_10 -%}
              {%- set c_5 -%}
                {{ og_include('icons/lucide-icon.html.j2', {'p': {'Name': 'map-pin', 'Size': 16}}) }}
                {%- set c_4 -%}
                  {{ og_text(og_get(v_s, ['address'])) }}
                {%- endset -%}
                {{ og_include('compose/inline.html.j2', {'p': {}, 'children': c_4}) }}
              {%- endset -%}
              {{ og_include('compose/list-item.html.j2', {'p': {'Class': 'flex items-center gap-2'}, 'children': c_5}) }}
              {%- set c_7 -%}
                {{ og_include('icons/lucide-icon.html.j2', {'p': {'Name': 'clock', 'Size': 16}}) }}
                {%- set c_6 -%}
                  {{ og_text(og_get(v_s, ['hours'])) }}
                {%- endset -%}
                {{ og_include('compose/inline.html.j2', {'p': {}, 'children': c_6}) }}
              {%- endset -%}
              {{ og_include('compose/list-item.html.j2', {'p': {'Class': 'flex items-center gap-2'}, 'children': c_7}) }}
              {%- set c_9 -%}
                {{ og_include('icons/lucide-icon.html.j2', {'p': {'Name': 'phone', 'Size': 16}}) }}
                {%- set c_8 -%}
                  {{ og_text(og_nbsp(og_get(v_s, ['phone']))) }}
                {%- endset -%}
                {{ og_include('compose/link.html.j2', {'p': {'Href': og_url(og_s(og_tpl('tel:{0}', [og_get(v_s, ['phone'])]))), 'Variant': 'default'}, 'children': c_8}) }}
              {%- endset -%}
              {{ og_include('compose/list-item.html.j2', {'p': {'Class': 'flex items-center gap-2'}, 'children': c_9}) }}
            {%- endset -%}
            {{ og_include('compose/list.html.j2', {'p': {'Tag': 'ul', 'Class': og_s(('flex flex-wrap gap-x-8 gap-y-2 text-sm' if og_t(og_eq(v_layout, 'list')) else 'flex flex-col gap-2 text-sm'))}, 'children': c_10}) }}
            {%- if og_t(og_eq(v_layout, 'cards')) %}
              {%- set c_11 -%}
                {{ og_text(og_get(v_s, ['note'])) }}
              {%- endset -%}
              {{ og_include('compose/text.html.j2', {'p': {'Size': 'sm', 'Class': 'text-muted-foreground'}, 'children': c_11}) }}
              {%- set c_13 -%}
                {%- for v_v in og_l(og_get(v_s, ['services'])) %}
                  {%- set c_12 -%}
                    {{ og_text(v_v) }}
                  {%- endset -%}
                  {{ og_include('compose/badge.html.j2', {'p': {'Variant': 'secondary', 'Size': 'default'}, 'children': c_12}) }}
                {%- endfor %}
              {%- endset -%}
              {{ og_include('compose/group.html.j2', {'p': {'Gap': '2', 'Class': 'flex-wrap'}, 'children': c_13}) }}
            {%- endif %}
          {%- endset -%}
          {{ og_include('compose/stack.html.j2', {'p': {'Gap': '4', 'Class': og_s(('border-b border-border pb-4' if og_t(og_eq(v_layout, 'list')) else 'rounded bg-card inset-ring inset-ring-border p-6')), 'Attrs': og_attrs(['data-slot', 'item'])}, 'children': c_14}) }}
        {%- endfor %}
      {%- endset -%}
      {{ og_include('compose/box.html.j2', {'p': {'Class': og_s(('grid grid-cols-1 gap-4 md:grid-cols-2' if og_t(og_eq(v_layout, 'cards')) else 'flex flex-col gap-4')), 'Attrs': og_attrs(['data-slot', 'items'])}, 'children': c_15}) }}
      {%- if og_t(og_eq(v_layout, 'map')) %}
        {%- set c_16 -%}
          {{ og_include('blocks/media-frame.html.j2', {'p': {'alt': og_get(v_labels, ['map']), 'ratio': '1/1'}}) }}
        {%- endset -%}
        {{ og_include('compose/box.html.j2', {'p': {'Class': 'md:sticky md:top-8'}, 'children': c_16}) }}
      {%- endif %}
    {%- endset -%}
    {{ og_include('compose/box.html.j2', {'p': {'Class': og_s(og_cnv(['grid grid-cols-1 gap-8', ('items-start md:grid-cols-2' if og_t(og_eq(v_layout, 'map')) else '')]))}, 'children': c_17}) }}
  {%- endif %}
{%- endset -%}
{{ og_include('blocks/section-frame.html.j2', {'p': {'id': v_id, 'title': v_title, 'lead': v_lead, 'tone': v_tone, 'landmarkLabel': v_landmarkLabel}, 'children': og_markup(c_18)}) }}

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 stores of a shop: name, a badge of its kind (pickup or store only), address, hours, phone, a note and the services. Axes: layout (cards, list: one row per store, map: compact cards beside a map picture), tone.

Props of StoreLocations
PropTypeDefault Description
id (required)string-
title (required)string-
lead string""
stores (required)Store[]-
empty string""the text of the empty state (no records), from the dictionary
kinds (required)Record<string, string>-word by store kind (pickup, store only)
labels (required)StoreLabels-
layout "cards" | "list" | "map""cards"
tone "default" | "muted""default"
landmarkLabel string-accessible name of the landmark of this component when the page shows it more than once (a variant); replaces the heading name of the root landmark, follows the name of a nested one