Skip to content
ui8kit

block / marketing

Project Grid

Projects as cards, a compact grid, captions over pictures, a bento or a list beside a collage.

Install

npx ui8kit add project-grid

Pulls in: box, compose, empty-state, group, kit-box, kit-text, media-frame, project-tiles, section-frame, stack, text, utils

Preview

Selected work

Products, brands and sites we shipped with our clients.

Featured

, 2026

Atlas dashboard

An analytics dashboard for a logistics team: one screen for the whole fleet.

SvelteChartsDesign system
Read the caseLive site

, 2025

Harbor booking

Booking flow for a chain of marinas, from the map to the receipt.

ReactPayments
Read the caseLive site

, 2025

Lumen brand

Identity, type and a site for a lighting studio.

BrandWebsite
Read the caseLive site
Featured

, 2024

Orbit mobile

A habit tracker that fits on the lock screen.

iOSAndroid
Read the caseLive site

, 2024

Field notes

A long-read magazine with a reading mode and offline issues.

VueContent
Read the caseLive site

, 2023

Cedar store

A small furniture store with a configurator and same-day delivery.

Commerce3D
Read the caseLive site

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 project-grid
blocks/project-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. -->
<!--
  Projects of a studio or a person: cards with tags and links, a compact grid, tiles with the caption over the
  picture, a bento with one big project, or a list beside a collage. Axes: layout (cards, compact, overlay,
  bento, list), tone, density.
-->
<script lang="ts" module>
  import type { Snippet } from "svelte";
  import type { Project, ProjectLabels } from "./project-grid.types";

  export type ProjectGridProps = {
    id: string;
    title: string;
    lead?: string;
    projects: Project[];
    empty?: string;
    labels: ProjectLabels;
    layout?: "cards" | "compact" | "overlay" | "bento" | "list";
    tone?: "default" | "muted";
    density?: "default" | "compact";
    landmarkLabel?: string;
  };
</script>

<script lang="ts">
  import Box from "../compose/Box.svelte";
  import Group from "../compose/Group.svelte";
  import Stack from "../compose/Stack.svelte";
  import Text from "../compose/Text.svelte";
  import EmptyState from "../components/empty-state.svelte";
  import MediaFrame from "../components/media-frame.svelte";
  import ProjectTiles from "../components/project-tiles.svelte";
  import SectionFrame from "../components/section-frame.svelte";

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

<SectionFrame
  id={id}
  title={title}
  lead={lead}
  tone={tone}
  density={density}
  layout={(((layout as string) === "list") ? "split" : "stack")}
  media={{ show: ((layout as string) === "list"), align: "start" }}
  landmarkLabel={landmarkLabel}
