Skip to content
ui8kit

block / marketing

Template Grid

Template gallery: filters, a browse-all button and an 8-card MediaFrame grid.

Install

npx ui8kit add template-grid

Pulls in: box, button, compose, empty-state, grid, group, icon-badge, inline, kit-box, kit-button, kit-text, lucide-icon, media-frame, presets, section-frame, stack, text, title, utils

Preview

Browse templates

Store Front

Views

1.2K

Likes

96

Event Page

Views

3.4K

Likes

210

Team Dashboard

Views

860

Likes

48

Docs Site

Views

2.1K

Likes

133

Portfolio

Views

5K

Likes

402

Course Page

Views

740

Likes

35

Status Board

Views

1.8K

Likes

120

Recipe Blog

Views

2.6K

Likes

188

Browse All

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 template-grid
blocks/template-grid.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. -->
<!--
  Template gallery: a heading, outline filter pills, a grid of template cards and a full-width browse-all
  button.
-->
<script lang="ts" module>
  import type { Snippet } from "svelte";
  import type { Template, Filter, TemplateLabels } from "./template-grid.types";

  export type TemplateGridProps = {
    id: string;
    title: string;
    templates: Template[];
    filters: Filter[];
    browseHref?: string;
    labels: TemplateLabels;
    cols?: "1-3" | "1-4";
    tone?: "default" | "muted";
    density?: "roomy" | "default" | "compact";
    empty?: string;
    landmarkLabel?: string;
  };
</script>

<script lang="ts">
  import Box from "../compose/Box.svelte";
  import Button from "../compose/Button.svelte";
  import Grid from "../compose/Grid.svelte";
  import Group from "../compose/Group.svelte";
  import IconBadge from "../compose/IconBadge.svelte";
  import Inline from "../compose/Inline.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 { defaults } from "../presets/defaults";
  import { cn, urlOf } from "../utils";

  let {
    id,
    title,
    templates,
    filters,
    browseHref,
    labels,
    cols = "1-4",
    tone = "default",
    density = "compact",
    empty = "",
    landmarkLabel,
  }: TemplateGridProps = $props();
</script>

