Skip to content
ui8kit

component / components

Job Cards

Job Cards component

Install

npx ui8kit add job-cards

Pulls in: badge, box, compose, grid, group, inline, job-board, kit-box, kit-text, lucide-icon, menu-entry, stack, table, table-body, table-caption, table-cell, table-head, table-head-cell, table-row, text, utils

Preview

Open roles
RoleTypeApply
Senior Frontend EngineerFull timeApply
Platform EngineerFull timeApply
Product DesignerFull timeApply
Brand DesignerContractApply
Customer Success LeadFull timeApply
Technical WriterPart timeApply

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 job-cards
components/job-cards.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 jobs of JobBoard as cards in two columns (title, department, place, type, optional salary, posted, apply)
  or as a table.
-->
<script lang="ts" module>
  import type { Snippet } from "svelte";
  import type { Job, Department, JobLabels } from "../blocks/job-board.types";

  export type JobCardsProps = {
    jobs: Job[];
    departments: Department[];
    labels: JobLabels;
    layout?: "grid" | "grouped" | "table";
    salary?: "show" | "hide";
  };
</script>

<script lang="ts">
  import Badge from "../compose/Badge.svelte";
  import Box from "../compose/Box.svelte";
  import Grid from "../compose/Grid.svelte";
  import Group from "../compose/Group.svelte";
  import Inline from "../compose/Inline.svelte";
  import LucideIcon from "../icons/LucideIcon.svelte";
  import Stack from "../compose/Stack.svelte";
  import Table from "../compose/Table.svelte";
  import TableBody from "../compose/TableBody.svelte";
  import TableCaption from "../compose/TableCaption.svelte";
  import TableCell from "../compose/TableCell.svelte";
  import TableHead from "../compose/TableHead.svelte";
  import TableHeadCell from "../compose/TableHeadCell.svelte";
  import TableRow from "../compose/TableRow.svelte";
  import Text from "../compose/Text.svelte";
  import MenuEntry from "../components/menu-entry.svelte";

  let { jobs, departments, labels, layout = "grid", salary = "hide" }: JobCardsProps = $props();
</script>