>
  {#if ((projects?.length ?? 0) === 0)}
    <EmptyState icon="folder-open" title={empty} />
  {:else if ((layout as string) === "list")}
    <Stack gap="4" align="stretch" data-slot="items">
      {#each projects as p (p.id)}
        <Group gap="4" align="start" class="border-b border-border pb-4" data-slot="item">
          <MediaFrame alt={p.title} src={p.image} ratio="1/1" class="size-16 shrink-0" />
          <Stack gap="2" align="stretch" class="flex-1">
            <Group gap="4" justify="between">
              <Text size="sm" weight="semibold">
                {p.title}
              </Text>
              <Text size="xs" class="text-muted-foreground">
                {p.year}
              </Text>
            </Group>
            <Text size="sm" class="text-muted-foreground">
              {p.summary}
            </Text>
          </Stack>
        </Group>
      {/each}
    </Stack>
  {:else}
    <ProjectTiles projects={projects} labels={labels} layout={layout} />
  {/if}
  {#snippet aside()}
    <Box class="grid grid-cols-2 gap-4" data-slot="collage">
      <MediaFrame alt={title} ratio="3/4" />
      <MediaFrame alt={title} ratio="3/4" class="mt-8" />
    </Box>
  {/snippet}
</SectionFrame>
blocks/project-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 Project = {
  id: string;
  title: string;
  category: string;
  year: number;
  summary: string;
  tags: string[];
  featured: boolean;
  client: string;
  href?: string;
  image?: string;
};

export type ProjectLabels = {
  featured: string;
  view: string;
  case: 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 project-grid
blocks/project-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.
/**
 * Projects of a studio or a person: cards with tags and links, a compact grid, tiles with the caption over the
 * picture, a bento with one big project, or a list beside a collage. Axes: layout (cards, compact, overlay,
 * bento, list), tone, density.
 */
import { type ReactNode } from "react";
import { Box, Group, Stack, Text } from "../compose";
import { EmptyState } from "../components/empty-state";
import { MediaFrame } from "../components/media-frame";
import { ProjectTiles } from "../components/project-tiles";
import { SectionFrame } from "../components/section-frame";
import type { Project, ProjectLabels } from "./project-grid.types";

export type ProjectGridProps = {
  id: string;
  title: string;
  lead?: string;
  projects: Project[];
  empty?: string;
  labels: ProjectLabels;
  layout?: "cards" | "compact" | "overlay" | "bento" | "list";
  tone?: "default" | "muted";
  density?: "default" | "compact";
  landmarkLabel?: string;
};

export function ProjectGrid({
  id,
  title,
  lead = "",
  projects,
  empty = "",
  labels,
  layout = "cards",
  tone = "default",
  density = "default",
  landmarkLabel,
}: ProjectGridProps) {
  return (
    <SectionFrame
      id={id}
      title={title}
      lead={lead}
      tone={tone}
      density={density}
      layout={(((layout as string) === "list") ? "split" : "stack")}
      media={{ show: ((layout as string) === "list"), align: "start" }}
      landmarkLabel={landmarkLabel}
      aside={(
        <Box className="grid grid-cols-2 gap-4" data-slot="collage">
          <MediaFrame alt={title} ratio="3/4" />
          <MediaFrame alt={title} ratio="3/4" className="mt-8" />
        </Box>
      )}
    >
      {((projects?.length ?? 0) === 0) ? (
        <EmptyState icon="folder-open" title={empty} />
      ) : ((layout as string) === "list") ? (
        <Stack gap="4" align="stretch" data-slot="items">
          {(projects ?? []).map((p) => (
            <Group key={p.id} gap="4" align="start" className="border-b border-border pb-4" data-slot="item">
              <MediaFrame alt={p.title} src={p.image} ratio="1/1" className="size-16 shrink-0" />
              <Stack gap="2" align="stretch" className="flex-1">
                <Group gap="4" justify="between">
                  <Text size="sm" weight="semibold">
                    {p.title}
                  </Text>
                  <Text size="xs" className="text-muted-foreground">
                    {p.year}
                  </Text>
                </Group>
                <Text size="sm" className="text-muted-foreground">
                  {p.summary}
                </Text>
              </Stack>
            </Group>
          ))}
        </Stack>
      ) : (
        <ProjectTiles projects={projects} labels={labels} layout={layout} />
      )}
    </SectionFrame>
  );
}
blocks/project-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 Project = {
  id: string;
  title: string;
  category: string;
  year: number;
  summary: string;
  tags: string[];
  featured: boolean;
  client: string;
  href?: string;
  image?: string;
};

export type ProjectLabels = {
  featured: string;
  view: string;
  case: 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 project-grid
blocks/project-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 Project = {
  id: string;
  title: string;
  category: string;
  year: number;
  summary: string;
  tags: string[];
  featured: boolean;
  client: string;
  href?: string;
  image?: string;
};

export type ProjectLabels = {
  featured: string;
  view: string;
  case: string;
};
blocks/project-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. -->
<!--
  Projects of a studio or a person: cards with tags and links, a compact grid, tiles with the caption over the
  picture, a bento with one big project, or a list beside a collage. Axes: layout (cards, compact, overlay,
  bento, list), tone, density.
-->
<script lang="ts">
import type { Project, ProjectLabels } from "./project-grid.types";

export type ProjectGridProps = {
  id: string;
  title: string;
  lead?: string;
  projects: Project[];
  empty?: string;
  labels: ProjectLabels;
  layout?: "cards" | "compact" | "overlay" | "bento" | "list";
  tone?: "default" | "muted";
  density?: "default" | "compact";
  landmarkLabel?: string;
};
</script>

<script setup lang="ts">
import Box from "../compose/Box.vue";
import Group from "../compose/Group.vue";
import Stack from "../compose/Stack.vue";
import Text from "../compose/Text.vue";
import EmptyState from "../components/empty-state.vue";
import MediaFrame from "../components/media-frame.vue";
import ProjectTiles from "../components/project-tiles.vue";
import SectionFrame from "../components/section-frame.vue";

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

<template>
  <SectionFrame
    :id="id"
    :title="title"
    :lead="lead"
    :tone="tone"
    :density="density"
    :layout="(((layout as string) === 'list') ? 'split' : 'stack')"
    :media="{ show: ((layout as string) === 'list'), align: 'start' }"
    :landmarkLabel="landmarkLabel"
  >
    <EmptyState v-if="((projects?.length ?? 0) === 0)" icon="folder-open" :title="empty" />
    <Stack v-else-if="((layout as string) === 'list')" gap="4" align="stretch" data-slot="items">
      <Group
        v-for="p in projects"
        :key="p.id"
        gap="4"
        align="start"
        class="border-b border-border pb-4"
        data-slot="item"
      >
        <MediaFrame :alt="p.title" :src="p.image" ratio="1/1" class="size-16 shrink-0" />
        <Stack gap="2" align="stretch" class="flex-1">
          <Group gap="4" justify="between">
            <Text size="sm" weight="semibold">
              {{ p.title }}
            </Text>
            <Text size="xs" class="text-muted-foreground">
              {{ p.year }}
            </Text>
          </Group>
          <Text size="sm" class="text-muted-foreground">
            {{ p.summary }}
          </Text>
        </Stack>
      </Group>
    </Stack>
    <ProjectTiles v-else :projects="projects" :labels="labels" :layout="layout" />
    <template #aside>
      <Box class="grid grid-cols-2 gap-4" data-slot="collage">
        <MediaFrame :alt="title" ratio="3/4" />
        <MediaFrame :alt="title" ratio="3/4" class="mt-8" />
      </Box>
    </template>
  </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 project-grid
blocks/project-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.
/**
 * Projects of a studio or a person: cards with tags and links, a compact grid, tiles with the caption over the
 * picture, a bento with one big project, or a list beside a collage. Axes: layout (cards, compact, overlay,
 * bento, list), tone, density.
 */
import { For, type JSX } from "solid-js";
import { Box, Group, Stack, Text } from "../compose";
import { EmptyState } from "../components/empty-state";
import { MediaFrame } from "../components/media-frame";
import { ProjectTiles } from "../components/project-tiles";
import { SectionFrame } from "../components/section-frame";
import type { Project, ProjectLabels } from "./project-grid.types";

export type ProjectGridProps = {
  id: string;
  title: string;
  lead?: string;
  projects: Project[];
  empty?: string;
  labels: ProjectLabels;
  layout?: "cards" | "compact" | "overlay" | "bento" | "list";
  tone?: "default" | "muted";
  density?: "default" | "compact";
  landmarkLabel?: string;
};

export function ProjectGrid({
  id,
  title,
  lead = "",
  projects,
  empty = "",
  labels,
  layout = "cards",
  tone = "default",
  density = "default",
  landmarkLabel,
}: ProjectGridProps) {
  return (
    <SectionFrame
      id={id}
      title={title}
      lead={lead}
      tone={tone}
      density={density}
      layout={(((layout as string) === "list") ? "split" : "stack")}
      media={{ show: ((layout as string) === "list"), align: "start" }}
      landmarkLabel={landmarkLabel}
      aside={(
        <Box class="grid grid-cols-2 gap-4" data-slot="collage">
          <MediaFrame alt={title} ratio="3/4" />
          <MediaFrame alt={title} ratio="3/4" class="mt-8" />
        </Box>
      )}
    >
      {((projects?.length ?? 0) === 0) ? (
        <EmptyState icon="folder-open" title={empty} />
      ) : ((layout as string) === "list") ? (
        <Stack gap="4" align="stretch" data-slot="items">
          <For each={projects ?? []}>{(p) => (
            <Group gap="4" align="start" class="border-b border-border pb-4" data-slot="item">
              <MediaFrame alt={p.title} src={p.image} ratio="1/1" class="size-16 shrink-0" />
              <Stack gap="2" align="stretch" class="flex-1">
                <Group gap="4" justify="between">
                  <Text size="sm" weight="semibold">
                    {p.title}
                  </Text>
                  <Text size="xs" class="text-muted-foreground">
                    {p.year}
                  </Text>
                </Group>
                <Text size="sm" class="text-muted-foreground">
                  {p.summary}
                </Text>
              </Stack>
            </Group>
          )}</For>
        </Stack>
      ) : (
        <ProjectTiles projects={projects} labels={labels} layout={layout} />
      )}
    </SectionFrame>
  );
}
blocks/project-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 Project = {
  id: string;
  title: string;
  category: string;
  year: number;
  summary: string;
  tags: string[];
  featured: boolean;
  client: string;
  href?: string;
  image?: string;
};

export type ProjectLabels = {
  featured: string;
  view: string;
  case: 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 project-grid
blocks/project-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/project-grid.json

package blocks

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

// ProjectGridProps are the props of ProjectGrid; the values are the JSON shapes of the TypeScript props.
type ProjectGridProps struct {
	Id any `json:"id"`
	Title any `json:"title"`
	Lead any `json:"lead"`
	Projects any `json:"projects"`
	Empty any `json:"empty"`
	Labels any `json:"labels"`
	Layout any `json:"layout"`
	Tone any `json:"tone"`
	Density any `json:"density"`
	LandmarkLabel any `json:"landmarkLabel"`
}

// Projects of a studio or a person: cards with tags and links, a compact grid, tiles with the caption over the picture, a bento with one big project, or a list beside a collage. Axes: layout (cards, compact, overlay, bento, list), tone, density.
templ ProjectGrid(p ProjectGridProps) {
	{{ vId := p.Id }}
	{{ vTitle := p.Title }}
	{{ vLead := uiutils.Def(p.Lead, "") }}
	{{ vProjects := p.Projects }}
	{{ vEmpty := uiutils.Def(p.Empty, "") }}
	{{ vLabels := p.Labels }}
	{{ vLayout := uiutils.Def(p.Layout, "cards") }}
	{{ vTone := uiutils.Def(p.Tone, "default") }}
	{{ vDensity := uiutils.Def(p.Density, "default") }}
	{{ vLandmarkLabel := p.LandmarkLabel }}
	@SectionFrame(SectionFrameProps{Id: vId, Title: vTitle, Lead: vLead, Tone: vTone, Density: vDensity, Layout: uiutils.Cond(uiutils.T(uiutils.Eq(vLayout, "list")), "split", "stack"), Media: map[string]any{"show": uiutils.Eq(vLayout, "list"), "align": "start"}, LandmarkLabel: vLandmarkLabel, Aside: projectGridFill1(p, vTitle)}) {
		if uiutils.Eq(uiutils.Len(vProjects), float64(0)) {
			@EmptyState(EmptyStateProps{Icon: "folder-open", Title: vEmpty})
		} else if uiutils.Eq(vLayout, "list") {
			@compose.Stack(compose.StackProps{Gap: "4", Align: "stretch", BoxProps: box.BoxProps{Attrs: uiutils.Attrs("data-slot", "items")}}) {
				for _, vP := range uiutils.L(vProjects) {
					@compose.Group(compose.GroupProps{Gap: "4", Align: "start", BoxProps: box.BoxProps{Class: "border-b border-border pb-4", Attrs: uiutils.Attrs("data-slot", "item")}}) {
						@MediaFrame(MediaFrameProps{Alt: uiutils.Get(vP, "title"), Src: uiutils.Get(vP, "image"), Ratio: "1/1", Class: uiutils.Cnv("size-16 shrink-0")})
						@compose.Stack(compose.StackProps{Gap: "2", Align: "stretch", BoxProps: box.BoxProps{Class: "flex-1"}}) {
							@compose.Group(compose.GroupProps{Gap: "4", Justify: "between", BoxProps: box.BoxProps{}}) {
								@compose.Text(compose.TextProps{Size: "sm", Weight: "semibold", TextProps: text.TextProps{}}) {
									{ uiutils.Text(uiutils.Get(vP, "title")) }
								}
								@compose.Text(compose.TextProps{Size: "xs", TextProps: text.TextProps{Class: "text-muted-foreground"}}) {
									{ uiutils.Text(uiutils.Get(vP, "year")) }
								}
							}
							@compose.Text(compose.TextProps{Size: "sm", TextProps: text.TextProps{Class: "text-muted-foreground"}}) {
								{ uiutils.Text(uiutils.Get(vP, "summary")) }
							}
						}
					}
				}
			}
		} else {
			@ProjectTiles(ProjectTilesProps{Projects: vProjects, Labels: vLabels, Layout: vLayout})
		}
	}
}

templ projectGridFill1(p ProjectGridProps, vTitle any) {
	@compose.Box(compose.BoxProps{BoxProps: box.BoxProps{Class: "grid grid-cols-2 gap-4", Attrs: uiutils.Attrs("data-slot", "collage")}}) {
		@MediaFrame(MediaFrameProps{Alt: vTitle, Ratio: "3/4"})
		@MediaFrame(MediaFrameProps{Alt: vTitle, Ratio: "3/4", Class: uiutils.Cnv("mt-8")})
	}
}

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 project-grid
blocks/project-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/project-grid.json
    Projects of a studio or a person: cards with tags and links, a compact grid, tiles with the caption over the picture, a bento with one big project, or a list beside a collage. Axes: layout (cards, compact, overlay, bento, list), tone, density.
    Props (p): id, title, lead, projects, empty, labels, layout, tone, density, landmarkLabel. -#}
{%- set v_id = (p.id ?? null) -%}
{%- set v_title = (p.title ?? null) -%}
{%- set v_lead = (p.lead ?? '') -%}
{%- set v_projects = (p.projects ?? null) -%}
{%- set v_empty = (p.empty ?? '') -%}
{%- set v_labels = (p.labels ?? null) -%}
{%- set v_layout = (p.layout ?? 'cards') -%}
{%- set v_tone = (p.tone ?? 'default') -%}
{%- set v_density = (p.density ?? 'default') -%}
{%- set v_landmarkLabel = (p.landmarkLabel ?? null) -%}
{%- set f_8 -%}
  {%- set c_9 -%}
    {{ include('blocks/media-frame.html.twig', {'p': {'alt': v_title, 'ratio': '3/4'}}, with_context = false) }}
    {{ include('blocks/media-frame.html.twig', {'p': {'alt': v_title, 'ratio': '3/4', 'className': og_cnv(['mt-8'])}}, with_context = false) }}
  {%- endset -%}
  {{ include('compose/Box.html.twig', {'class': 'grid grid-cols-2 gap-4', 'attrs': og_attrs(['data-slot', 'collage']), 'children': c_9}, with_context = false) }}
{%- endset -%}
{%- set c_10 -%}
  {%- if og_t(og_eq(og_len(v_projects), 0)) %}
    {{ include('blocks/empty-state.html.twig', {'p': {'icon': 'folder-open', 'title': v_empty}}, with_context = false) }}
  {%- elseif og_t(og_eq(v_layout, 'list')) %}
    {%- set c_7 -%}
      {%- for v_p in og_l(v_projects) %}
        {%- set c_6 -%}
          {{ include('blocks/media-frame.html.twig', {'p': {'alt': og_get(v_p, ['title']), 'src': og_get(v_p, ['image']), 'ratio': '1/1', 'className': og_cnv(['size-16 shrink-0'])}}, with_context = false) }}
          {%- set c_5 -%}
            {%- set c_3 -%}
              {%- set c_1 -%}
                {{ og_text(og_get(v_p, ['title'])) }}
              {%- endset -%}
              {{ include('compose/Text.html.twig', {'size': 'sm', 'weight': 'semibold', 'children': c_1}, with_context = false) }}
              {%- set c_2 -%}
                {{ og_text(og_get(v_p, ['year'])) }}
              {%- endset -%}
              {{ include('compose/Text.html.twig', {'size': 'xs', 'class': 'text-muted-foreground', 'children': c_2}, with_context = false) }}
            {%- endset -%}
            {{ include('compose/Group.html.twig', {'gap': '4', 'justify': 'between', 'children': c_3}, with_context = false) }}
            {%- set c_4 -%}
              {{ og_text(og_get(v_p, ['summary'])) }}
            {%- endset -%}
            {{ include('compose/Text.html.twig', {'size': 'sm', 'class': 'text-muted-foreground', 'children': c_4}, with_context = false) }}
          {%- endset -%}
          {{ include('compose/Stack.html.twig', {'gap': '2', 'align': 'stretch', 'class': 'flex-1', 'children': c_5}, with_context = false) }}
        {%- endset -%}
        {{ include('compose/Group.html.twig', {'gap': '4', 'align': 'start', 'class': 'border-b border-border pb-4', 'attrs': og_attrs(['data-slot', 'item']), 'children': c_6}, with_context = false) }}
      {%- endfor %}
    {%- endset -%}
    {{ include('compose/Stack.html.twig', {'gap': '4', 'align': 'stretch', 'attrs': og_attrs(['data-slot', 'items']), 'children': c_7}, with_context = false) }}
  {%- else %}
    {{ include('blocks/project-tiles.html.twig', {'p': {'projects': v_projects, 'labels': v_labels, 'layout': v_layout}}, with_context = false) }}
  {%- endif %}
{%- endset -%}
{{ include('blocks/section-frame.html.twig', {'p': {'id': v_id, 'title': v_title, 'lead': v_lead, 'tone': v_tone, 'density': v_density, 'layout': (og_t(og_eq(v_layout, 'list')) ? 'split' : 'stack'), 'media': {'show': og_eq(v_layout, 'list'), 'align': 'start'}, 'landmarkLabel': v_landmarkLabel, 'aside': og_markup(f_8)}, 'children': og_markup(c_10)}, 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 project-grid
blocks/project-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/project-grid.json
    Projects of a studio or a person: cards with tags and links, a compact grid, tiles with the caption over the picture, a bento with one big project, or a list beside a collage. Axes: layout (cards, compact, overlay, bento, list), tone, density.
    Props (p): id, title, lead, projects, empty, labels, layout, tone, density, landmarkLabel. *}
{var $v_id = ($p['id'] ?? null)}
{var $v_title = ($p['title'] ?? null)}
{var $v_lead = ($p['lead'] ?? '')}
{var $v_projects = ($p['projects'] ?? null)}
{var $v_empty = ($p['empty'] ?? '')}
{var $v_labels = ($p['labels'] ?? null)}
{var $v_layout = ($p['layout'] ?? 'cards')}
{var $v_tone = ($p['tone'] ?? 'default')}
{var $v_density = ($p['density'] ?? 'default')}
{var $v_landmarkLabel = ($p['landmarkLabel'] ?? null)}
{capture $f_8}
  {capture $c_9}
    {=og_include('blocks/media-frame.latte', ['p' => ['alt' => $v_title, 'ratio' => '3/4']])|noescape}
    {=og_include('blocks/media-frame.latte', ['p' => ['alt' => $v_title, 'ratio' => '3/4', 'className' => og_cnv(['mt-8'])]])|noescape}
  {/capture}
  {=og_include('compose/Box.latte', ['class' => 'grid grid-cols-2 gap-4', 'attrs' => og_attrs(['data-slot', 'collage']), 'children' => (string) $c_9])|noescape}
{/capture}
{capture $c_10}
  {if og_t(og_eq(og_len($v_projects), 0))}
    {=og_include('blocks/empty-state.latte', ['p' => ['icon' => 'folder-open', 'title' => $v_empty]])|noescape}
  {elseif og_t(og_eq($v_layout, 'list'))}
    {capture $c_7}
      {foreach og_l($v_projects) as $v_p}
        {capture $c_6}
          {=og_include('blocks/media-frame.latte', ['p' => ['alt' => og_get($v_p, ['title']), 'src' => og_get($v_p, ['image']), 'ratio' => '1/1', 'className' => og_cnv(['size-16 shrink-0'])]])|noescape}
          {capture $c_5}
            {capture $c_3}
              {capture $c_1}
                {=og_text(og_get($v_p, ['title']))}
              {/capture}
              {=og_include('compose/Text.latte', ['size' => 'sm', 'weight' => 'semibold', 'children' => (string) $c_1])|noescape}
              {capture $c_2}
                {=og_text(og_get($v_p, ['year']))}
              {/capture}
              {=og_include('compose/Text.latte', ['size' => 'xs', 'class' => 'text-muted-foreground', 'children' => (string) $c_2])|noescape}
            {/capture}
            {=og_include('compose/Group.latte', ['gap' => '4', 'justify' => 'between', 'children' => (string) $c_3])|noescape}
            {capture $c_4}
              {=og_text(og_get($v_p, ['summary']))}
            {/capture}
            {=og_include('compose/Text.latte', ['size' => 'sm', 'class' => 'text-muted-foreground', 'children' => (string) $c_4])|noescape}
          {/capture}
          {=og_include('compose/Stack.latte', ['gap' => '2', 'align' => 'stretch', 'class' => 'flex-1', 'children' => (string) $c_5])|noescape}
        {/capture}
        {=og_include('compose/Group.latte', ['gap' => '4', 'align' => 'start', 'class' => 'border-b border-border pb-4', 'attrs' => og_attrs(['data-slot', 'item']), 'children' => (string) $c_6])|noescape}
      {/foreach}
    {/capture}
    {=og_include('compose/Stack.latte', ['gap' => '4', 'align' => 'stretch', 'attrs' => og_attrs(['data-slot', 'items']), 'children' => (string) $c_7])|noescape}
  {else}
    {=og_include('blocks/project-tiles.latte', ['p' => ['projects' => $v_projects, 'labels' => $v_labels, 'layout' => $v_layout]])|noescape}
  {/if}
{/capture}
{=og_include('blocks/section-frame.latte', ['p' => ['id' => $v_id, 'title' => $v_title, 'lead' => $v_lead, 'tone' => $v_tone, 'density' => $v_density, 'layout' => (og_t(og_eq($v_layout, 'list')) ? 'split' : 'stack'), 'media' => ['show' => og_eq($v_layout, 'list'), 'align' => 'start'], 'landmarkLabel' => $v_landmarkLabel, 'aside' => og_markup($f_8)], 'children' => og_markup($c_10)])|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 project-grid
blocks/project-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/project-grid.json
    Projects of a studio or a person: cards with tags and links, a compact grid, tiles with the caption over the picture, a bento with one big project, or a list beside a collage. Axes: layout (cards, compact, overlay, bento, list), tone, density.
    Props (p): id, title, lead, projects, empty, labels, layout, tone, density, 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_projects = og_def(p['projects'], none) -%}
{%- set v_empty = og_def(p['empty'], '') -%}
{%- 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_density = og_def(p['density'], 'default') -%}
{%- set v_landmarkLabel = og_def(p['landmarkLabel'], none) -%}
{%- set f_8 -%}
  {%- set c_9 -%}
    {{ og_include('blocks/media-frame.html.j2', {'p': {'alt': v_title, 'ratio': '3/4'}}) }}
    {{ og_include('blocks/media-frame.html.j2', {'p': {'alt': v_title, 'ratio': '3/4', 'className': og_cnv(['mt-8'])}}) }}
  {%- endset -%}
  {{ og_include('compose/box.html.j2', {'p': {'Class': 'grid grid-cols-2 gap-4', 'Attrs': og_attrs(['data-slot', 'collage'])}, 'children': c_9}) }}
{%- endset -%}
{%- set c_10 -%}
  {%- if og_t(og_eq(og_len(v_projects), 0)) %}
    {{ og_include('blocks/empty-state.html.j2', {'p': {'icon': 'folder-open', 'title': v_empty}}) }}
  {%- elif og_t(og_eq(v_layout, 'list')) %}
    {%- set c_7 -%}
      {%- for v_p in og_l(v_projects) %}
        {%- set c_6 -%}
          {{ og_include('blocks/media-frame.html.j2', {'p': {'alt': og_get(v_p, ['title']), 'src': og_get(v_p, ['image']), 'ratio': '1/1', 'className': og_cnv(['size-16 shrink-0'])}}) }}
          {%- set c_5 -%}
            {%- set c_3 -%}
              {%- set c_1 -%}
                {{ og_text(og_get(v_p, ['title'])) }}
              {%- endset -%}
              {{ og_include('compose/text.html.j2', {'p': {'Size': 'sm', 'Weight': 'semibold'}, 'children': c_1}) }}
              {%- set c_2 -%}
                {{ og_text(og_get(v_p, ['year'])) }}
              {%- endset -%}
              {{ og_include('compose/text.html.j2', {'p': {'Size': 'xs', 'Class': 'text-muted-foreground'}, 'children': c_2}) }}
            {%- endset -%}
            {{ og_include('compose/group.html.j2', {'p': {'Gap': '4', 'Justify': 'between'}, 'children': c_3}) }}
            {%- set c_4 -%}
              {{ og_text(og_get(v_p, ['summary'])) }}
            {%- endset -%}
            {{ og_include('compose/text.html.j2', {'p': {'Size': 'sm', 'Class': 'text-muted-foreground'}, 'children': c_4}) }}
          {%- endset -%}
          {{ og_include('compose/stack.html.j2', {'p': {'Gap': '2', 'Align': 'stretch', 'Class': 'flex-1'}, 'children': c_5}) }}
        {%- endset -%}
        {{ og_include('compose/group.html.j2', {'p': {'Gap': '4', 'Align': 'start', 'Class': 'border-b border-border pb-4', 'Attrs': og_attrs(['data-slot', 'item'])}, 'children': c_6}) }}
      {%- endfor %}
    {%- endset -%}
    {{ og_include('compose/stack.html.j2', {'p': {'Gap': '4', 'Align': 'stretch', 'Attrs': og_attrs(['data-slot', 'items'])}, 'children': c_7}) }}
  {%- else %}
    {{ og_include('blocks/project-tiles.html.j2', {'p': {'projects': v_projects, 'labels': v_labels, 'layout': v_layout}}) }}
  {%- endif %}
{%- endset -%}
{{ og_include('blocks/section-frame.html.j2', {'p': {'id': v_id, 'title': v_title, 'lead': v_lead, 'tone': v_tone, 'density': v_density, 'layout': ('split' if og_t(og_eq(v_layout, 'list')) else 'stack'), 'media': {'show': og_eq(v_layout, 'list'), 'align': 'start'}, 'landmarkLabel': v_landmarkLabel, 'aside': og_markup(f_8)}, 'children': og_markup(c_10)}) }}

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.

Projects of a studio or a person: cards with tags and links, a compact grid, tiles with the caption over the picture, a bento with one big project, or a list beside a collage. Axes: layout (cards, compact, overlay, bento, list), tone, density.

Props of ProjectGrid
PropTypeDefault Description
id (required)string-
title (required)string-
lead string""
projects (required)Project[]-
empty string""the text of the empty state (no records), from the dictionary
labels (required)ProjectLabels-
layout "cards" | "compact" | "overlay" | "bento" | "list""cards"
tone "default" | "muted""default"
density "default" | "compact""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

Used in