<SectionFrame id={id} tone={tone} density={density} measure="fill" class="py-0" landmarkLabel={landmarkLabel}>
  <Stack gap="8" align="stretch">
    <Group gap="4" align="center" justify="between" class="h-8 w-full flex-wrap">
      <Title as={2} size="2xl" weight="semibold" class="leading-9" id={(id + "-title")}>
        {title}
      </Title>
      {#if ((filters?.length ?? 0) > 0)}
        <Group
          gap="4"
          align="center"
          class="flex-wrap"
          role="group"
          aria-label={labels.filters}
          data-slot="template-filters"
        >
          {#each filters as f (f.id)}
            <Button variant="outline" size="sm" type="button" class="gap-2">
              {#if f.icon}
                <LucideIcon name={f.icon} size={16} />
              {/if}
              {f.title}
            </Button>
          {/each}
        </Group>
      {/if}
    </Group>
    {#if ((templates?.length ?? 0) === 0)}
      <EmptyState icon="layout-template" title={empty} />
    {:else}
      <Grid cols={cols} class="w-full gap-6" data-slot="template-grid">
        {#each templates as t (t.id)}
          <Box
            class={cn(
              "flex flex-col gap-2 overflow-hidden rounded p-4 inset-ring inset-ring-border",
              defaults.templates.card
            )}
            data-slot="template-card"
          >
            <Box class={cn("shrink-0 overflow-hidden", defaults.templates.image)}>
              <MediaFrame alt={t.title} src={t.image} class={cn("size-full", defaults.media.rounded)} />
            </Box>
            <Group gap="4" align="center" class={cn("w-full", defaults.templates.footer)} data-slot="template-footer">
              <IconBadge size="sm" class="overflow-hidden" data-slot="template-avatar">
                <LucideIcon name="layout-template" size={16} />
              </IconBadge>
              <Stack gap="0" class="min-w-0 flex-1">
                <Title as={3} size="base" weight="semibold" class="truncate leading-6">
                  {t.title}
                </Title>
                <Group gap="4" align="center" class="h-4 text-muted-foreground">
                  <Group gap="2" align="center">
                    <LucideIcon name="eye" size={16} />
                    <Inline class="sr-only">
                      {labels.views}
                    </Inline>
                    <Text size="xs" weight="bold" class="leading-4">
                      {t.views}
                    </Text>
                  </Group>
                  <Group gap="2" align="center">
                    <LucideIcon name="heart" size={16} />
                    <Inline class="sr-only">
                      {labels.likes}
                    </Inline>
                    <Text size="xs" weight="bold" class="leading-4">
                      {t.likes}
                    </Text>
                  </Group>
                </Group>
              </Stack>
            </Group>
          </Box>
        {/each}
      </Grid>
    {/if}
    <Button variant="outline" size="sm" href={urlOf(browseHref)} class="w-full">
      {labels.browse}
    </Button>
  </Stack>
</SectionFrame>
blocks/template-grid.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 Template = {
  id: string;
  title: string;
  views: string;
  likes: string;
  topic: string;
  image?: string;
};

export type Filter = {
  id: string;
  title: string;
  value: string;
  icon?: string;
};

export type TemplateLabels = {
  filters: string;
  browse: string;
  views: string;
  likes: 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 template-grid
blocks/template-grid.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.
/**
 * Template gallery: a heading, outline filter pills, a grid of template cards and a full-width browse-all
 * button.
 */
import { type ReactNode } from "react";
import { Box, Button, Grid, Group, IconBadge, Inline, 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 { defaults } from "../presets/defaults";
import { cn, urlOf } from "../utils";
import type { Template, Filter, TemplateLabels } from "./template-grid.types";

export type TemplateGridProps = {
  id: string;
  title: string;
  templates: Template[];
  filters: Filter[];
  browseHref?: string;
  labels: TemplateLabels;
  cols?: "1-3" | "1-4";
  tone?: "default" | "muted";
  density?: "roomy" | "default" | "compact";
  empty?: string;
  landmarkLabel?: string;
};

export function TemplateGrid({
  id,
  title,
  templates,
  filters,
  browseHref,
  labels,
  cols = "1-4",
  tone = "default",
  density = "compact",
  empty = "",
  landmarkLabel,
}: TemplateGridProps) {
  return (
    <SectionFrame
      id={id}
      tone={tone}
      density={density}
      measure="fill"
      className="py-0"
      landmarkLabel={landmarkLabel}
    >
      <Stack gap="8" align="stretch">
        <Group gap="4" align="center" justify="between" className="h-8 w-full flex-wrap">
          <Title as={2} size="2xl" weight="semibold" className="leading-9" id={(id + "-title")}>
            {title}
          </Title>
          {((filters?.length ?? 0) > 0) ? (
            <Group
              gap="4"
              align="center"
              className="flex-wrap"
              role="group"
              aria-label={labels.filters}
              data-slot="template-filters"
            >
              {(filters ?? []).map((f) => (
                <Button key={f.id} variant="outline" size="sm" type="button" className="gap-2">
                  {f.icon ? (
                    <LucideIcon name={f.icon} size={16} />
                  ) : null}
                  {f.title}
                </Button>
              ))}
            </Group>
          ) : null}
        </Group>
        {((templates?.length ?? 0) === 0) ? (
          <EmptyState icon="layout-template" title={empty} />
        ) : (
          <Grid cols={cols} className="w-full gap-6" data-slot="template-grid">
            {(templates ?? []).map((t) => (
              <Box key={t.id}
                className={cn(
                  "flex flex-col gap-2 overflow-hidden rounded p-4 inset-ring inset-ring-border",
                  defaults.templates.card
                )}
                data-slot="template-card"
              >
                <Box className={cn("shrink-0 overflow-hidden", defaults.templates.image)}>
                  <MediaFrame alt={t.title} src={t.image} className={cn("size-full", defaults.media.rounded)} />
                </Box>
                <Group gap="4" align="center" className={cn("w-full", defaults.templates.footer)} data-slot="template-footer">
                  <IconBadge size="sm" className="overflow-hidden" data-slot="template-avatar">
                    <LucideIcon name="layout-template" size={16} />
                  </IconBadge>
                  <Stack gap="0" className="min-w-0 flex-1">
                    <Title as={3} size="base" weight="semibold" className="truncate leading-6">
                      {t.title}
                    </Title>
                    <Group gap="4" align="center" className="h-4 text-muted-foreground">
                      <Group gap="2" align="center">
                        <LucideIcon name="eye" size={16} />
                        <Inline className="sr-only">
                          {labels.views}
                        </Inline>
                        <Text size="xs" weight="bold" className="leading-4">
                          {t.views}
                        </Text>
                      </Group>
                      <Group gap="2" align="center">
                        <LucideIcon name="heart" size={16} />
                        <Inline className="sr-only">
                          {labels.likes}
                        </Inline>
                        <Text size="xs" weight="bold" className="leading-4">
                          {t.likes}
                        </Text>
                      </Group>
                    </Group>
                  </Stack>
                </Group>
              </Box>
            ))}
          </Grid>
        )}
        <Button variant="outline" size="sm" href={urlOf(browseHref)} className="w-full">
          {labels.browse}
        </Button>
      </Stack>
    </SectionFrame>
  );
}
blocks/template-grid.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 Template = {
  id: string;
  title: string;
  views: string;
  likes: string;
  topic: string;
  image?: string;
};

export type Filter = {
  id: string;
  title: string;
  value: string;
  icon?: string;
};

export type TemplateLabels = {
  filters: string;
  browse: string;
  views: string;
  likes: 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 template-grid
blocks/template-grid.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 Template = {
  id: string;
  title: string;
  views: string;
  likes: string;
  topic: string;
  image?: string;
};

export type Filter = {
  id: string;
  title: string;
  value: string;
  icon?: string;
};

export type TemplateLabels = {
  filters: string;
  browse: string;
  views: string;
  likes: string;
};
blocks/template-grid.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. -->
<!--
  Template gallery: a heading, outline filter pills, a grid of template cards and a full-width browse-all
  button.
-->
<script lang="ts">
import type { Template, Filter, TemplateLabels } from "./template-grid.types";

export type TemplateGridProps = {
  id: string;
  title: string;
  templates: Template[];
  filters: Filter[];
  browseHref?: string;
  labels: TemplateLabels;
  cols?: "1-3" | "1-4";
  tone?: "default" | "muted";
  density?: "roomy" | "default" | "compact";
  empty?: string;
  landmarkLabel?: string;
};
</script>

<script setup lang="ts">
import Box from "../compose/Box.vue";
import Button from "../compose/Button.vue";
import Grid from "../compose/Grid.vue";
import Group from "../compose/Group.vue";
import IconBadge from "../compose/IconBadge.vue";
import Inline from "../compose/Inline.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 { defaults } from "../presets/defaults";
import { cn, urlOf } from "../utils";

const {
  id,
  title,
  templates,
  filters,
  browseHref,
  labels,
  cols = "1-4",
  tone = "default",
  density = "compact",
  empty = "",
  landmarkLabel,
} = defineProps<TemplateGridProps>();
</script>

<template>
  <SectionFrame
    :id="id"
    :tone="tone"
    :density="density"
    measure="fill"
    class="py-0"
    :landmarkLabel="landmarkLabel"
  >
    <Stack gap="8" align="stretch">
      <Group gap="4" align="center" justify="between" class="h-8 w-full flex-wrap">
        <Title :as="2" size="2xl" weight="semibold" class="leading-9" :id="(id + '-title')">
          {{ title }}
        </Title>
        <Group v-if="((filters?.length ?? 0) > 0)"
          gap="4"
          align="center"
          class="flex-wrap"
          role="group"
          :aria-label="labels.filters"
          data-slot="template-filters"
        >
          <Button v-for="f in filters" :key="f.id" variant="outline" size="sm" type="button" class="gap-2">
            <LucideIcon v-if="f.icon" :name="f.icon" :size="16" />
            {{ f.title }}
          </Button>
        </Group>
      </Group>
      <EmptyState v-if="((templates?.length ?? 0) === 0)" icon="layout-template" :title="empty" />
      <Grid v-else :cols="cols" class="w-full gap-6" data-slot="template-grid">
        <Box v-for="t in templates" :key="t.id"
          :class="cn(
            'flex flex-col gap-2 overflow-hidden rounded p-4 inset-ring inset-ring-border',
            defaults.templates.card
          )"
          data-slot="template-card"
        >
          <Box :class="cn('shrink-0 overflow-hidden', defaults.templates.image)">
            <MediaFrame :alt="t.title" :src="t.image" :class="cn('size-full', defaults.media.rounded)" />
          </Box>
          <Group gap="4" align="center" :class="cn('w-full', defaults.templates.footer)" data-slot="template-footer">
            <IconBadge size="sm" class="overflow-hidden" data-slot="template-avatar">
              <LucideIcon name="layout-template" :size="16" />
            </IconBadge>
            <Stack gap="0" class="min-w-0 flex-1">
              <Title :as="3" size="base" weight="semibold" class="truncate leading-6">
                {{ t.title }}
              </Title>
              <Group gap="4" align="center" class="h-4 text-muted-foreground">
                <Group gap="2" align="center">
                  <LucideIcon name="eye" :size="16" />
                  <Inline class="sr-only">
                    {{ labels.views }}
                  </Inline>
                  <Text size="xs" weight="bold" class="leading-4">
                    {{ t.views }}
                  </Text>
                </Group>
                <Group gap="2" align="center">
                  <LucideIcon name="heart" :size="16" />
                  <Inline class="sr-only">
                    {{ labels.likes }}
                  </Inline>
                  <Text size="xs" weight="bold" class="leading-4">
                    {{ t.likes }}
                  </Text>
                </Group>
              </Group>
            </Stack>
          </Group>
        </Box>
      </Grid>
      <Button variant="outline" size="sm" :href="urlOf(browseHref)" class="w-full">
        {{ labels.browse }}
      </Button>
    </Stack>
  </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 template-grid
blocks/template-grid.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.
/**
 * Template gallery: a heading, outline filter pills, a grid of template cards and a full-width browse-all
 * button.
 */
import { For, type JSX } from "solid-js";
import { Box, Button, Grid, Group, IconBadge, Inline, 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 { defaults } from "../presets/defaults";
import { cn, urlOf } from "../utils";
import type { Template, Filter, TemplateLabels } from "./template-grid.types";

export type TemplateGridProps = {
  id: string;
  title: string;
  templates: Template[];
  filters: Filter[];
  browseHref?: string;
  labels: TemplateLabels;
  cols?: "1-3" | "1-4";
  tone?: "default" | "muted";
  density?: "roomy" | "default" | "compact";
  empty?: string;
  landmarkLabel?: string;
};

export function TemplateGrid({
  id,
  title,
  templates,
  filters,
  browseHref,
  labels,
  cols = "1-4",
  tone = "default",
  density = "compact",
  empty = "",
  landmarkLabel,
}: TemplateGridProps) {
  return (
    <SectionFrame id={id} tone={tone} density={density} measure="fill" class="py-0" landmarkLabel={landmarkLabel}>
      <Stack gap="8" align="stretch">
        <Group gap="4" align="center" justify="between" class="h-8 w-full flex-wrap">
          <Title as={2} size="2xl" weight="semibold" class="leading-9" id={(id + "-title")}>
            {title}
          </Title>
          {((filters?.length ?? 0) > 0) ? (
            <Group
              gap="4"
              align="center"
              class="flex-wrap"
              role="group"
              aria-label={labels.filters}
              data-slot="template-filters"
            >
              <For each={filters ?? []}>{(f) => (
                <Button variant="outline" size="sm" type="button" class="gap-2">
                  {f.icon ? (
                    <LucideIcon name={f.icon} size={16} />
                  ) : null}
                  {f.title}
                </Button>
              )}</For>
            </Group>
          ) : null}
        </Group>
        {((templates?.length ?? 0) === 0) ? (
          <EmptyState icon="layout-template" title={empty} />
        ) : (
          <Grid cols={cols} class="w-full gap-6" data-slot="template-grid">
            <For each={templates ?? []}>{(t) => (
              <Box
                class={cn(
                  "flex flex-col gap-2 overflow-hidden rounded p-4 inset-ring inset-ring-border",
                  defaults.templates.card
                )}
                data-slot="template-card"
              >
                <Box class={cn("shrink-0 overflow-hidden", defaults.templates.image)}>
                  <MediaFrame alt={t.title} src={t.image} class={cn("size-full", defaults.media.rounded)} />
                </Box>
                <Group gap="4" align="center" class={cn("w-full", defaults.templates.footer)} data-slot="template-footer">
                  <IconBadge size="sm" class="overflow-hidden" data-slot="template-avatar">
                    <LucideIcon name="layout-template" size={16} />
                  </IconBadge>
                  <Stack gap="0" class="min-w-0 flex-1">
                    <Title as={3} size="base" weight="semibold" class="truncate leading-6">
                      {t.title}
                    </Title>
                    <Group gap="4" align="center" class="h-4 text-muted-foreground">
                      <Group gap="2" align="center">
                        <LucideIcon name="eye" size={16} />
                        <Inline class="sr-only">
                          {labels.views}
                        </Inline>
                        <Text size="xs" weight="bold" class="leading-4">
                          {t.views}
                        </Text>
                      </Group>
                      <Group gap="2" align="center">
                        <LucideIcon name="heart" size={16} />
                        <Inline class="sr-only">
                          {labels.likes}
                        </Inline>
                        <Text size="xs" weight="bold" class="leading-4">
                          {t.likes}
                        </Text>
                      </Group>
                    </Group>
                  </Stack>
                </Group>
              </Box>
            )}</For>
          </Grid>
        )}
        <Button variant="outline" size="sm" href={urlOf(browseHref)} class="w-full">
          {labels.browse}
        </Button>
      </Stack>
    </SectionFrame>
  );
}
blocks/template-grid.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 Template = {
  id: string;
  title: string;
  views: string;
  likes: string;
  topic: string;
  image?: string;
};

export type Filter = {
  id: string;
  title: string;
  value: string;
  icon?: string;
};

export type TemplateLabels = {
  filters: string;
  browse: string;
  views: string;
  likes: 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 template-grid
blocks/template-grid.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/template-grid.json

package blocks

import (
	"github.com/ui8kit/codegen/generated/templ/ui/box"
	"github.com/ui8kit/codegen/generated/templ/ui/button"
	"github.com/ui8kit/codegen/generated/templ/compose"
	"github.com/ui8kit/codegen/generated/templ/icons"
	"github.com/ui8kit/codegen/generated/templ/ui/text"
	uiutils "github.com/ui8kit/codegen/generated/templ/orgutils"
)

// TemplateGridProps are the props of TemplateGrid; the values are the JSON shapes of the TypeScript props.
type TemplateGridProps struct {
	Id any `json:"id"`
	Title any `json:"title"`
	Templates any `json:"templates"`
	Filters any `json:"filters"`
	BrowseHref any `json:"browseHref"`
	Labels any `json:"labels"`
	Cols any `json:"cols"`
	Tone any `json:"tone"`
	Density any `json:"density"`
	Empty any `json:"empty"`
	LandmarkLabel any `json:"landmarkLabel"`
}

// Template gallery: a heading, outline filter pills, a grid of template cards and a full-width browse-all button.
templ TemplateGrid(p TemplateGridProps) {
	{{ vId := p.Id }}
	{{ vTitle := p.Title }}
	{{ vTemplates := p.Templates }}
	{{ vFilters := p.Filters }}
	{{ vBrowseHref := p.BrowseHref }}
	{{ vLabels := p.Labels }}
	{{ vCols := uiutils.Def(p.Cols, "1-4") }}
	{{ vTone := uiutils.Def(p.Tone, "default") }}
	{{ vDensity := uiutils.Def(p.Density, "compact") }}
	{{ vEmpty := uiutils.Def(p.Empty, "") }}
	{{ vLandmarkLabel := p.LandmarkLabel }}
	@SectionFrame(SectionFrameProps{Id: vId, Tone: vTone, Density: vDensity, Measure: "fill", Class: uiutils.Cnv("py-0"), LandmarkLabel: vLandmarkLabel}) {
		@compose.Stack(compose.StackProps{Gap: "8", Align: "stretch", BoxProps: box.BoxProps{}}) {
			@compose.Group(compose.GroupProps{Gap: "4", Align: "center", Justify: "between", BoxProps: box.BoxProps{Class: "h-8 w-full flex-wrap"}}) {
				@compose.Title(compose.TitleProps{As: "2", Size: "2xl", Weight: "semibold", TextProps: text.TextProps{Class: "leading-9", Attrs: uiutils.Attrs("id", uiutils.Add(vId, "-title"))}}) {
					{ uiutils.Text(vTitle) }
				}
				if uiutils.Gt(uiutils.Len(vFilters), float64(0)) {
					@compose.Group(compose.GroupProps{Gap: "4", Align: "center", BoxProps: box.BoxProps{Class: "flex-wrap", Attrs: uiutils.Attrs("role", "group", "aria-label", uiutils.Get(vLabels, "filters"), "data-slot", "template-filters")}}) {
						for _, vF := range uiutils.L(vFilters) {
							@compose.Button(compose.ButtonProps{Variant: "outline", Size: "sm", ButtonProps: button.ButtonProps{Type: "button", Class: "gap-2"}}) {
								if uiutils.T(uiutils.Get(vF, "icon")) {
									@icons.LucideIcon(icons.LucideIconProps{Name: uiutils.S(uiutils.Get(vF, "icon")), Size: 16})
								}
								{ uiutils.Text(uiutils.Get(vF, "title")) }
							}
						}
					}
				}
			}
			if uiutils.Eq(uiutils.Len(vTemplates), float64(0)) {
				@EmptyState(EmptyStateProps{Icon: "layout-template", Title: vEmpty})
			} else {
				@compose.Grid(compose.GridProps{Cols: uiutils.S(vCols), BoxProps: box.BoxProps{Class: "w-full gap-6", Attrs: uiutils.Attrs("data-slot", "template-grid")}}) {
					for _, vT := range uiutils.L(vTemplates) {
						@compose.Box(compose.BoxProps{BoxProps: box.BoxProps{Class: uiutils.S(uiutils.Cnv("flex flex-col gap-2 overflow-hidden rounded p-4 inset-ring inset-ring-border", uiutils.Get(presetDefaults, "templates", "card"))), Attrs: uiutils.Attrs("data-slot", "template-card")}}) {
							@compose.Box(compose.BoxProps{BoxProps: box.BoxProps{Class: uiutils.S(uiutils.Cnv("shrink-0 overflow-hidden", uiutils.Get(presetDefaults, "templates", "image")))}}) {
								@MediaFrame(MediaFrameProps{Alt: uiutils.Get(vT, "title"), Src: uiutils.Get(vT, "image"), Class: uiutils.Cnv(uiutils.Cnv("size-full", uiutils.Get(presetDefaults, "media", "rounded")))})
							}
							@compose.Group(compose.GroupProps{Gap: "4", Align: "center", BoxProps: box.BoxProps{Class: uiutils.S(uiutils.Cnv("w-full", uiutils.Get(presetDefaults, "templates", "footer"))), Attrs: uiutils.Attrs("data-slot", "template-footer")}}) {
								@compose.IconBadge(compose.IconBadgeProps{Size: "sm", TextProps: text.TextProps{Class: "overflow-hidden", Attrs: uiutils.Attrs("data-slot", "template-avatar")}}) {
									@icons.LucideIcon(icons.LucideIconProps{Name: "layout-template", Size: 16})
								}
								@compose.Stack(compose.StackProps{Gap: "0", BoxProps: box.BoxProps{Class: "min-w-0 flex-1"}}) {
									@compose.Title(compose.TitleProps{As: "3", Size: "base", Weight: "semibold", TextProps: text.TextProps{Class: "truncate leading-6"}}) {
										{ uiutils.Text(uiutils.Get(vT, "title")) }
									}
									@compose.Group(compose.GroupProps{Gap: "4", Align: "center", BoxProps: box.BoxProps{Class: "h-4 text-muted-foreground"}}) {
										@compose.Group(compose.GroupProps{Gap: "2", Align: "center", BoxProps: box.BoxProps{}}) {
											@icons.LucideIcon(icons.LucideIconProps{Name: "eye", Size: 16})
											@compose.Inline(compose.InlineProps{TextProps: text.TextProps{Class: "sr-only"}}) {
												{ uiutils.Text(uiutils.Get(vLabels, "views")) }
											}
											@compose.Text(compose.TextProps{Size: "xs", Weight: "bold", TextProps: text.TextProps{Class: "leading-4"}}) {
												{ uiutils.Text(uiutils.Get(vT, "views")) }
											}
										}
										@compose.Group(compose.GroupProps{Gap: "2", Align: "center", BoxProps: box.BoxProps{}}) {
											@icons.LucideIcon(icons.LucideIconProps{Name: "heart", Size: 16})
											@compose.Inline(compose.InlineProps{TextProps: text.TextProps{Class: "sr-only"}}) {
												{ uiutils.Text(uiutils.Get(vLabels, "likes")) }
											}
											@compose.Text(compose.TextProps{Size: "xs", Weight: "bold", TextProps: text.TextProps{Class: "leading-4"}}) {
												{ uiutils.Text(uiutils.Get(vT, "likes")) }
											}
										}
									}
								}
							}
						}
					}
				}
			}
			@compose.Button(compose.ButtonProps{Variant: "outline", Size: "sm", ButtonProps: button.ButtonProps{Href: uiutils.URL(vBrowseHref, false), Class: "w-full"}}) {
				{ uiutils.Text(uiutils.Get(vLabels, "browse")) }
			}
		}
	}
}

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 template-grid
blocks/template-grid.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/template-grid.json
    Template gallery: a heading, outline filter pills, a grid of template cards and a full-width browse-all button.
    Props (p): id, title, templates, filters, browseHref, labels, cols, tone, density, empty, landmarkLabel. -#}
{%- set v_id = (p.id ?? null) -%}
{%- set v_title = (p.title ?? null) -%}
{%- set v_templates = (p.templates ?? null) -%}
{%- set v_filters = (p.filters ?? null) -%}
{%- set v_browseHref = (p.browseHref ?? null) -%}
{%- set v_labels = (p.labels ?? null) -%}
{%- set v_cols = (p.cols ?? '1-4') -%}
{%- set v_tone = (p.tone ?? 'default') -%}
{%- set v_density = (p.density ?? 'compact') -%}
{%- set v_empty = (p.empty ?? '') -%}
{%- set v_landmarkLabel = (p.landmarkLabel ?? null) -%}
{%- set c_21 -%}
  {%- set c_20 -%}
    {%- set c_4 -%}
      {%- set c_1 -%}
        {{ og_text(v_title) }}
      {%- endset -%}
      {{ include('compose/Title.html.twig', {'as': 2, 'size': '2xl', 'weight': 'semibold', 'class': 'leading-9', 'attrs': og_attrs(['id', og_add(v_id, '-title')]), 'children': c_1}, with_context = false) }}
      {%- if og_t(og_gt(og_len(v_filters), 0)) %}
        {%- set c_3 -%}
          {%- for v_f in og_l(v_filters) %}
            {%- set c_2 -%}
              {%- if og_t(og_get(v_f, ['icon'])) %}
                {{ include('icons/LucideIcon.html.twig', {'name': og_s(og_get(v_f, ['icon'])), 'size': 16}, with_context = false) }}
              {%- endif %}
              {{ og_text(og_get(v_f, ['title'])) }}
            {%- endset -%}
            {{ include('compose/Button.html.twig', {'variant': 'outline', 'size': 'sm', 'type': 'button', 'class': 'gap-2', 'children': c_2}, with_context = false) }}
          {%- endfor %}
        {%- endset -%}
        {{ include('compose/Group.html.twig', {'gap': '4', 'align': 'center', 'class': 'flex-wrap', 'attrs': og_attrs(['role', 'group', 'aria-label', og_get(v_labels, ['filters']), 'data-slot', 'template-filters']), 'children': c_3}, with_context = false) }}
      {%- endif %}
    {%- endset -%}
    {{ include('compose/Group.html.twig', {'gap': '4', 'align': 'center', 'justify': 'between', 'class': 'h-8 w-full flex-wrap', 'children': c_4}, with_context = false) }}
    {%- if og_t(og_eq(og_len(v_templates), 0)) %}
      {{ include('blocks/empty-state.html.twig', {'p': {'icon': 'layout-template', 'title': v_empty}}, with_context = false) }}
    {%- else %}
      {%- set c_18 -%}
        {%- for v_t in og_l(v_templates) %}
          {%- set c_17 -%}
            {%- set c_5 -%}
              {{ include('blocks/media-frame.html.twig', {'p': {'alt': og_get(v_t, ['title']), 'src': og_get(v_t, ['image']), 'className': og_cnv([og_cnv(['size-full', og_preset('blocks/presets/defaults.json', ['media', 'rounded'])])])}}, with_context = false) }}
            {%- endset -%}
            {{ include('compose/Box.html.twig', {'class': og_s(og_cnv(['shrink-0 overflow-hidden', og_preset('blocks/presets/defaults.json', ['templates', 'image'])])), 'children': c_5}, with_context = false) }}
            {%- set c_16 -%}
              {%- set c_6 -%}
                {{ include('icons/LucideIcon.html.twig', {'name': 'layout-template', 'size': 16}, with_context = false) }}
              {%- endset -%}
              {{ include('compose/IconBadge.html.twig', {'size': 'sm', 'class': 'overflow-hidden', 'attrs': og_attrs(['data-slot', 'template-avatar']), 'children': c_6}, with_context = false) }}
              {%- set c_15 -%}
                {%- set c_7 -%}
                  {{ og_text(og_get(v_t, ['title'])) }}
                {%- endset -%}
                {{ include('compose/Title.html.twig', {'as': 3, 'size': 'base', 'weight': 'semibold', 'class': 'truncate leading-6', 'children': c_7}, with_context = false) }}
                {%- set c_14 -%}
                  {%- set c_10 -%}
                    {{ include('icons/LucideIcon.html.twig', {'name': 'eye', 'size': 16}, with_context = false) }}
                    {%- set c_8 -%}
                      {{ og_text(og_get(v_labels, ['views'])) }}
                    {%- endset -%}
                    {{ include('compose/Inline.html.twig', {'class': 'sr-only', 'children': c_8}, with_context = false) }}
                    {%- set c_9 -%}
                      {{ og_text(og_get(v_t, ['views'])) }}
                    {%- endset -%}
                    {{ include('compose/Text.html.twig', {'size': 'xs', 'weight': 'bold', 'class': 'leading-4', 'children': c_9}, with_context = false) }}
                  {%- endset -%}
                  {{ include('compose/Group.html.twig', {'gap': '2', 'align': 'center', 'children': c_10}, with_context = false) }}
                  {%- set c_13 -%}
                    {{ include('icons/LucideIcon.html.twig', {'name': 'heart', 'size': 16}, with_context = false) }}
                    {%- set c_11 -%}
                      {{ og_text(og_get(v_labels, ['likes'])) }}
                    {%- endset -%}
                    {{ include('compose/Inline.html.twig', {'class': 'sr-only', 'children': c_11}, with_context = false) }}
                    {%- set c_12 -%}
                      {{ og_text(og_get(v_t, ['likes'])) }}
                    {%- endset -%}
                    {{ include('compose/Text.html.twig', {'size': 'xs', 'weight': 'bold', 'class': 'leading-4', 'children': c_12}, with_context = false) }}
                  {%- endset -%}
                  {{ include('compose/Group.html.twig', {'gap': '2', 'align': 'center', 'children': c_13}, with_context = false) }}
                {%- endset -%}
                {{ include('compose/Group.html.twig', {'gap': '4', 'align': 'center', 'class': 'h-4 text-muted-foreground', 'children': c_14}, with_context = false) }}
              {%- endset -%}
              {{ include('compose/Stack.html.twig', {'gap': '0', 'class': 'min-w-0 flex-1', 'children': c_15}, with_context = false) }}
            {%- endset -%}
            {{ include('compose/Group.html.twig', {'gap': '4', 'align': 'center', 'class': og_s(og_cnv(['w-full', og_preset('blocks/presets/defaults.json', ['templates', 'footer'])])), 'attrs': og_attrs(['data-slot', 'template-footer']), 'children': c_16}, with_context = false) }}
          {%- endset -%}
          {{ include('compose/Box.html.twig', {'class': og_s(og_cnv(['flex flex-col gap-2 overflow-hidden rounded p-4 inset-ring inset-ring-border', og_preset('blocks/presets/defaults.json', ['templates', 'card'])])), 'attrs': og_attrs(['data-slot', 'template-card']), 'children': c_17}, with_context = false) }}
        {%- endfor %}
      {%- endset -%}
      {{ include('compose/Grid.html.twig', {'cols': og_s(v_cols), 'class': 'w-full gap-6', 'attrs': og_attrs(['data-slot', 'template-grid']), 'children': c_18}, with_context = false) }}
    {%- endif %}
    {%- set c_19 -%}
      {{ og_text(og_get(v_labels, ['browse'])) }}
    {%- endset -%}
    {{ include('compose/Button.html.twig', {'variant': 'outline', 'size': 'sm', 'href': og_url(og_s(v_browseHref)), 'class': 'w-full', 'children': c_19}, with_context = false) }}
  {%- endset -%}
  {{ include('compose/Stack.html.twig', {'gap': '8', 'align': 'stretch', 'children': c_20}, with_context = false) }}
{%- endset -%}
{{ include('blocks/section-frame.html.twig', {'p': {'id': v_id, 'tone': v_tone, 'density': v_density, 'measure': 'fill', 'className': og_cnv(['py-0']), 'landmarkLabel': v_landmarkLabel}, 'children': og_markup(c_21)}, 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 template-grid
blocks/template-grid.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/template-grid.json
    Template gallery: a heading, outline filter pills, a grid of template cards and a full-width browse-all button.
    Props (p): id, title, templates, filters, browseHref, labels, cols, tone, density, empty, landmarkLabel. *}
{var $v_id = ($p['id'] ?? null)}
{var $v_title = ($p['title'] ?? null)}
{var $v_templates = ($p['templates'] ?? null)}
{var $v_filters = ($p['filters'] ?? null)}
{var $v_browseHref = ($p['browseHref'] ?? null)}
{var $v_labels = ($p['labels'] ?? null)}
{var $v_cols = ($p['cols'] ?? '1-4')}
{var $v_tone = ($p['tone'] ?? 'default')}
{var $v_density = ($p['density'] ?? 'compact')}
{var $v_empty = ($p['empty'] ?? '')}
{var $v_landmarkLabel = ($p['landmarkLabel'] ?? null)}
{capture $c_21}
  {capture $c_20}
    {capture $c_4}
      {capture $c_1}
        {=og_text($v_title)}
      {/capture}
      {=og_include('compose/Title.latte', ['as' => 2, 'size' => '2xl', 'weight' => 'semibold', 'class' => 'leading-9', 'attrs' => og_attrs(['id', og_add($v_id, '-title')]), 'children' => (string) $c_1])|noescape}
      {if og_t(og_gt(og_len($v_filters), 0))}
        {capture $c_3}
          {foreach og_l($v_filters) as $v_f}
            {capture $c_2}
              {if og_t(og_get($v_f, ['icon']))}
                {=og_include('icons/LucideIcon.latte', ['name' => og_s(og_get($v_f, ['icon'])), 'size' => 16])|noescape}
              {/if}
              {=og_text(og_get($v_f, ['title']))}
            {/capture}
            {=og_include('compose/Button.latte', ['variant' => 'outline', 'size' => 'sm', 'type' => 'button', 'class' => 'gap-2', 'children' => (string) $c_2])|noescape}
          {/foreach}
        {/capture}
        {=og_include('compose/Group.latte', ['gap' => '4', 'align' => 'center', 'class' => 'flex-wrap', 'attrs' => og_attrs(['role', 'group', 'aria-label', og_get($v_labels, ['filters']), 'data-slot', 'template-filters']), 'children' => (string) $c_3])|noescape}
      {/if}
    {/capture}
    {=og_include('compose/Group.latte', ['gap' => '4', 'align' => 'center', 'justify' => 'between', 'class' => 'h-8 w-full flex-wrap', 'children' => (string) $c_4])|noescape}
    {if og_t(og_eq(og_len($v_templates), 0))}
      {=og_include('blocks/empty-state.latte', ['p' => ['icon' => 'layout-template', 'title' => $v_empty]])|noescape}
    {else}
      {capture $c_18}
        {foreach og_l($v_templates) as $v_t}
          {capture $c_17}
            {capture $c_5}
              {=og_include('blocks/media-frame.latte', ['p' => ['alt' => og_get($v_t, ['title']), 'src' => og_get($v_t, ['image']), 'className' => og_cnv([og_cnv(['size-full', og_preset('blocks/presets/defaults.json', ['media', 'rounded'])])])]])|noescape}
            {/capture}
            {=og_include('compose/Box.latte', ['class' => og_s(og_cnv(['shrink-0 overflow-hidden', og_preset('blocks/presets/defaults.json', ['templates', 'image'])])), 'children' => (string) $c_5])|noescape}
            {capture $c_16}
              {capture $c_6}
                {=og_include('icons/LucideIcon.latte', ['name' => 'layout-template', 'size' => 16])|noescape}
              {/capture}
              {=og_include('compose/IconBadge.latte', ['size' => 'sm', 'class' => 'overflow-hidden', 'attrs' => og_attrs(['data-slot', 'template-avatar']), 'children' => (string) $c_6])|noescape}
              {capture $c_15}
                {capture $c_7}
                  {=og_text(og_get($v_t, ['title']))}
                {/capture}
                {=og_include('compose/Title.latte', ['as' => 3, 'size' => 'base', 'weight' => 'semibold', 'class' => 'truncate leading-6', 'children' => (string) $c_7])|noescape}
                {capture $c_14}
                  {capture $c_10}
                    {=og_include('icons/LucideIcon.latte', ['name' => 'eye', 'size' => 16])|noescape}
                    {capture $c_8}
                      {=og_text(og_get($v_labels, ['views']))}
                    {/capture}
                    {=og_include('compose/Inline.latte', ['class' => 'sr-only', 'children' => (string) $c_8])|noescape}
                    {capture $c_9}
                      {=og_text(og_get($v_t, ['views']))}
                    {/capture}
                    {=og_include('compose/Text.latte', ['size' => 'xs', 'weight' => 'bold', 'class' => 'leading-4', 'children' => (string) $c_9])|noescape}
                  {/capture}
                  {=og_include('compose/Group.latte', ['gap' => '2', 'align' => 'center', 'children' => (string) $c_10])|noescape}
                  {capture $c_13}
                    {=og_include('icons/LucideIcon.latte', ['name' => 'heart', 'size' => 16])|noescape}
                    {capture $c_11}
                      {=og_text(og_get($v_labels, ['likes']))}
                    {/capture}
                    {=og_include('compose/Inline.latte', ['class' => 'sr-only', 'children' => (string) $c_11])|noescape}
                    {capture $c_12}
                      {=og_text(og_get($v_t, ['likes']))}
                    {/capture}
                    {=og_include('compose/Text.latte', ['size' => 'xs', 'weight' => 'bold', 'class' => 'leading-4', 'children' => (string) $c_12])|noescape}
                  {/capture}
                  {=og_include('compose/Group.latte', ['gap' => '2', 'align' => 'center', 'children' => (string) $c_13])|noescape}
                {/capture}
                {=og_include('compose/Group.latte', ['gap' => '4', 'align' => 'center', 'class' => 'h-4 text-muted-foreground', 'children' => (string) $c_14])|noescape}
              {/capture}
              {=og_include('compose/Stack.latte', ['gap' => '0', 'class' => 'min-w-0 flex-1', 'children' => (string) $c_15])|noescape}
            {/capture}
            {=og_include('compose/Group.latte', ['gap' => '4', 'align' => 'center', 'class' => og_s(og_cnv(['w-full', og_preset('blocks/presets/defaults.json', ['templates', 'footer'])])), 'attrs' => og_attrs(['data-slot', 'template-footer']), 'children' => (string) $c_16])|noescape}
          {/capture}
          {=og_include('compose/Box.latte', ['class' => og_s(og_cnv(['flex flex-col gap-2 overflow-hidden rounded p-4 inset-ring inset-ring-border', og_preset('blocks/presets/defaults.json', ['templates', 'card'])])), 'attrs' => og_attrs(['data-slot', 'template-card']), 'children' => (string) $c_17])|noescape}
        {/foreach}
      {/capture}
      {=og_include('compose/Grid.latte', ['cols' => og_s($v_cols), 'class' => 'w-full gap-6', 'attrs' => og_attrs(['data-slot', 'template-grid']), 'children' => (string) $c_18])|noescape}
    {/if}
    {capture $c_19}
      {=og_text(og_get($v_labels, ['browse']))}
    {/capture}
    {=og_include('compose/Button.latte', ['variant' => 'outline', 'size' => 'sm', 'href' => og_url(og_s($v_browseHref)), 'class' => 'w-full', 'children' => (string) $c_19])|noescape}
  {/capture}
  {=og_include('compose/Stack.latte', ['gap' => '8', 'align' => 'stretch', 'children' => (string) $c_20])|noescape}
{/capture}
{=og_include('blocks/section-frame.latte', ['p' => ['id' => $v_id, 'tone' => $v_tone, 'density' => $v_density, 'measure' => 'fill', 'className' => og_cnv(['py-0']), 'landmarkLabel' => $v_landmarkLabel], 'children' => og_markup($c_21)])|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 template-grid
blocks/template-grid.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/template-grid.json
    Template gallery: a heading, outline filter pills, a grid of template cards and a full-width browse-all button.
    Props (p): id, title, templates, filters, browseHref, labels, cols, tone, density, empty, landmarkLabel. -#}
{%- set v_id = og_def(p['id'], none) -%}
{%- set v_title = og_def(p['title'], none) -%}
{%- set v_templates = og_def(p['templates'], none) -%}
{%- set v_filters = og_def(p['filters'], none) -%}
{%- set v_browseHref = og_def(p['browseHref'], none) -%}
{%- set v_labels = og_def(p['labels'], none) -%}
{%- set v_cols = og_def(p['cols'], '1-4') -%}
{%- set v_tone = og_def(p['tone'], 'default') -%}
{%- set v_density = og_def(p['density'], 'compact') -%}
{%- set v_empty = og_def(p['empty'], '') -%}
{%- set v_landmarkLabel = og_def(p['landmarkLabel'], none) -%}
{%- set c_21 -%}
  {%- set c_20 -%}
    {%- set c_4 -%}
      {%- set c_1 -%}
        {{ og_text(v_title) }}
      {%- endset -%}
      {{ og_include('compose/title.html.j2', {'p': {'As': 2, 'Size': '2xl', 'Weight': 'semibold', 'Class': 'leading-9', 'Attrs': og_attrs(['id', og_add(v_id, '-title')])}, 'children': c_1}) }}
      {%- if og_t(og_gt(og_len(v_filters), 0)) %}
        {%- set c_3 -%}
          {%- for v_f in og_l(v_filters) %}
            {%- set c_2 -%}
              {%- if og_t(og_get(v_f, ['icon'])) %}
                {{ og_include('icons/lucide-icon.html.j2', {'p': {'Name': og_s(og_get(v_f, ['icon'])), 'Size': 16}}) }}
              {%- endif %}
              {{ og_text(og_get(v_f, ['title'])) }}
            {%- endset -%}
            {{ og_include('compose/button.html.j2', {'p': {'Variant': 'outline', 'Size': 'sm', 'Type': 'button', 'Class': 'gap-2'}, 'children': c_2}) }}
          {%- endfor %}
        {%- endset -%}
        {{ og_include('compose/group.html.j2', {'p': {'Gap': '4', 'Align': 'center', 'Class': 'flex-wrap', 'Attrs': og_attrs(['role', 'group', 'aria-label', og_get(v_labels, ['filters']), 'data-slot', 'template-filters'])}, 'children': c_3}) }}
      {%- endif %}
    {%- endset -%}
    {{ og_include('compose/group.html.j2', {'p': {'Gap': '4', 'Align': 'center', 'Justify': 'between', 'Class': 'h-8 w-full flex-wrap'}, 'children': c_4}) }}
    {%- if og_t(og_eq(og_len(v_templates), 0)) %}
      {{ og_include('blocks/empty-state.html.j2', {'p': {'icon': 'layout-template', 'title': v_empty}}) }}
    {%- else %}
      {%- set c_18 -%}
        {%- for v_t in og_l(v_templates) %}
          {%- set c_17 -%}
            {%- set c_5 -%}
              {{ og_include('blocks/media-frame.html.j2', {'p': {'alt': og_get(v_t, ['title']), 'src': og_get(v_t, ['image']), 'className': og_cnv([og_cnv(['size-full', og_preset('blocks/presets/defaults.json', ['media', 'rounded'])])])}}) }}
            {%- endset -%}
            {{ og_include('compose/box.html.j2', {'p': {'Class': og_s(og_cnv(['shrink-0 overflow-hidden', og_preset('blocks/presets/defaults.json', ['templates', 'image'])]))}, 'children': c_5}) }}
            {%- set c_16 -%}
              {%- set c_6 -%}
                {{ og_include('icons/lucide-icon.html.j2', {'p': {'Name': 'layout-template', 'Size': 16}}) }}
              {%- endset -%}
              {{ og_include('compose/icon-badge.html.j2', {'p': {'Size': 'sm', 'Class': 'overflow-hidden', 'Attrs': og_attrs(['data-slot', 'template-avatar'])}, 'children': c_6}) }}
              {%- set c_15 -%}
                {%- set c_7 -%}
                  {{ og_text(og_get(v_t, ['title'])) }}
                {%- endset -%}
                {{ og_include('compose/title.html.j2', {'p': {'As': 3, 'Size': 'base', 'Weight': 'semibold', 'Class': 'truncate leading-6'}, 'children': c_7}) }}
                {%- set c_14 -%}
                  {%- set c_10 -%}
                    {{ og_include('icons/lucide-icon.html.j2', {'p': {'Name': 'eye', 'Size': 16}}) }}
                    {%- set c_8 -%}
                      {{ og_text(og_get(v_labels, ['views'])) }}
                    {%- endset -%}
                    {{ og_include('compose/inline.html.j2', {'p': {'Class': 'sr-only'}, 'children': c_8}) }}
                    {%- set c_9 -%}
                      {{ og_text(og_get(v_t, ['views'])) }}
                    {%- endset -%}
                    {{ og_include('compose/text.html.j2', {'p': {'Size': 'xs', 'Weight': 'bold', 'Class': 'leading-4'}, 'children': c_9}) }}
                  {%- endset -%}
                  {{ og_include('compose/group.html.j2', {'p': {'Gap': '2', 'Align': 'center'}, 'children': c_10}) }}
                  {%- set c_13 -%}
                    {{ og_include('icons/lucide-icon.html.j2', {'p': {'Name': 'heart', 'Size': 16}}) }}
                    {%- set c_11 -%}
                      {{ og_text(og_get(v_labels, ['likes'])) }}
                    {%- endset -%}
                    {{ og_include('compose/inline.html.j2', {'p': {'Class': 'sr-only'}, 'children': c_11}) }}
                    {%- set c_12 -%}
                      {{ og_text(og_get(v_t, ['likes'])) }}
                    {%- endset -%}
                    {{ og_include('compose/text.html.j2', {'p': {'Size': 'xs', 'Weight': 'bold', 'Class': 'leading-4'}, 'children': c_12}) }}
                  {%- endset -%}
                  {{ og_include('compose/group.html.j2', {'p': {'Gap': '2', 'Align': 'center'}, 'children': c_13}) }}
                {%- endset -%}
                {{ og_include('compose/group.html.j2', {'p': {'Gap': '4', 'Align': 'center', 'Class': 'h-4 text-muted-foreground'}, 'children': c_14}) }}
              {%- endset -%}
              {{ og_include('compose/stack.html.j2', {'p': {'Gap': '0', 'Class': 'min-w-0 flex-1'}, 'children': c_15}) }}
            {%- endset -%}
            {{ og_include('compose/group.html.j2', {'p': {'Gap': '4', 'Align': 'center', 'Class': og_s(og_cnv(['w-full', og_preset('blocks/presets/defaults.json', ['templates', 'footer'])])), 'Attrs': og_attrs(['data-slot', 'template-footer'])}, 'children': c_16}) }}
          {%- endset -%}
          {{ og_include('compose/box.html.j2', {'p': {'Class': og_s(og_cnv(['flex flex-col gap-2 overflow-hidden rounded p-4 inset-ring inset-ring-border', og_preset('blocks/presets/defaults.json', ['templates', 'card'])])), 'Attrs': og_attrs(['data-slot', 'template-card'])}, 'children': c_17}) }}
        {%- endfor %}
      {%- endset -%}
      {{ og_include('compose/grid.html.j2', {'p': {'Cols': og_s(v_cols), 'Class': 'w-full gap-6', 'Attrs': og_attrs(['data-slot', 'template-grid'])}, 'children': c_18}) }}
    {%- endif %}
    {%- set c_19 -%}
      {{ og_text(og_get(v_labels, ['browse'])) }}
    {%- endset -%}
    {{ og_include('compose/button.html.j2', {'p': {'Variant': 'outline', 'Size': 'sm', 'Href': og_url(og_s(v_browseHref)), 'Class': 'w-full'}, 'children': c_19}) }}
  {%- endset -%}
  {{ og_include('compose/stack.html.j2', {'p': {'Gap': '8', 'Align': 'stretch'}, 'children': c_20}) }}
{%- endset -%}
{{ og_include('blocks/section-frame.html.j2', {'p': {'id': v_id, 'tone': v_tone, 'density': v_density, 'measure': 'fill', 'className': og_cnv(['py-0']), 'landmarkLabel': v_landmarkLabel}, 'children': og_markup(c_21)}) }}

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.

Template gallery: a heading, outline filter pills, a grid of template cards and a full-width browse-all button.

Props of TemplateGrid
PropTypeDefault Description
id (required)string-
title (required)string-
templates (required)Template[]-
filters (required)Filter[]-
browseHref string-the address of the full list; none: a button
labels (required)TemplateLabels-the name of the filter row, the browse-all text, the hidden names of the counts
cols "1-3" | "1-4""1-4"
tone "default" | "muted""default"
density "roomy" | "default" | "compact""compact"
empty string""the text of the empty state (no records), from the dictionary
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