{#if ((layout as string) === "table")}
  <Box class="w-full overflow-x-auto rounded inset-ring inset-ring-border" data-slot="job-cards">
    <Table class="w-full text-left text-sm" data-slot="job-table">
      <TableCaption class="sr-only">
        {labels.caption}
      </TableCaption>
      <TableHead class="bg-muted">
        <TableRow>
          <TableHeadCell scope="col" class="px-4 py-2">
            {labels.role}
          </TableHeadCell>
          <TableHeadCell scope="col" class="hidden py-2 md:table-cell">
            {labels.team}
          </TableHeadCell>
          <TableHeadCell scope="col" class="hidden py-2 sm:table-cell">
            {labels.location}
          </TableHeadCell>
          <TableHeadCell scope="col" class="py-2">
            {labels.type}
          </TableHeadCell>
          {#if ((salary as string) === "show")}
            <TableHeadCell scope="col" class="hidden py-2 md:table-cell">
              {labels.salary}
            </TableHeadCell>
          {/if}
          <TableHeadCell scope="col" class="py-2 pr-4">
            <Inline class="sr-only">
              {labels.apply}
            </Inline>
          </TableHeadCell>
        </TableRow>
      </TableHead>
      <TableBody>
        {#each jobs as j (j.id)}
          <TableRow class="border-t border-border" data-slot="item">
            <TableCell class="px-4 py-4 font-medium">
              {j.title}
            </TableCell>
            <TableCell class="hidden md:table-cell">
              {departments.filter((i) => !j.dept || i["id"] === j.dept)[0]?.name ?? ""}
            </TableCell>
            <TableCell class="hidden sm:table-cell">
              {j.location}
            </TableCell>
            <TableCell>
              {j.type}
            </TableCell>
            {#if ((salary as string) === "show")}
              <TableCell class="hidden md:table-cell">
                {j.salary}
              </TableCell>
            {/if}
            <TableCell class="pr-4 text-right">
              <MenuEntry href={j.href} class="font-medium">
                {labels.apply}
              </MenuEntry>
            </TableCell>
          </TableRow>
        {/each}
      </TableBody>
    </Table>
  </Box>
{:else}
  <Grid cols="1-2" class="gap-4" data-slot="items">
    {#each jobs as j (j.id)}
      <Stack gap="4" class="rounded bg-card inset-ring inset-ring-border p-6" data-slot="item">
        <Stack gap="2">
          <Text size="lg" weight="semibold">
            {j.title}
          </Text>
          <Group gap="4" class="flex-wrap text-sm text-muted-foreground">
            <Group gap="2" align="center">
              <LucideIcon name="briefcase" size={16} />
              <Inline>
                {j.type}
              </Inline>
            </Group>
            <Group gap="2" align="center">
              <LucideIcon name="map-pin" size={16} />
              <Inline>
                {j.location}
              </Inline>
            </Group>
            <Group gap="2" align="center">
              <LucideIcon name="calendar" size={16} />
              <Inline>
                {j.posted}
              </Inline>
            </Group>
          </Group>
        </Stack>
        {#if ((salary as string) === "show")}
          <Text size="base" weight="semibold" data-slot="salary">
            {j.salary}
          </Text>
        {/if}
        <Group gap="4" align="center" justify="between" class="mt-auto">
          <Badge variant="secondary" size="default">
            {departments.filter((i) => !j.dept || i["id"] === j.dept)[0]?.name ?? ""}
          </Badge>
          <MenuEntry href={j.href} class="inline-flex items-center gap-2 text-sm font-medium">
            {labels.apply}
            <LucideIcon name="arrow-right" size={16} />
          </MenuEntry>
        </Group>
      </Stack>
    {/each}
  </Grid>
{/if}

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 job-cards
components/job-cards.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 jobs of JobBoard as cards in two columns (title, department, place, type, optional salary, posted, apply)
 * or as a table.
 */
import { type ReactNode } from "react";
import { Badge, Box, Grid, Group, Inline, Stack, Table, TableBody, TableCaption, TableCell, TableHead, TableHeadCell, TableRow, Text } from "../compose";
import { LucideIcon } from "../icons/LucideIcon";
import { MenuEntry } from "../components/menu-entry";
import type { Job, Department, JobLabels } from "../blocks/job-board.types";

export type JobCardsProps = {
  jobs: Job[];
  departments: Department[];
  labels: JobLabels;
  layout?: "grid" | "grouped" | "table";
  salary?: "show" | "hide";
};

export function JobCards({ jobs, departments, labels, layout = "grid", salary = "hide" }: JobCardsProps) {
  return (
    <>
      {((layout as string) === "table") ? (
        <Box className="w-full overflow-x-auto rounded inset-ring inset-ring-border" data-slot="job-cards">
          <Table className="w-full text-left text-sm" data-slot="job-table">
            <TableCaption className="sr-only">
              {labels.caption}
            </TableCaption>
            <TableHead className="bg-muted">
              <TableRow>
                <TableHeadCell scope="col" className="px-4 py-2">
                  {labels.role}
                </TableHeadCell>
                <TableHeadCell scope="col" className="hidden py-2 md:table-cell">
                  {labels.team}
                </TableHeadCell>
                <TableHeadCell scope="col" className="hidden py-2 sm:table-cell">
                  {labels.location}
                </TableHeadCell>
                <TableHeadCell scope="col" className="py-2">
                  {labels.type}
                </TableHeadCell>
                {((salary as string) === "show") ? (
                  <TableHeadCell scope="col" className="hidden py-2 md:table-cell">
                    {labels.salary}
                  </TableHeadCell>
                ) : null}
                <TableHeadCell scope="col" className="py-2 pr-4">
                  <Inline className="sr-only">
                    {labels.apply}
                  </Inline>
                </TableHeadCell>
              </TableRow>
            </TableHead>
            <TableBody>
              {(jobs ?? []).map((j) => (
                <TableRow key={j.id} className="border-t border-border" data-slot="item">
                  <TableCell className="px-4 py-4 font-medium">
                    {j.title}
                  </TableCell>
                  <TableCell className="hidden md:table-cell">
                    {departments.filter((i) => !j.dept || i["id"] === j.dept)[0]?.name ?? ""}
                  </TableCell>
                  <TableCell className="hidden sm:table-cell">
                    {j.location}
                  </TableCell>
                  <TableCell>
                    {j.type}
                  </TableCell>
                  {((salary as string) === "show") ? (
                    <TableCell className="hidden md:table-cell">
                      {j.salary}
                    </TableCell>
                  ) : null}
                  <TableCell className="pr-4 text-right">
                    <MenuEntry href={j.href} className="font-medium">
                      {labels.apply}
                    </MenuEntry>
                  </TableCell>
                </TableRow>
              ))}
            </TableBody>
          </Table>
        </Box>
      ) : (
        <Grid cols="1-2" className="gap-4" data-slot="items">
          {(jobs ?? []).map((j) => (
            <Stack key={j.id} gap="4" className="rounded bg-card inset-ring inset-ring-border p-6" data-slot="item">
              <Stack gap="2">
                <Text size="lg" weight="semibold">
                  {j.title}
                </Text>
                <Group gap="4" className="flex-wrap text-sm text-muted-foreground">
                  <Group gap="2" align="center">
                    <LucideIcon name="briefcase" size={16} />
                    <Inline>
                      {j.type}
                    </Inline>
                  </Group>
                  <Group gap="2" align="center">
                    <LucideIcon name="map-pin" size={16} />
                    <Inline>
                      {j.location}
                    </Inline>
                  </Group>
                  <Group gap="2" align="center">
                    <LucideIcon name="calendar" size={16} />
                    <Inline>
                      {j.posted}
                    </Inline>
                  </Group>
                </Group>
              </Stack>
              {((salary as string) === "show") ? (
                <Text size="base" weight="semibold" data-slot="salary">
                  {j.salary}
                </Text>
              ) : null}
              <Group gap="4" align="center" justify="between" className="mt-auto">
                <Badge variant="secondary" size="default">
                  {departments.filter((i) => !j.dept || i["id"] === j.dept)[0]?.name ?? ""}
                </Badge>
                <MenuEntry href={j.href} className="inline-flex items-center gap-2 text-sm font-medium">
                  {labels.apply}
                  <LucideIcon name="arrow-right" size={16} />
                </MenuEntry>
              </Group>
            </Stack>
          ))}
        </Grid>
      )}
    </>
  );
}

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 job-cards
components/job-cards.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 jobs of JobBoard as cards in two columns (title, department, place, type, optional salary, posted, apply)
  or as a table.
-->
<script lang="ts">
import type { Job, Department, JobLabels } from "../blocks/job-board.types";

export type JobCardsProps = {
  jobs: Job[];
  departments: Department[];
  labels: JobLabels;
  layout?: "grid" | "grouped" | "table";
  salary?: "show" | "hide";
};
</script>

<script setup lang="ts">
import Badge from "../compose/Badge.vue";
import Box from "../compose/Box.vue";
import Grid from "../compose/Grid.vue";
import Group from "../compose/Group.vue";
import Inline from "../compose/Inline.vue";
import LucideIcon from "../icons/LucideIcon.vue";
import Stack from "../compose/Stack.vue";
import Table from "../compose/Table.vue";
import TableBody from "../compose/TableBody.vue";
import TableCaption from "../compose/TableCaption.vue";
import TableCell from "../compose/TableCell.vue";
import TableHead from "../compose/TableHead.vue";
import TableHeadCell from "../compose/TableHeadCell.vue";
import TableRow from "../compose/TableRow.vue";
import Text from "../compose/Text.vue";
import MenuEntry from "../components/menu-entry.vue";

const { jobs, departments, labels, layout = "grid", salary = "hide" } = defineProps<JobCardsProps>();
</script>

<template>
  <Box
    v-if="((layout as string) === 'table')"
    class="w-full overflow-x-auto rounded inset-ring inset-ring-border"
    data-slot="job-cards"
  >
    <Table class="w-full text-left text-sm" data-slot="job-table">
      <TableCaption class="sr-only">
        {{ labels.caption }}
      </TableCaption>
      <TableHead class="bg-muted">
        <TableRow>
          <TableHeadCell scope="col" class="px-4 py-2">
            {{ labels.role }}
          </TableHeadCell>
          <TableHeadCell scope="col" class="hidden py-2 md:table-cell">
            {{ labels.team }}
          </TableHeadCell>
          <TableHeadCell scope="col" class="hidden py-2 sm:table-cell">
            {{ labels.location }}
          </TableHeadCell>
          <TableHeadCell scope="col" class="py-2">
            {{ labels.type }}
          </TableHeadCell>
          <TableHeadCell v-if="((salary as string) === 'show')" scope="col" class="hidden py-2 md:table-cell">
            {{ labels.salary }}
          </TableHeadCell>
          <TableHeadCell scope="col" class="py-2 pr-4">
            <Inline class="sr-only">
              {{ labels.apply }}
            </Inline>
          </TableHeadCell>
        </TableRow>
      </TableHead>
      <TableBody>
        <TableRow v-for="j in jobs" :key="j.id" class="border-t border-border" data-slot="item">
          <TableCell class="px-4 py-4 font-medium">
            {{ j.title }}
          </TableCell>
          <TableCell class="hidden md:table-cell">
            {{ departments.filter((i) => !j.dept || i["id"] === j.dept)[0]?.name ?? "" }}
          </TableCell>
          <TableCell class="hidden sm:table-cell">
            {{ j.location }}
          </TableCell>
          <TableCell>
            {{ j.type }}
          </TableCell>
          <TableCell v-if="((salary as string) === 'show')" class="hidden md:table-cell">
            {{ j.salary }}
          </TableCell>
          <TableCell class="pr-4 text-right">
            <MenuEntry :href="j.href" class="font-medium">
              {{ labels.apply }}
            </MenuEntry>
          </TableCell>
        </TableRow>
      </TableBody>
    </Table>
  </Box>
  <Grid v-else cols="1-2" class="gap-4" data-slot="items">
    <Stack
      v-for="j in jobs"
      :key="j.id"
      gap="4"
      class="rounded bg-card inset-ring inset-ring-border p-6"
      data-slot="item"
    >
      <Stack gap="2">
        <Text size="lg" weight="semibold">
          {{ j.title }}
        </Text>
        <Group gap="4" class="flex-wrap text-sm text-muted-foreground">
          <Group gap="2" align="center">
            <LucideIcon name="briefcase" :size="16" />
            <Inline>
              {{ j.type }}
            </Inline>
          </Group>
          <Group gap="2" align="center">
            <LucideIcon name="map-pin" :size="16" />
            <Inline>
              {{ j.location }}
            </Inline>
          </Group>
          <Group gap="2" align="center">
            <LucideIcon name="calendar" :size="16" />
            <Inline>
              {{ j.posted }}
            </Inline>
          </Group>
        </Group>
      </Stack>
      <Text v-if="((salary as string) === 'show')" size="base" weight="semibold" data-slot="salary">
        {{ j.salary }}
      </Text>
      <Group gap="4" align="center" justify="between" class="mt-auto">
        <Badge variant="secondary" size="default">
          {{ departments.filter((i) => !j.dept || i["id"] === j.dept)[0]?.name ?? "" }}
        </Badge>
        <MenuEntry :href="j.href" class="inline-flex items-center gap-2 text-sm font-medium">
          {{ labels.apply }}
          <LucideIcon name="arrow-right" :size="16" />
        </MenuEntry>
      </Group>
    </Stack>
  </Grid>
</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 job-cards
components/job-cards.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 jobs of JobBoard as cards in two columns (title, department, place, type, optional salary, posted, apply)
 * or as a table.
 */
import { For, type JSX } from "solid-js";
import { Badge, Box, Grid, Group, Inline, Stack, Table, TableBody, TableCaption, TableCell, TableHead, TableHeadCell, TableRow, Text } from "../compose";
import { LucideIcon } from "../icons/LucideIcon";
import { MenuEntry } from "../components/menu-entry";
import type { Job, Department, JobLabels } from "../blocks/job-board.types";

export type JobCardsProps = {
  jobs: Job[];
  departments: Department[];
  labels: JobLabels;
  layout?: "grid" | "grouped" | "table";
  salary?: "show" | "hide";
};

export function JobCards({ jobs, departments, labels, layout = "grid", salary = "hide" }: JobCardsProps) {
  return (
    <>
      {((layout as string) === "table") ? (
        <Box class="w-full overflow-x-auto rounded inset-ring inset-ring-border" data-slot="job-cards">
          <Table class="w-full text-left text-sm" data-slot="job-table">
            <TableCaption class="sr-only">
              {labels.caption}
            </TableCaption>
            <TableHead class="bg-muted">
              <TableRow>
                <TableHeadCell scope="col" class="px-4 py-2">
                  {labels.role}
                </TableHeadCell>
                <TableHeadCell scope="col" class="hidden py-2 md:table-cell">
                  {labels.team}
                </TableHeadCell>
                <TableHeadCell scope="col" class="hidden py-2 sm:table-cell">
                  {labels.location}
                </TableHeadCell>
                <TableHeadCell scope="col" class="py-2">
                  {labels.type}
                </TableHeadCell>
                {((salary as string) === "show") ? (
                  <TableHeadCell scope="col" class="hidden py-2 md:table-cell">
                    {labels.salary}
                  </TableHeadCell>
                ) : null}
                <TableHeadCell scope="col" class="py-2 pr-4">
                  <Inline class="sr-only">
                    {labels.apply}
                  </Inline>
                </TableHeadCell>
              </TableRow>
            </TableHead>
            <TableBody>
              <For each={jobs ?? []}>{(j) => (
                <TableRow class="border-t border-border" data-slot="item">
                  <TableCell class="px-4 py-4 font-medium">
                    {j.title}
                  </TableCell>
                  <TableCell class="hidden md:table-cell">
                    {departments.filter((i) => !j.dept || i["id"] === j.dept)[0]?.name ?? ""}
                  </TableCell>
                  <TableCell class="hidden sm:table-cell">
                    {j.location}
                  </TableCell>
                  <TableCell>
                    {j.type}
                  </TableCell>
                  {((salary as string) === "show") ? (
                    <TableCell class="hidden md:table-cell">
                      {j.salary}
                    </TableCell>
                  ) : null}
                  <TableCell class="pr-4 text-right">
                    <MenuEntry href={j.href} class="font-medium">
                      {labels.apply}
                    </MenuEntry>
                  </TableCell>
                </TableRow>
              )}</For>
            </TableBody>
          </Table>
        </Box>
      ) : (
        <Grid cols="1-2" class="gap-4" data-slot="items">
          <For each={jobs ?? []}>{(j) => (
            <Stack gap="4" class="rounded bg-card inset-ring inset-ring-border p-6" data-slot="item">
              <Stack gap="2">
                <Text size="lg" weight="semibold">
                  {j.title}
                </Text>
                <Group gap="4" class="flex-wrap text-sm text-muted-foreground">
                  <Group gap="2" align="center">
                    <LucideIcon name="briefcase" size={16} />
                    <Inline>
                      {j.type}
                    </Inline>
                  </Group>
                  <Group gap="2" align="center">
                    <LucideIcon name="map-pin" size={16} />
                    <Inline>
                      {j.location}
                    </Inline>
                  </Group>
                  <Group gap="2" align="center">
                    <LucideIcon name="calendar" size={16} />
                    <Inline>
                      {j.posted}
                    </Inline>
                  </Group>
                </Group>
              </Stack>
              {((salary as string) === "show") ? (
                <Text size="base" weight="semibold" data-slot="salary">
                  {j.salary}
                </Text>
              ) : null}
              <Group gap="4" align="center" justify="between" class="mt-auto">
                <Badge variant="secondary" size="default">
                  {departments.filter((i) => !j.dept || i["id"] === j.dept)[0]?.name ?? ""}
                </Badge>
                <MenuEntry href={j.href} class="inline-flex items-center gap-2 text-sm font-medium">
                  {labels.apply}
                  <LucideIcon name="arrow-right" size={16} />
                </MenuEntry>
              </Group>
            </Stack>
          )}</For>
        </Grid>
      )}
    </>
  );
}

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 job-cards
blocks/job-cards.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/job-cards.json

package blocks

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

// JobCardsProps are the props of JobCards; the values are the JSON shapes of the TypeScript props.
type JobCardsProps struct {
	Jobs any `json:"jobs"`
	Departments any `json:"departments"`
	Labels any `json:"labels"`
	Layout any `json:"layout"`
	Salary any `json:"salary"`
}

// The jobs of JobBoard as cards in two columns (title, department, place, type, optional salary, posted, apply) or as a table.
templ JobCards(p JobCardsProps) {
	{{ vJobs := p.Jobs }}
	{{ vDepartments := p.Departments }}
	{{ vLabels := p.Labels }}
	{{ vLayout := uiutils.Def(p.Layout, "grid") }}
	{{ vSalary := uiutils.Def(p.Salary, "hide") }}
	if uiutils.Eq(vLayout, "table") {
		@compose.Box(compose.BoxProps{BoxProps: box.BoxProps{Class: "w-full overflow-x-auto rounded inset-ring inset-ring-border", Attrs: uiutils.Attrs("data-slot", "job-cards")}}) {
			@compose.Table(compose.TableProps{BoxProps: box.BoxProps{Class: "w-full text-left text-sm", Attrs: uiutils.Attrs("data-slot", "job-table")}}) {
				@compose.TableCaption(compose.TableCaptionProps{BoxProps: box.BoxProps{Class: "sr-only"}}) {
					{ uiutils.Text(uiutils.Get(vLabels, "caption")) }
				}
				@compose.TableHead(compose.TableHeadProps{BoxProps: box.BoxProps{Class: "bg-muted"}}) {
					@compose.TableRow(compose.TableRowProps{BoxProps: box.BoxProps{}}) {
						@compose.TableHeadCell(compose.TableHeadCellProps{BoxProps: box.BoxProps{Class: "px-4 py-2", Attrs: uiutils.Attrs("scope", "col")}}) {
							{ uiutils.Text(uiutils.Get(vLabels, "role")) }
						}
						@compose.TableHeadCell(compose.TableHeadCellProps{BoxProps: box.BoxProps{Class: "hidden py-2 md:table-cell", Attrs: uiutils.Attrs("scope", "col")}}) {
							{ uiutils.Text(uiutils.Get(vLabels, "team")) }
						}
						@compose.TableHeadCell(compose.TableHeadCellProps{BoxProps: box.BoxProps{Class: "hidden py-2 sm:table-cell", Attrs: uiutils.Attrs("scope", "col")}}) {
							{ uiutils.Text(uiutils.Get(vLabels, "location")) }
						}
						@compose.TableHeadCell(compose.TableHeadCellProps{BoxProps: box.BoxProps{Class: "py-2", Attrs: uiutils.Attrs("scope", "col")}}) {
							{ uiutils.Text(uiutils.Get(vLabels, "type")) }
						}
						if uiutils.Eq(vSalary, "show") {
							@compose.TableHeadCell(compose.TableHeadCellProps{BoxProps: box.BoxProps{Class: "hidden py-2 md:table-cell", Attrs: uiutils.Attrs("scope", "col")}}) {
								{ uiutils.Text(uiutils.Get(vLabels, "salary")) }
							}
						}
						@compose.TableHeadCell(compose.TableHeadCellProps{BoxProps: box.BoxProps{Class: "py-2 pr-4", Attrs: uiutils.Attrs("scope", "col")}}) {
							@compose.Inline(compose.InlineProps{TextProps: text.TextProps{Class: "sr-only"}}) {
								{ uiutils.Text(uiutils.Get(vLabels, "apply")) }
							}
						}
					}
				}
				@compose.TableBody(compose.TableBodyProps{BoxProps: box.BoxProps{}}) {
					for _, vJ := range uiutils.L(vJobs) {
						@compose.TableRow(compose.TableRowProps{BoxProps: box.BoxProps{Class: "border-t border-border", Attrs: uiutils.Attrs("data-slot", "item")}}) {
							@compose.TableCell(compose.TableCellProps{BoxProps: box.BoxProps{Class: "px-4 py-4 font-medium"}}) {
								{ uiutils.Text(uiutils.Get(vJ, "title")) }
							}
							@compose.TableCell(compose.TableCellProps{BoxProps: box.BoxProps{Class: "hidden md:table-cell"}}) {
								{ uiutils.Text(uiutils.FirstOf(uiutils.Where(vDepartments, "id", uiutils.Get(vJ, "dept")), "name")) }
							}
							@compose.TableCell(compose.TableCellProps{BoxProps: box.BoxProps{Class: "hidden sm:table-cell"}}) {
								{ uiutils.Text(uiutils.Get(vJ, "location")) }
							}
							@compose.TableCell(compose.TableCellProps{BoxProps: box.BoxProps{}}) {
								{ uiutils.Text(uiutils.Get(vJ, "type")) }
							}
							if uiutils.Eq(vSalary, "show") {
								@compose.TableCell(compose.TableCellProps{BoxProps: box.BoxProps{Class: "hidden md:table-cell"}}) {
									{ uiutils.Text(uiutils.Get(vJ, "salary")) }
								}
							}
							@compose.TableCell(compose.TableCellProps{BoxProps: box.BoxProps{Class: "pr-4 text-right"}}) {
								@MenuEntry(MenuEntryProps{Href: uiutils.Get(vJ, "href"), Class: uiutils.Cnv("font-medium")}) {
									{ uiutils.Text(uiutils.Get(vLabels, "apply")) }
								}
							}
						}
					}
				}
			}
		}
	} else {
		@compose.Grid(compose.GridProps{Cols: "1-2", BoxProps: box.BoxProps{Class: "gap-4", Attrs: uiutils.Attrs("data-slot", "items")}}) {
			for _, vJ := range uiutils.L(vJobs) {
				@compose.Stack(compose.StackProps{Gap: "4", BoxProps: box.BoxProps{Class: "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.Text(compose.TextProps{Size: "lg", Weight: "semibold", TextProps: text.TextProps{}}) {
							{ uiutils.Text(uiutils.Get(vJ, "title")) }
						}
						@compose.Group(compose.GroupProps{Gap: "4", BoxProps: box.BoxProps{Class: "flex-wrap text-sm text-muted-foreground"}}) {
							@compose.Group(compose.GroupProps{Gap: "2", Align: "center", BoxProps: box.BoxProps{}}) {
								@icons.LucideIcon(icons.LucideIconProps{Name: "briefcase", Size: 16})
								@compose.Inline(compose.InlineProps{TextProps: text.TextProps{}}) {
									{ uiutils.Text(uiutils.Get(vJ, "type")) }
								}
							}
							@compose.Group(compose.GroupProps{Gap: "2", Align: "center", BoxProps: box.BoxProps{}}) {
								@icons.LucideIcon(icons.LucideIconProps{Name: "map-pin", Size: 16})
								@compose.Inline(compose.InlineProps{TextProps: text.TextProps{}}) {
									{ uiutils.Text(uiutils.Get(vJ, "location")) }
								}
							}
							@compose.Group(compose.GroupProps{Gap: "2", Align: "center", BoxProps: box.BoxProps{}}) {
								@icons.LucideIcon(icons.LucideIconProps{Name: "calendar", Size: 16})
								@compose.Inline(compose.InlineProps{TextProps: text.TextProps{}}) {
									{ uiutils.Text(uiutils.Get(vJ, "posted")) }
								}
							}
						}
					}
					if uiutils.Eq(vSalary, "show") {
						@compose.Text(compose.TextProps{Size: "base", Weight: "semibold", TextProps: text.TextProps{Attrs: uiutils.Attrs("data-slot", "salary")}}) {
							{ uiutils.Text(uiutils.Get(vJ, "salary")) }
						}
					}
					@compose.Group(compose.GroupProps{Gap: "4", Align: "center", Justify: "between", BoxProps: box.BoxProps{Class: "mt-auto"}}) {
						@compose.Badge(compose.BadgeProps{Variant: "secondary", Size: "default", TextProps: text.TextProps{}}) {
							{ uiutils.Text(uiutils.FirstOf(uiutils.Where(vDepartments, "id", uiutils.Get(vJ, "dept")), "name")) }
						}
						@MenuEntry(MenuEntryProps{Href: uiutils.Get(vJ, "href"), Class: uiutils.Cnv("inline-flex items-center gap-2 text-sm font-medium")}) {
							{ uiutils.Text(uiutils.Get(vLabels, "apply")) }
							@icons.LucideIcon(icons.LucideIconProps{Name: "arrow-right", Size: 16})
						}
					}
				}
			}
		}
	}
}

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 job-cards
blocks/job-cards.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/job-cards.json
    The jobs of JobBoard as cards in two columns (title, department, place, type, optional salary, posted, apply) or as a table.
    Props (p): jobs, departments, labels, layout, salary. -#}
{%- set v_jobs = (p.jobs ?? null) -%}
{%- set v_departments = (p.departments ?? null) -%}
{%- set v_labels = (p.labels ?? null) -%}
{%- set v_layout = (p.layout ?? 'grid') -%}
{%- set v_salary = (p.salary ?? 'hide') -%}
{%- if og_t(og_eq(v_layout, 'table')) %}
  {%- set c_21 -%}
    {%- set c_20 -%}
      {%- set c_1 -%}
        {{ og_text(og_get(v_labels, ['caption'])) }}
      {%- endset -%}
      {{ include('compose/TableCaption.html.twig', {'class': 'sr-only', 'children': c_1}, with_context = false) }}
      {%- set c_10 -%}
        {%- set c_9 -%}
          {%- set c_2 -%}
            {{ og_text(og_get(v_labels, ['role'])) }}
          {%- endset -%}
          {{ include('compose/TableHeadCell.html.twig', {'class': 'px-4 py-2', 'attrs': og_attrs(['scope', 'col']), 'children': c_2}, with_context = false) }}
          {%- set c_3 -%}
            {{ og_text(og_get(v_labels, ['team'])) }}
          {%- endset -%}
          {{ include('compose/TableHeadCell.html.twig', {'class': 'hidden py-2 md:table-cell', 'attrs': og_attrs(['scope', 'col']), 'children': c_3}, with_context = false) }}
          {%- set c_4 -%}
            {{ og_text(og_get(v_labels, ['location'])) }}
          {%- endset -%}
          {{ include('compose/TableHeadCell.html.twig', {'class': 'hidden py-2 sm:table-cell', 'attrs': og_attrs(['scope', 'col']), 'children': c_4}, with_context = false) }}
          {%- set c_5 -%}
            {{ og_text(og_get(v_labels, ['type'])) }}
          {%- endset -%}
          {{ include('compose/TableHeadCell.html.twig', {'class': 'py-2', 'attrs': og_attrs(['scope', 'col']), 'children': c_5}, with_context = false) }}
          {%- if og_t(og_eq(v_salary, 'show')) %}
            {%- set c_6 -%}
              {{ og_text(og_get(v_labels, ['salary'])) }}
            {%- endset -%}
            {{ include('compose/TableHeadCell.html.twig', {'class': 'hidden py-2 md:table-cell', 'attrs': og_attrs(['scope', 'col']), 'children': c_6}, with_context = false) }}
          {%- endif %}
          {%- set c_8 -%}
            {%- set c_7 -%}
              {{ og_text(og_get(v_labels, ['apply'])) }}
            {%- endset -%}
            {{ include('compose/Inline.html.twig', {'class': 'sr-only', 'children': c_7}, with_context = false) }}
          {%- endset -%}
          {{ include('compose/TableHeadCell.html.twig', {'class': 'py-2 pr-4', 'attrs': og_attrs(['scope', 'col']), 'children': c_8}, with_context = false) }}
        {%- endset -%}
        {{ include('compose/TableRow.html.twig', {'children': c_9}, with_context = false) }}
      {%- endset -%}
      {{ include('compose/TableHead.html.twig', {'class': 'bg-muted', 'children': c_10}, with_context = false) }}
      {%- set c_19 -%}
        {%- for v_j in og_l(v_jobs) %}
          {%- set c_18 -%}
            {%- set c_11 -%}
              {{ og_text(og_get(v_j, ['title'])) }}
            {%- endset -%}
            {{ include('compose/TableCell.html.twig', {'class': 'px-4 py-4 font-medium', 'children': c_11}, with_context = false) }}
            {%- set c_12 -%}
              {{ og_text(og_first_of(og_where(v_departments, 'id', og_get(v_j, ['dept'])), 'name')) }}
            {%- endset -%}
            {{ include('compose/TableCell.html.twig', {'class': 'hidden md:table-cell', 'children': c_12}, with_context = false) }}
            {%- set c_13 -%}
              {{ og_text(og_get(v_j, ['location'])) }}
            {%- endset -%}
            {{ include('compose/TableCell.html.twig', {'class': 'hidden sm:table-cell', 'children': c_13}, with_context = false) }}
            {%- set c_14 -%}
              {{ og_text(og_get(v_j, ['type'])) }}
            {%- endset -%}
            {{ include('compose/TableCell.html.twig', {'children': c_14}, with_context = false) }}
            {%- if og_t(og_eq(v_salary, 'show')) %}
              {%- set c_15 -%}
                {{ og_text(og_get(v_j, ['salary'])) }}
              {%- endset -%}
              {{ include('compose/TableCell.html.twig', {'class': 'hidden md:table-cell', 'children': c_15}, with_context = false) }}
            {%- endif %}
            {%- set c_17 -%}
              {%- set c_16 -%}
                {{ og_text(og_get(v_labels, ['apply'])) }}
              {%- endset -%}
              {{ include('blocks/menu-entry.html.twig', {'p': {'href': og_get(v_j, ['href']), 'className': og_cnv(['font-medium'])}, 'children': og_markup(c_16)}, with_context = false) }}
            {%- endset -%}
            {{ include('compose/TableCell.html.twig', {'class': 'pr-4 text-right', 'children': c_17}, with_context = false) }}
          {%- endset -%}
          {{ include('compose/TableRow.html.twig', {'class': 'border-t border-border', 'attrs': og_attrs(['data-slot', 'item']), 'children': c_18}, with_context = false) }}
        {%- endfor %}
      {%- endset -%}
      {{ include('compose/TableBody.html.twig', {'children': c_19}, with_context = false) }}
    {%- endset -%}
    {{ include('compose/Table.html.twig', {'class': 'w-full text-left text-sm', 'attrs': og_attrs(['data-slot', 'job-table']), 'children': c_20}, with_context = false) }}
  {%- endset -%}
  {{ include('compose/Box.html.twig', {'class': 'w-full overflow-x-auto rounded inset-ring inset-ring-border', 'attrs': og_attrs(['data-slot', 'job-cards']), 'children': c_21}, with_context = false) }}
{%- else %}
  {%- set c_36 -%}
    {%- for v_j in og_l(v_jobs) %}
      {%- set c_35 -%}
        {%- set c_30 -%}
          {%- set c_22 -%}
            {{ og_text(og_get(v_j, ['title'])) }}
          {%- endset -%}
          {{ include('compose/Text.html.twig', {'size': 'lg', 'weight': 'semibold', 'children': c_22}, with_context = false) }}
          {%- set c_29 -%}
            {%- set c_24 -%}
              {{ include('icons/LucideIcon.html.twig', {'name': 'briefcase', 'size': 16}, with_context = false) }}
              {%- set c_23 -%}
                {{ og_text(og_get(v_j, ['type'])) }}
              {%- endset -%}
              {{ include('compose/Inline.html.twig', {'children': c_23}, with_context = false) }}
            {%- endset -%}
            {{ include('compose/Group.html.twig', {'gap': '2', 'align': 'center', 'children': c_24}, with_context = false) }}
            {%- set c_26 -%}
              {{ include('icons/LucideIcon.html.twig', {'name': 'map-pin', 'size': 16}, with_context = false) }}
              {%- set c_25 -%}
                {{ og_text(og_get(v_j, ['location'])) }}
              {%- endset -%}
              {{ include('compose/Inline.html.twig', {'children': c_25}, with_context = false) }}
            {%- endset -%}
            {{ include('compose/Group.html.twig', {'gap': '2', 'align': 'center', 'children': c_26}, with_context = false) }}
            {%- set c_28 -%}
              {{ include('icons/LucideIcon.html.twig', {'name': 'calendar', 'size': 16}, with_context = false) }}
              {%- set c_27 -%}
                {{ og_text(og_get(v_j, ['posted'])) }}
              {%- endset -%}
              {{ include('compose/Inline.html.twig', {'children': c_27}, with_context = false) }}
            {%- endset -%}
            {{ include('compose/Group.html.twig', {'gap': '2', 'align': 'center', 'children': c_28}, with_context = false) }}
          {%- endset -%}
          {{ include('compose/Group.html.twig', {'gap': '4', 'class': 'flex-wrap text-sm text-muted-foreground', 'children': c_29}, with_context = false) }}
        {%- endset -%}
        {{ include('compose/Stack.html.twig', {'gap': '2', 'children': c_30}, with_context = false) }}
        {%- if og_t(og_eq(v_salary, 'show')) %}
          {%- set c_31 -%}
            {{ og_text(og_get(v_j, ['salary'])) }}
          {%- endset -%}
          {{ include('compose/Text.html.twig', {'size': 'base', 'weight': 'semibold', 'attrs': og_attrs(['data-slot', 'salary']), 'children': c_31}, with_context = false) }}
        {%- endif %}
        {%- set c_34 -%}
          {%- set c_32 -%}
            {{ og_text(og_first_of(og_where(v_departments, 'id', og_get(v_j, ['dept'])), 'name')) }}
          {%- endset -%}
          {{ include('compose/Badge.html.twig', {'variant': 'secondary', 'size': 'default', 'children': c_32}, with_context = false) }}
          {%- set c_33 -%}
            {{ og_text(og_get(v_labels, ['apply'])) }}
            {{ include('icons/LucideIcon.html.twig', {'name': 'arrow-right', 'size': 16}, with_context = false) }}
          {%- endset -%}
          {{ include('blocks/menu-entry.html.twig', {'p': {'href': og_get(v_j, ['href']), 'className': og_cnv(['inline-flex items-center gap-2 text-sm font-medium'])}, 'children': og_markup(c_33)}, with_context = false) }}
        {%- endset -%}
        {{ include('compose/Group.html.twig', {'gap': '4', 'align': 'center', 'justify': 'between', 'class': 'mt-auto', 'children': c_34}, with_context = false) }}
      {%- endset -%}
      {{ include('compose/Stack.html.twig', {'gap': '4', 'class': 'rounded bg-card inset-ring inset-ring-border p-6', 'attrs': og_attrs(['data-slot', 'item']), 'children': c_35}, with_context = false) }}
    {%- endfor %}
  {%- endset -%}
  {{ include('compose/Grid.html.twig', {'cols': '1-2', 'class': 'gap-4', 'attrs': og_attrs(['data-slot', 'items']), 'children': c_36}, with_context = false) }}
{%- endif %}

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 job-cards
blocks/job-cards.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/job-cards.json
    The jobs of JobBoard as cards in two columns (title, department, place, type, optional salary, posted, apply) or as a table.
    Props (p): jobs, departments, labels, layout, salary. *}
{var $v_jobs = ($p['jobs'] ?? null)}
{var $v_departments = ($p['departments'] ?? null)}
{var $v_labels = ($p['labels'] ?? null)}
{var $v_layout = ($p['layout'] ?? 'grid')}
{var $v_salary = ($p['salary'] ?? 'hide')}
{if og_t(og_eq($v_layout, 'table'))}
  {capture $c_21}
    {capture $c_20}
      {capture $c_1}
        {=og_text(og_get($v_labels, ['caption']))}
      {/capture}
      {=og_include('compose/TableCaption.latte', ['class' => 'sr-only', 'children' => (string) $c_1])|noescape}
      {capture $c_10}
        {capture $c_9}
          {capture $c_2}
            {=og_text(og_get($v_labels, ['role']))}
          {/capture}
          {=og_include('compose/TableHeadCell.latte', ['class' => 'px-4 py-2', 'attrs' => og_attrs(['scope', 'col']), 'children' => (string) $c_2])|noescape}
          {capture $c_3}
            {=og_text(og_get($v_labels, ['team']))}
          {/capture}
          {=og_include('compose/TableHeadCell.latte', ['class' => 'hidden py-2 md:table-cell', 'attrs' => og_attrs(['scope', 'col']), 'children' => (string) $c_3])|noescape}
          {capture $c_4}
            {=og_text(og_get($v_labels, ['location']))}
          {/capture}
          {=og_include('compose/TableHeadCell.latte', ['class' => 'hidden py-2 sm:table-cell', 'attrs' => og_attrs(['scope', 'col']), 'children' => (string) $c_4])|noescape}
          {capture $c_5}
            {=og_text(og_get($v_labels, ['type']))}
          {/capture}
          {=og_include('compose/TableHeadCell.latte', ['class' => 'py-2', 'attrs' => og_attrs(['scope', 'col']), 'children' => (string) $c_5])|noescape}
          {if og_t(og_eq($v_salary, 'show'))}
            {capture $c_6}
              {=og_text(og_get($v_labels, ['salary']))}
            {/capture}
            {=og_include('compose/TableHeadCell.latte', ['class' => 'hidden py-2 md:table-cell', 'attrs' => og_attrs(['scope', 'col']), 'children' => (string) $c_6])|noescape}
          {/if}
          {capture $c_8}
            {capture $c_7}
              {=og_text(og_get($v_labels, ['apply']))}
            {/capture}
            {=og_include('compose/Inline.latte', ['class' => 'sr-only', 'children' => (string) $c_7])|noescape}
          {/capture}
          {=og_include('compose/TableHeadCell.latte', ['class' => 'py-2 pr-4', 'attrs' => og_attrs(['scope', 'col']), 'children' => (string) $c_8])|noescape}
        {/capture}
        {=og_include('compose/TableRow.latte', ['children' => (string) $c_9])|noescape}
      {/capture}
      {=og_include('compose/TableHead.latte', ['class' => 'bg-muted', 'children' => (string) $c_10])|noescape}
      {capture $c_19}
        {foreach og_l($v_jobs) as $v_j}
          {capture $c_18}
            {capture $c_11}
              {=og_text(og_get($v_j, ['title']))}
            {/capture}
            {=og_include('compose/TableCell.latte', ['class' => 'px-4 py-4 font-medium', 'children' => (string) $c_11])|noescape}
            {capture $c_12}
              {=og_text(og_first_of(og_where($v_departments, 'id', og_get($v_j, ['dept'])), 'name'))}
            {/capture}
            {=og_include('compose/TableCell.latte', ['class' => 'hidden md:table-cell', 'children' => (string) $c_12])|noescape}
            {capture $c_13}
              {=og_text(og_get($v_j, ['location']))}
            {/capture}
            {=og_include('compose/TableCell.latte', ['class' => 'hidden sm:table-cell', 'children' => (string) $c_13])|noescape}
            {capture $c_14}
              {=og_text(og_get($v_j, ['type']))}
            {/capture}
            {=og_include('compose/TableCell.latte', ['children' => (string) $c_14])|noescape}
            {if og_t(og_eq($v_salary, 'show'))}
              {capture $c_15}
                {=og_text(og_get($v_j, ['salary']))}
              {/capture}
              {=og_include('compose/TableCell.latte', ['class' => 'hidden md:table-cell', 'children' => (string) $c_15])|noescape}
            {/if}
            {capture $c_17}
              {capture $c_16}
                {=og_text(og_get($v_labels, ['apply']))}
              {/capture}
              {=og_include('blocks/menu-entry.latte', ['p' => ['href' => og_get($v_j, ['href']), 'className' => og_cnv(['font-medium'])], 'children' => og_markup($c_16)])|noescape}
            {/capture}
            {=og_include('compose/TableCell.latte', ['class' => 'pr-4 text-right', 'children' => (string) $c_17])|noescape}
          {/capture}
          {=og_include('compose/TableRow.latte', ['class' => 'border-t border-border', 'attrs' => og_attrs(['data-slot', 'item']), 'children' => (string) $c_18])|noescape}
        {/foreach}
      {/capture}
      {=og_include('compose/TableBody.latte', ['children' => (string) $c_19])|noescape}
    {/capture}
    {=og_include('compose/Table.latte', ['class' => 'w-full text-left text-sm', 'attrs' => og_attrs(['data-slot', 'job-table']), 'children' => (string) $c_20])|noescape}
  {/capture}
  {=og_include('compose/Box.latte', ['class' => 'w-full overflow-x-auto rounded inset-ring inset-ring-border', 'attrs' => og_attrs(['data-slot', 'job-cards']), 'children' => (string) $c_21])|noescape}
{else}
  {capture $c_36}
    {foreach og_l($v_jobs) as $v_j}
      {capture $c_35}
        {capture $c_30}
          {capture $c_22}
            {=og_text(og_get($v_j, ['title']))}
          {/capture}
          {=og_include('compose/Text.latte', ['size' => 'lg', 'weight' => 'semibold', 'children' => (string) $c_22])|noescape}
          {capture $c_29}
            {capture $c_24}
              {=og_include('icons/LucideIcon.latte', ['name' => 'briefcase', 'size' => 16])|noescape}
              {capture $c_23}
                {=og_text(og_get($v_j, ['type']))}
              {/capture}
              {=og_include('compose/Inline.latte', ['children' => (string) $c_23])|noescape}
            {/capture}
            {=og_include('compose/Group.latte', ['gap' => '2', 'align' => 'center', 'children' => (string) $c_24])|noescape}
            {capture $c_26}
              {=og_include('icons/LucideIcon.latte', ['name' => 'map-pin', 'size' => 16])|noescape}
              {capture $c_25}
                {=og_text(og_get($v_j, ['location']))}
              {/capture}
              {=og_include('compose/Inline.latte', ['children' => (string) $c_25])|noescape}
            {/capture}
            {=og_include('compose/Group.latte', ['gap' => '2', 'align' => 'center', 'children' => (string) $c_26])|noescape}
            {capture $c_28}
              {=og_include('icons/LucideIcon.latte', ['name' => 'calendar', 'size' => 16])|noescape}
              {capture $c_27}
                {=og_text(og_get($v_j, ['posted']))}
              {/capture}
              {=og_include('compose/Inline.latte', ['children' => (string) $c_27])|noescape}
            {/capture}
            {=og_include('compose/Group.latte', ['gap' => '2', 'align' => 'center', 'children' => (string) $c_28])|noescape}
          {/capture}
          {=og_include('compose/Group.latte', ['gap' => '4', 'class' => 'flex-wrap text-sm text-muted-foreground', 'children' => (string) $c_29])|noescape}
        {/capture}
        {=og_include('compose/Stack.latte', ['gap' => '2', 'children' => (string) $c_30])|noescape}
        {if og_t(og_eq($v_salary, 'show'))}
          {capture $c_31}
            {=og_text(og_get($v_j, ['salary']))}
          {/capture}
          {=og_include('compose/Text.latte', ['size' => 'base', 'weight' => 'semibold', 'attrs' => og_attrs(['data-slot', 'salary']), 'children' => (string) $c_31])|noescape}
        {/if}
        {capture $c_34}
          {capture $c_32}
            {=og_text(og_first_of(og_where($v_departments, 'id', og_get($v_j, ['dept'])), 'name'))}
          {/capture}
          {=og_include('compose/Badge.latte', ['variant' => 'secondary', 'size' => 'default', 'children' => (string) $c_32])|noescape}
          {capture $c_33}
            {=og_text(og_get($v_labels, ['apply']))}
            {=og_include('icons/LucideIcon.latte', ['name' => 'arrow-right', 'size' => 16])|noescape}
          {/capture}
          {=og_include('blocks/menu-entry.latte', ['p' => ['href' => og_get($v_j, ['href']), 'className' => og_cnv(['inline-flex items-center gap-2 text-sm font-medium'])], 'children' => og_markup($c_33)])|noescape}
        {/capture}
        {=og_include('compose/Group.latte', ['gap' => '4', 'align' => 'center', 'justify' => 'between', 'class' => 'mt-auto', 'children' => (string) $c_34])|noescape}
      {/capture}
      {=og_include('compose/Stack.latte', ['gap' => '4', 'class' => 'rounded bg-card inset-ring inset-ring-border p-6', 'attrs' => og_attrs(['data-slot', 'item']), 'children' => (string) $c_35])|noescape}
    {/foreach}
  {/capture}
  {=og_include('compose/Grid.latte', ['cols' => '1-2', 'class' => 'gap-4', 'attrs' => og_attrs(['data-slot', 'items']), 'children' => (string) $c_36])|noescape}
{/if}

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 job-cards
blocks/job-cards.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/job-cards.json
    The jobs of JobBoard as cards in two columns (title, department, place, type, optional salary, posted, apply) or as a table.
    Props (p): jobs, departments, labels, layout, salary. -#}
{%- set v_jobs = og_def(p['jobs'], none) -%}
{%- set v_departments = og_def(p['departments'], none) -%}
{%- set v_labels = og_def(p['labels'], none) -%}
{%- set v_layout = og_def(p['layout'], 'grid') -%}
{%- set v_salary = og_def(p['salary'], 'hide') -%}
{%- if og_t(og_eq(v_layout, 'table')) %}
  {%- set c_21 -%}
    {%- set c_20 -%}
      {%- set c_1 -%}
        {{ og_text(og_get(v_labels, ['caption'])) }}
      {%- endset -%}
      {{ og_include('compose/table-caption.html.j2', {'p': {'Class': 'sr-only'}, 'children': c_1}) }}
      {%- set c_10 -%}
        {%- set c_9 -%}
          {%- set c_2 -%}
            {{ og_text(og_get(v_labels, ['role'])) }}
          {%- endset -%}
          {{ og_include('compose/table-head-cell.html.j2', {'p': {'Class': 'px-4 py-2', 'Attrs': og_attrs(['scope', 'col'])}, 'children': c_2}) }}
          {%- set c_3 -%}
            {{ og_text(og_get(v_labels, ['team'])) }}
          {%- endset -%}
          {{ og_include('compose/table-head-cell.html.j2', {'p': {'Class': 'hidden py-2 md:table-cell', 'Attrs': og_attrs(['scope', 'col'])}, 'children': c_3}) }}
          {%- set c_4 -%}
            {{ og_text(og_get(v_labels, ['location'])) }}
          {%- endset -%}
          {{ og_include('compose/table-head-cell.html.j2', {'p': {'Class': 'hidden py-2 sm:table-cell', 'Attrs': og_attrs(['scope', 'col'])}, 'children': c_4}) }}
          {%- set c_5 -%}
            {{ og_text(og_get(v_labels, ['type'])) }}
          {%- endset -%}
          {{ og_include('compose/table-head-cell.html.j2', {'p': {'Class': 'py-2', 'Attrs': og_attrs(['scope', 'col'])}, 'children': c_5}) }}
          {%- if og_t(og_eq(v_salary, 'show')) %}
            {%- set c_6 -%}
              {{ og_text(og_get(v_labels, ['salary'])) }}
            {%- endset -%}
            {{ og_include('compose/table-head-cell.html.j2', {'p': {'Class': 'hidden py-2 md:table-cell', 'Attrs': og_attrs(['scope', 'col'])}, 'children': c_6}) }}
          {%- endif %}
          {%- set c_8 -%}
            {%- set c_7 -%}
              {{ og_text(og_get(v_labels, ['apply'])) }}
            {%- endset -%}
            {{ og_include('compose/inline.html.j2', {'p': {'Class': 'sr-only'}, 'children': c_7}) }}
          {%- endset -%}
          {{ og_include('compose/table-head-cell.html.j2', {'p': {'Class': 'py-2 pr-4', 'Attrs': og_attrs(['scope', 'col'])}, 'children': c_8}) }}
        {%- endset -%}
        {{ og_include('compose/table-row.html.j2', {'p': {}, 'children': c_9}) }}
      {%- endset -%}
      {{ og_include('compose/table-head.html.j2', {'p': {'Class': 'bg-muted'}, 'children': c_10}) }}
      {%- set c_19 -%}
        {%- for v_j in og_l(v_jobs) %}
          {%- set c_18 -%}
            {%- set c_11 -%}
              {{ og_text(og_get(v_j, ['title'])) }}
            {%- endset -%}
            {{ og_include('compose/table-cell.html.j2', {'p': {'Class': 'px-4 py-4 font-medium'}, 'children': c_11}) }}
            {%- set c_12 -%}
              {{ og_text(og_first_of(og_where(v_departments, 'id', og_get(v_j, ['dept'])), 'name')) }}
            {%- endset -%}
            {{ og_include('compose/table-cell.html.j2', {'p': {'Class': 'hidden md:table-cell'}, 'children': c_12}) }}
            {%- set c_13 -%}
              {{ og_text(og_get(v_j, ['location'])) }}
            {%- endset -%}
            {{ og_include('compose/table-cell.html.j2', {'p': {'Class': 'hidden sm:table-cell'}, 'children': c_13}) }}
            {%- set c_14 -%}
              {{ og_text(og_get(v_j, ['type'])) }}
            {%- endset -%}
            {{ og_include('compose/table-cell.html.j2', {'p': {}, 'children': c_14}) }}
            {%- if og_t(og_eq(v_salary, 'show')) %}
              {%- set c_15 -%}
                {{ og_text(og_get(v_j, ['salary'])) }}
              {%- endset -%}
              {{ og_include('compose/table-cell.html.j2', {'p': {'Class': 'hidden md:table-cell'}, 'children': c_15}) }}
            {%- endif %}
            {%- set c_17 -%}
              {%- set c_16 -%}
                {{ og_text(og_get(v_labels, ['apply'])) }}
              {%- endset -%}
              {{ og_include('blocks/menu-entry.html.j2', {'p': {'href': og_get(v_j, ['href']), 'className': og_cnv(['font-medium'])}, 'children': og_markup(c_16)}) }}
            {%- endset -%}
            {{ og_include('compose/table-cell.html.j2', {'p': {'Class': 'pr-4 text-right'}, 'children': c_17}) }}
          {%- endset -%}
          {{ og_include('compose/table-row.html.j2', {'p': {'Class': 'border-t border-border', 'Attrs': og_attrs(['data-slot', 'item'])}, 'children': c_18}) }}
        {%- endfor %}
      {%- endset -%}
      {{ og_include('compose/table-body.html.j2', {'p': {}, 'children': c_19}) }}
    {%- endset -%}
    {{ og_include('compose/table.html.j2', {'p': {'Class': 'w-full text-left text-sm', 'Attrs': og_attrs(['data-slot', 'job-table'])}, 'children': c_20}) }}
  {%- endset -%}
  {{ og_include('compose/box.html.j2', {'p': {'Class': 'w-full overflow-x-auto rounded inset-ring inset-ring-border', 'Attrs': og_attrs(['data-slot', 'job-cards'])}, 'children': c_21}) }}
{%- else %}
  {%- set c_36 -%}
    {%- for v_j in og_l(v_jobs) %}
      {%- set c_35 -%}
        {%- set c_30 -%}
          {%- set c_22 -%}
            {{ og_text(og_get(v_j, ['title'])) }}
          {%- endset -%}
          {{ og_include('compose/text.html.j2', {'p': {'Size': 'lg', 'Weight': 'semibold'}, 'children': c_22}) }}
          {%- set c_29 -%}
            {%- set c_24 -%}
              {{ og_include('icons/lucide-icon.html.j2', {'p': {'Name': 'briefcase', 'Size': 16}}) }}
              {%- set c_23 -%}
                {{ og_text(og_get(v_j, ['type'])) }}
              {%- endset -%}
              {{ og_include('compose/inline.html.j2', {'p': {}, 'children': c_23}) }}
            {%- endset -%}
            {{ og_include('compose/group.html.j2', {'p': {'Gap': '2', 'Align': 'center'}, 'children': c_24}) }}
            {%- set c_26 -%}
              {{ og_include('icons/lucide-icon.html.j2', {'p': {'Name': 'map-pin', 'Size': 16}}) }}
              {%- set c_25 -%}
                {{ og_text(og_get(v_j, ['location'])) }}
              {%- endset -%}
              {{ og_include('compose/inline.html.j2', {'p': {}, 'children': c_25}) }}
            {%- endset -%}
            {{ og_include('compose/group.html.j2', {'p': {'Gap': '2', 'Align': 'center'}, 'children': c_26}) }}
            {%- set c_28 -%}
              {{ og_include('icons/lucide-icon.html.j2', {'p': {'Name': 'calendar', 'Size': 16}}) }}
              {%- set c_27 -%}
                {{ og_text(og_get(v_j, ['posted'])) }}
              {%- endset -%}
              {{ og_include('compose/inline.html.j2', {'p': {}, 'children': c_27}) }}
            {%- endset -%}
            {{ og_include('compose/group.html.j2', {'p': {'Gap': '2', 'Align': 'center'}, 'children': c_28}) }}
          {%- endset -%}
          {{ og_include('compose/group.html.j2', {'p': {'Gap': '4', 'Class': 'flex-wrap text-sm text-muted-foreground'}, 'children': c_29}) }}
        {%- endset -%}
        {{ og_include('compose/stack.html.j2', {'p': {'Gap': '2'}, 'children': c_30}) }}
        {%- if og_t(og_eq(v_salary, 'show')) %}
          {%- set c_31 -%}
            {{ og_text(og_get(v_j, ['salary'])) }}
          {%- endset -%}
          {{ og_include('compose/text.html.j2', {'p': {'Size': 'base', 'Weight': 'semibold', 'Attrs': og_attrs(['data-slot', 'salary'])}, 'children': c_31}) }}
        {%- endif %}
        {%- set c_34 -%}
          {%- set c_32 -%}
            {{ og_text(og_first_of(og_where(v_departments, 'id', og_get(v_j, ['dept'])), 'name')) }}
          {%- endset -%}
          {{ og_include('compose/badge.html.j2', {'p': {'Variant': 'secondary', 'Size': 'default'}, 'children': c_32}) }}
          {%- set c_33 -%}
            {{ og_text(og_get(v_labels, ['apply'])) }}
            {{ og_include('icons/lucide-icon.html.j2', {'p': {'Name': 'arrow-right', 'Size': 16}}) }}
          {%- endset -%}
          {{ og_include('blocks/menu-entry.html.j2', {'p': {'href': og_get(v_j, ['href']), 'className': og_cnv(['inline-flex items-center gap-2 text-sm font-medium'])}, 'children': og_markup(c_33)}) }}
        {%- endset -%}
        {{ og_include('compose/group.html.j2', {'p': {'Gap': '4', 'Align': 'center', 'Justify': 'between', 'Class': 'mt-auto'}, 'children': c_34}) }}
      {%- endset -%}
      {{ og_include('compose/stack.html.j2', {'p': {'Gap': '4', 'Class': 'rounded bg-card inset-ring inset-ring-border p-6', 'Attrs': og_attrs(['data-slot', 'item'])}, 'children': c_35}) }}
    {%- endfor %}
  {%- endset -%}
  {{ og_include('compose/grid.html.j2', {'p': {'Cols': '1-2', 'Class': 'gap-4', 'Attrs': og_attrs(['data-slot', 'items'])}, 'children': c_36}) }}
{%- endif %}

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 jobs of JobBoard as cards in two columns (title, department, place, type, optional salary, posted, apply) or as a table.

Props of JobCards
PropTypeDefault Description
jobs (required)Job[]-
departments (required)Department[]-
labels (required)JobLabels-
layout "grid" | "grouped" | "table""grid"
salary "show" | "hide""hide"

Used in