Skip to content
ui8kit

block / marketing

Job Board

Open jobs as cards, grouped by department, or as a table.

Install

npx ui8kit add job-board

Pulls in: badge, compose, empty-state, group, job-cards, kit-box, kit-text, list, list-item, menu-entry, section-frame, stack, text, title, utils

Preview

Open roles

Remote-friendly roles across three teams.

Senior Frontend Engineer

Full time
Remote
2 days ago
EngineeringApply

Platform Engineer

Full time
Berlin
1 week ago
EngineeringApply

Product Designer

Full time
Paris
3 days ago
DesignApply

Brand Designer

Contract
Remote
2 weeks ago
DesignApply

Customer Success Lead

Full time
Toronto
5 days ago
SupportApply

Technical Writer

Part time
Remote
1 day ago
SupportApply

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-board
blocks/job-board.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. -->
<!--
  Open jobs as cards in two columns, grouped by department, or as a table: the title, the department, the place,
  the type, an optional salary and an apply link. Axes: layout (grid, grouped, table), salary (show, hide),
  tone.
-->
<script lang="ts" module>
  import type { Snippet } from "svelte";
  import type { Job, Department, JobLabels } from "./job-board.types";

  export type JobBoardProps = {
    id: string;
    title: string;
    lead?: string;
    jobs: Job[];
    departments: Department[];
    labels: JobLabels;
    layout?: "grid" | "grouped" | "table";
    salary?: "show" | "hide";
    tone?: "default" | "muted";
    empty?: string;
    landmarkLabel?: string;
  };
</script>

<script lang="ts">
  import Badge from "../compose/Badge.svelte";
  import Group from "../compose/Group.svelte";
  import List from "../compose/List.svelte";
  import ListItem from "../compose/ListItem.svelte";
  import Stack from "../compose/Stack.svelte";
  import Text from "../compose/Text.svelte";
  import Title from "../compose/Title.svelte";
  import EmptyState from "../components/empty-state.svelte";
  import JobCards from "../components/job-cards.svelte";
  import MenuEntry from "../components/menu-entry.svelte";
  import SectionFrame from "../components/section-frame.svelte";
  import { tpl } from "../utils";

  let {
    id,
    title,
    lead = "",
    jobs,
    departments,
    labels,
    layout = "grid",
    salary = "hide",
    tone = "default",
    empty = "",
    landmarkLabel,
  }: JobBoardProps = $props();
</script>

<SectionFrame
  id={id}
  title={title}
  lead={lead}
  tone={tone}
  measure={(((layout as string) === "grouped") ? "3xl" : "default")}
  landmarkLabel={landmarkLabel}
>
  {#if ((jobs?.length ?? 0) === 0)}
    <EmptyState icon="briefcase" title={empty} />
  {:else if ((layout as string) === "grouped")}
    <Stack gap="8" align="stretch" data-slot="groups">
      {#each departments as d (d.id)}
        <Stack gap="2" align="stretch" data-slot="group">
          <Group gap="4" align="baseline" justify="between">
            <Title as={3} size="lg" weight="bold">
              {d.name}
            </Title>
            <Text size="xs" class="text-muted-foreground">
              {tpl(labels.count, (jobs.filter((i) => !d.id || i["dept"] === d.id)?.length ?? 0))}
            </Text>
          </Group>
          <List tag="ul" class="flex flex-col">
            {#each jobs.filter((i) => !d.id || i["dept"] === d.id) as j (j.id)}
              <ListItem
                class="flex flex-wrap items-center justify-between gap-4 border-b border-border py-4"
                data-slot="item"
              >
                <Stack gap="0">
                  <MenuEntry href={j.href} class="font-medium">
                    {j.title}
                  </MenuEntry>
                  <Text size="xs" class="text-muted-foreground">
                    {tpl("{0}, {1}", j.location, j.type)}
                  </Text>
                </Stack>
                <Badge variant="outline" size="default">
                  {j.type}
                </Badge>
              </ListItem>
            {/each}
          </List>
        </Stack>
      {/each}
    </Stack>
  {:else}
    <JobCards jobs={jobs} departments={departments} labels={labels} layout={layout} salary={salary} />
  {/if}
</SectionFrame>
blocks/job-board.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 Job = {
  id: string;
  title: string;
  dept: string;
  location: string;
  type: string;
  salary: string;
  posted: string;
  href?: string;
};

export type Department = {
  id: string;
  name: string;
};

export type JobLabels = {
  apply: string;
  caption: string;
  role: string;
  team: string;
  location: string;
  type: string;
  salary: string;
  count: 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 job-board
blocks/job-board.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.
/**
 * Open jobs as cards in two columns, grouped by department, or as a table: the title, the department, the place,
 * the type, an optional salary and an apply link. Axes: layout (grid, grouped, table), salary (show, hide),
 * tone.
 */
import { type ReactNode } from "react";
import { Badge, Group, List, ListItem, Stack, Text, Title } from "../compose";
import { EmptyState } from "../components/empty-state";
import { JobCards } from "../components/job-cards";
import { MenuEntry } from "../components/menu-entry";
import { SectionFrame } from "../components/section-frame";
import { tpl } from "../utils";
import type { Job, Department, JobLabels } from "./job-board.types";

export type JobBoardProps = {
  id: string;
  title: string;
  lead?: string;
  jobs: Job[];
  departments: Department[];
  labels: JobLabels;
  layout?: "grid" | "grouped" | "table";
  salary?: "show" | "hide";
  tone?: "default" | "muted";
  empty?: string;
  landmarkLabel?: string;
};

export function JobBoard({
  id,
  title,
  lead = "",
  jobs,
  departments,
  labels,
  layout = "grid",
  salary = "hide",
  tone = "default",
  empty = "",
  landmarkLabel,
}: JobBoardProps) {
  return (
    <SectionFrame
      id={id}
      title={title}
      lead={lead}
      tone={tone}
      measure={(((layout as string) === "grouped") ? "3xl" : "default")}
      landmarkLabel={landmarkLabel}
    >
      {((jobs?.length ?? 0) === 0) ? (
        <EmptyState icon="briefcase" title={empty} />
      ) : ((layout as string) === "grouped") ? (
        <Stack gap="8" align="stretch" data-slot="groups">
          {(departments ?? []).map((d) => (
            <Stack key={d.id} gap="2" align="stretch" data-slot="group">
              <Group gap="4" align="baseline" justify="between">
                <Title as={3} size="lg" weight="bold">
                  {d.name}
                </Title>
                <Text size="xs" className="text-muted-foreground">
                  {tpl(labels.count, (jobs.filter((i) => !d.id || i["dept"] === d.id)?.length ?? 0))}
                </Text>
              </Group>
              <List tag="ul" className="flex flex-col">
                {(jobs.filter((i) => !d.id || i["dept"] === d.id) ?? []).map((j) => (
                  <ListItem key={j.id}
                    className="flex flex-wrap items-center justify-between gap-4 border-b border-border py-4"
                    data-slot="item"
                  >
                    <Stack gap="0">
                      <MenuEntry href={j.href} className="font-medium">
                        {j.title}
                      </MenuEntry>
                      <Text size="xs" className="text-muted-foreground">
                        {tpl("{0}, {1}", j.location, j.type)}
                      </Text>
                    </Stack>
                    <Badge variant="outline" size="default">
                      {j.type}
                    </Badge>
                  </ListItem>
                ))}
              </List>
            </Stack>
          ))}
        </Stack>
      ) : (
        <JobCards jobs={jobs} departments={departments} labels={labels} layout={layout} salary={salary} />
      )}
    </SectionFrame>
  );
}
blocks/job-board.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 Job = {
  id: string;
  title: string;
  dept: string;
  location: string;
  type: string;
  salary: string;
  posted: string;
  href?: string;
};

export type Department = {
  id: string;
  name: string;
};

export type JobLabels = {
  apply: string;
  caption: string;
  role: string;
  team: string;
  location: string;
  type: string;
  salary: string;
  count: 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 job-board
blocks/job-board.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 Job = {
  id: string;
  title: string;
  dept: string;
  location: string;
  type: string;
  salary: string;
  posted: string;
  href?: string;
};

export type Department = {
  id: string;
  name: string;
};

export type JobLabels = {
  apply: string;
  caption: string;
  role: string;
  team: string;
  location: string;
  type: string;
  salary: string;
  count: string;
};
blocks/job-board.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. -->
<!--
  Open jobs as cards in two columns, grouped by department, or as a table: the title, the department, the place,
  the type, an optional salary and an apply link. Axes: layout (grid, grouped, table), salary (show, hide),
  tone.
-->
<script lang="ts">
import type { Job, Department, JobLabels } from "./job-board.types";

export type JobBoardProps = {
  id: string;
  title: string;
  lead?: string;
  jobs: Job[];
  departments: Department[];
  labels: JobLabels;
  layout?: "grid" | "grouped" | "table";
  salary?: "show" | "hide";
  tone?: "default" | "muted";
  empty?: string;
  landmarkLabel?: string;
};
</script>

<script setup lang="ts">
import Badge from "../compose/Badge.vue";
import Group from "../compose/Group.vue";
import List from "../compose/List.vue";
import ListItem from "../compose/ListItem.vue";
import Stack from "../compose/Stack.vue";
import Text from "../compose/Text.vue";
import Title from "../compose/Title.vue";
import EmptyState from "../components/empty-state.vue";
import JobCards from "../components/job-cards.vue";
import MenuEntry from "../components/menu-entry.vue";
import SectionFrame from "../components/section-frame.vue";
import { tpl } from "../utils";

const {
  id,
  title,
  lead = "",
  jobs,
  departments,
  labels,
  layout = "grid",
  salary = "hide",
  tone = "default",
  empty = "",
  landmarkLabel,
} = defineProps<JobBoardProps>();
</script>

<template>
  <SectionFrame
    :id="id"
    :title="title"
    :lead="lead"
    :tone="tone"
    :measure="(((layout as string) === 'grouped') ? '3xl' : 'default')"
    :landmarkLabel="landmarkLabel"
  >
    <EmptyState v-if="((jobs?.length ?? 0) === 0)" icon="briefcase" :title="empty" />
    <Stack v-else-if="((layout as string) === 'grouped')" gap="8" align="stretch" data-slot="groups">
      <Stack v-for="d in departments" :key="d.id" gap="2" align="stretch" data-slot="group">
        <Group gap="4" align="baseline" justify="between">
          <Title :as="3" size="lg" weight="bold">
            {{ d.name }}
          </Title>
          <Text size="xs" class="text-muted-foreground">
            {{ tpl(labels.count, (jobs.filter((i) => !d.id || i["dept"] === d.id)?.length ?? 0)) }}
          </Text>
        </Group>
        <List tag="ul" class="flex flex-col">
          <ListItem v-for="j in jobs.filter((i) => !d.id || i['dept'] === d.id)" :key="j.id"
            class="flex flex-wrap items-center justify-between gap-4 border-b border-border py-4"
            data-slot="item"
          >
            <Stack gap="0">
              <MenuEntry :href="j.href" class="font-medium">
                {{ j.title }}
              </MenuEntry>
              <Text size="xs" class="text-muted-foreground">
                {{ tpl("{0}, {1}", j.location, j.type) }}
              </Text>
            </Stack>
            <Badge variant="outline" size="default">
              {{ j.type }}
            </Badge>
          </ListItem>
        </List>
      </Stack>
    </Stack>
    <JobCards v-else :jobs="jobs" :departments="departments" :labels="labels" :layout="layout" :salary="salary" />
  </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 job-board
blocks/job-board.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.
/**
 * Open jobs as cards in two columns, grouped by department, or as a table: the title, the department, the place,
 * the type, an optional salary and an apply link. Axes: layout (grid, grouped, table), salary (show, hide),
 * tone.
 */
import { For, type JSX } from "solid-js";
import { Badge, Group, List, ListItem, Stack, Text, Title } from "../compose";
import { EmptyState } from "../components/empty-state";
import { JobCards } from "../components/job-cards";
import { MenuEntry } from "../components/menu-entry";
import { SectionFrame } from "../components/section-frame";
import { tpl } from "../utils";
import type { Job, Department, JobLabels } from "./job-board.types";

export type JobBoardProps = {
  id: string;
  title: string;
  lead?: string;
  jobs: Job[];
  departments: Department[];
  labels: JobLabels;
  layout?: "grid" | "grouped" | "table";
  salary?: "show" | "hide";
  tone?: "default" | "muted";
  empty?: string;
  landmarkLabel?: string;
};

export function JobBoard({
  id,
  title,
  lead = "",
  jobs,
  departments,
  labels,
  layout = "grid",
  salary = "hide",
  tone = "default",
  empty = "",
  landmarkLabel,
}: JobBoardProps) {
  return (
    <SectionFrame
      id={id}
      title={title}
      lead={lead}
      tone={tone}
      measure={(((layout as string) === "grouped") ? "3xl" : "default")}
      landmarkLabel={landmarkLabel}
    >
      {((jobs?.length ?? 0) === 0) ? (
        <EmptyState icon="briefcase" title={empty} />
      ) : ((layout as string) === "grouped") ? (
        <Stack gap="8" align="stretch" data-slot="groups">
          <For each={departments ?? []}>{(d) => (
            <Stack gap="2" align="stretch" data-slot="group">
              <Group gap="4" align="baseline" justify="between">
                <Title as={3} size="lg" weight="bold">
                  {d.name}
                </Title>
                <Text size="xs" class="text-muted-foreground">
                  {tpl(labels.count, (jobs.filter((i) => !d.id || i["dept"] === d.id)?.length ?? 0))}
                </Text>
              </Group>
              <List tag="ul" class="flex flex-col">
                <For each={jobs.filter((i) => !d.id || i["dept"] === d.id) ?? []}>{(j) => (
                  <ListItem
                    class="flex flex-wrap items-center justify-between gap-4 border-b border-border py-4"
                    data-slot="item"
                  >
                    <Stack gap="0">
                      <MenuEntry href={j.href} class="font-medium">
                        {j.title}
                      </MenuEntry>
                      <Text size="xs" class="text-muted-foreground">
                        {tpl("{0}, {1}", j.location, j.type)}
                      </Text>
                    </Stack>
                    <Badge variant="outline" size="default">
                      {j.type}
                    </Badge>
                  </ListItem>
                )}</For>
              </List>
            </Stack>
          )}</For>
        </Stack>
      ) : (
        <JobCards jobs={jobs} departments={departments} labels={labels} layout={layout} salary={salary} />
      )}
    </SectionFrame>
  );
}
blocks/job-board.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 Job = {
  id: string;
  title: string;
  dept: string;
  location: string;
  type: string;
  salary: string;
  posted: string;
  href?: string;
};

export type Department = {
  id: string;
  name: string;
};

export type JobLabels = {
  apply: string;
  caption: string;
  role: string;
  team: string;
  location: string;
  type: string;
  salary: string;
  count: 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 job-board
blocks/job-board.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-board.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"
)

// JobBoardProps are the props of JobBoard; the values are the JSON shapes of the TypeScript props.
type JobBoardProps struct {
	Id any `json:"id"`
	Title any `json:"title"`
	Lead any `json:"lead"`
	Jobs any `json:"jobs"`
	Departments any `json:"departments"`
	Labels any `json:"labels"`
	Layout any `json:"layout"`
	Salary any `json:"salary"`
	Tone any `json:"tone"`
	Empty any `json:"empty"`
	LandmarkLabel any `json:"landmarkLabel"`
}

// Open jobs as cards in two columns, grouped by department, or as a table: the title, the department, the place, the type, an optional salary and an apply link. Axes: layout (grid, grouped, table), salary (show, hide), tone.
templ JobBoard(p JobBoardProps) {
	{{ vId := p.Id }}
	{{ vTitle := p.Title }}
	{{ vLead := uiutils.Def(p.Lead, "") }}
	{{ vJobs := p.Jobs }}
	{{ vDepartments := p.Departments }}
	{{ vLabels := p.Labels }}
	{{ vLayout := uiutils.Def(p.Layout, "grid") }}
	{{ vSalary := uiutils.Def(p.Salary, "hide") }}
	{{ vTone := uiutils.Def(p.Tone, "default") }}
	{{ vEmpty := uiutils.Def(p.Empty, "") }}
	{{ vLandmarkLabel := p.LandmarkLabel }}
	@SectionFrame(SectionFrameProps{Id: vId, Title: vTitle, Lead: vLead, Tone: vTone, Measure: uiutils.Cond(uiutils.T(uiutils.Eq(vLayout, "grouped")), "3xl", "default"), LandmarkLabel: vLandmarkLabel}) {
		if uiutils.Eq(uiutils.Len(vJobs), float64(0)) {
			@EmptyState(EmptyStateProps{Icon: "briefcase", Title: vEmpty})
		} else if uiutils.Eq(vLayout, "grouped") {
			@compose.Stack(compose.StackProps{Gap: "8", Align: "stretch", BoxProps: box.BoxProps{Attrs: uiutils.Attrs("data-slot", "groups")}}) {
				for _, vD := range uiutils.L(vDepartments) {
					@compose.Stack(compose.StackProps{Gap: "2", Align: "stretch", BoxProps: box.BoxProps{Attrs: uiutils.Attrs("data-slot", "group")}}) {
						@compose.Group(compose.GroupProps{Gap: "4", Align: "baseline", Justify: "between", BoxProps: box.BoxProps{}}) {
							@compose.Title(compose.TitleProps{As: "3", Size: "lg", Weight: "bold", TextProps: text.TextProps{}}) {
								{ uiutils.Text(uiutils.Get(vD, "name")) }
							}
							@compose.Text(compose.TextProps{Size: "xs", TextProps: text.TextProps{Class: "text-muted-foreground"}}) {
								{ uiutils.Text(uiutils.Tpl(uiutils.Get(vLabels, "count"), uiutils.Len(uiutils.Where(vJobs, "dept", uiutils.Get(vD, "id"))))) }
							}
						}
						@compose.List(compose.ListProps{BoxProps: box.BoxProps{Tag: "ul", Class: "flex flex-col"}}) {
							for _, vJ := range uiutils.L(uiutils.Where(vJobs, "dept", uiutils.Get(vD, "id"))) {
								@compose.ListItem(compose.ListItemProps{BoxProps: box.BoxProps{Class: "flex flex-wrap items-center justify-between gap-4 border-b border-border py-4", Attrs: uiutils.Attrs("data-slot", "item")}}) {
									@compose.Stack(compose.StackProps{Gap: "0", BoxProps: box.BoxProps{}}) {
										@MenuEntry(MenuEntryProps{Href: uiutils.Get(vJ, "href"), Class: uiutils.Cnv("font-medium")}) {
											{ uiutils.Text(uiutils.Get(vJ, "title")) }
										}
										@compose.Text(compose.TextProps{Size: "xs", TextProps: text.TextProps{Class: "text-muted-foreground"}}) {
											{ uiutils.Text(uiutils.Tpl("{0}, {1}", uiutils.Get(vJ, "location"), uiutils.Get(vJ, "type"))) }
										}
									}
									@compose.Badge(compose.BadgeProps{Variant: "outline", Size: "default", TextProps: text.TextProps{}}) {
										{ uiutils.Text(uiutils.Get(vJ, "type")) }
									}
								}
							}
						}
					}
				}
			}
		} else {
			@JobCards(JobCardsProps{Jobs: vJobs, Departments: vDepartments, Labels: vLabels, Layout: vLayout, Salary: vSalary})
		}
	}
}

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-board
blocks/job-board.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-board.json
    Open jobs as cards in two columns, grouped by department, or as a table: the title, the department, the place, the type, an optional salary and an apply link. Axes: layout (grid, grouped, table), salary (show, hide), tone.
    Props (p): id, title, lead, jobs, departments, labels, layout, salary, tone, empty, landmarkLabel. -#}
{%- set v_id = (p.id ?? null) -%}
{%- set v_title = (p.title ?? null) -%}
{%- set v_lead = (p.lead ?? '') -%}
{%- 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') -%}
{%- set v_tone = (p.tone ?? 'default') -%}
{%- set v_empty = (p.empty ?? '') -%}
{%- set v_landmarkLabel = (p.landmarkLabel ?? null) -%}
{%- set c_12 -%}
  {%- if og_t(og_eq(og_len(v_jobs), 0)) %}
    {{ include('blocks/empty-state.html.twig', {'p': {'icon': 'briefcase', 'title': v_empty}}, with_context = false) }}
  {%- elseif og_t(og_eq(v_layout, 'grouped')) %}
    {%- set c_11 -%}
      {%- for v_d in og_l(v_departments) %}
        {%- set c_10 -%}
          {%- set c_3 -%}
            {%- set c_1 -%}
              {{ og_text(og_get(v_d, ['name'])) }}
            {%- endset -%}
            {{ include('compose/Title.html.twig', {'as': 3, 'size': 'lg', 'weight': 'bold', 'children': c_1}, with_context = false) }}
            {%- set c_2 -%}
              {{ og_text(og_tpl(og_get(v_labels, ['count']), [og_len(og_where(v_jobs, 'dept', og_get(v_d, ['id'])))])) }}
            {%- 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', 'align': 'baseline', 'justify': 'between', 'children': c_3}, with_context = false) }}
          {%- set c_9 -%}
            {%- for v_j in og_l(og_where(v_jobs, 'dept', og_get(v_d, ['id']))) %}
              {%- set c_8 -%}
                {%- set c_6 -%}
                  {%- set c_4 -%}
                    {{ og_text(og_get(v_j, ['title'])) }}
                  {%- endset -%}
                  {{ include('blocks/menu-entry.html.twig', {'p': {'href': og_get(v_j, ['href']), 'className': og_cnv(['font-medium'])}, 'children': og_markup(c_4)}, with_context = false) }}
                  {%- set c_5 -%}
                    {{ og_text(og_tpl('{0}, {1}', [og_get(v_j, ['location']), og_get(v_j, ['type'])])) }}
                  {%- endset -%}
                  {{ include('compose/Text.html.twig', {'size': 'xs', 'class': 'text-muted-foreground', 'children': c_5}, with_context = false) }}
                {%- endset -%}
                {{ include('compose/Stack.html.twig', {'gap': '0', 'children': c_6}, with_context = false) }}
                {%- set c_7 -%}
                  {{ og_text(og_get(v_j, ['type'])) }}
                {%- endset -%}
                {{ include('compose/Badge.html.twig', {'variant': 'outline', 'size': 'default', 'children': c_7}, with_context = false) }}
              {%- endset -%}
              {{ include('compose/ListItem.html.twig', {'class': 'flex flex-wrap items-center justify-between gap-4 border-b border-border py-4', 'attrs': og_attrs(['data-slot', 'item']), 'children': c_8}, with_context = false) }}
            {%- endfor %}
          {%- endset -%}
          {{ include('compose/List.html.twig', {'tag': 'ul', 'class': 'flex flex-col', 'children': c_9}, with_context = false) }}
        {%- endset -%}
        {{ include('compose/Stack.html.twig', {'gap': '2', 'align': 'stretch', 'attrs': og_attrs(['data-slot', 'group']), 'children': c_10}, with_context = false) }}
      {%- endfor %}
    {%- endset -%}
    {{ include('compose/Stack.html.twig', {'gap': '8', 'align': 'stretch', 'attrs': og_attrs(['data-slot', 'groups']), 'children': c_11}, with_context = false) }}
  {%- else %}
    {{ include('blocks/job-cards.html.twig', {'p': {'jobs': v_jobs, 'departments': v_departments, 'labels': v_labels, 'layout': v_layout, 'salary': v_salary}}, with_context = false) }}
  {%- endif %}
{%- endset -%}
{{ include('blocks/section-frame.html.twig', {'p': {'id': v_id, 'title': v_title, 'lead': v_lead, 'tone': v_tone, 'measure': (og_t(og_eq(v_layout, 'grouped')) ? '3xl' : 'default'), 'landmarkLabel': v_landmarkLabel}, 'children': og_markup(c_12)}, 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 job-board
blocks/job-board.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-board.json
    Open jobs as cards in two columns, grouped by department, or as a table: the title, the department, the place, the type, an optional salary and an apply link. Axes: layout (grid, grouped, table), salary (show, hide), tone.
    Props (p): id, title, lead, jobs, departments, labels, layout, salary, tone, empty, landmarkLabel. *}
{var $v_id = ($p['id'] ?? null)}
{var $v_title = ($p['title'] ?? null)}
{var $v_lead = ($p['lead'] ?? '')}
{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')}
{var $v_tone = ($p['tone'] ?? 'default')}
{var $v_empty = ($p['empty'] ?? '')}
{var $v_landmarkLabel = ($p['landmarkLabel'] ?? null)}
{capture $c_12}
  {if og_t(og_eq(og_len($v_jobs), 0))}
    {=og_include('blocks/empty-state.latte', ['p' => ['icon' => 'briefcase', 'title' => $v_empty]])|noescape}
  {elseif og_t(og_eq($v_layout, 'grouped'))}
    {capture $c_11}
      {foreach og_l($v_departments) as $v_d}
        {capture $c_10}
          {capture $c_3}
            {capture $c_1}
              {=og_text(og_get($v_d, ['name']))}
            {/capture}
            {=og_include('compose/Title.latte', ['as' => 3, 'size' => 'lg', 'weight' => 'bold', 'children' => (string) $c_1])|noescape}
            {capture $c_2}
              {=og_text(og_tpl(og_get($v_labels, ['count']), [og_len(og_where($v_jobs, 'dept', og_get($v_d, ['id'])))]))}
            {/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', 'align' => 'baseline', 'justify' => 'between', 'children' => (string) $c_3])|noescape}
          {capture $c_9}
            {foreach og_l(og_where($v_jobs, 'dept', og_get($v_d, ['id']))) as $v_j}
              {capture $c_8}
                {capture $c_6}
                  {capture $c_4}
                    {=og_text(og_get($v_j, ['title']))}
                  {/capture}
                  {=og_include('blocks/menu-entry.latte', ['p' => ['href' => og_get($v_j, ['href']), 'className' => og_cnv(['font-medium'])], 'children' => og_markup($c_4)])|noescape}
                  {capture $c_5}
                    {=og_text(og_tpl('{0}, {1}', [og_get($v_j, ['location']), og_get($v_j, ['type'])]))}
                  {/capture}
                  {=og_include('compose/Text.latte', ['size' => 'xs', 'class' => 'text-muted-foreground', 'children' => (string) $c_5])|noescape}
                {/capture}
                {=og_include('compose/Stack.latte', ['gap' => '0', 'children' => (string) $c_6])|noescape}
                {capture $c_7}
                  {=og_text(og_get($v_j, ['type']))}
                {/capture}
                {=og_include('compose/Badge.latte', ['variant' => 'outline', 'size' => 'default', 'children' => (string) $c_7])|noescape}
              {/capture}
              {=og_include('compose/ListItem.latte', ['class' => 'flex flex-wrap items-center justify-between gap-4 border-b border-border py-4', 'attrs' => og_attrs(['data-slot', 'item']), 'children' => (string) $c_8])|noescape}
            {/foreach}
          {/capture}
          {=og_include('compose/List.latte', ['tag' => 'ul', 'class' => 'flex flex-col', 'children' => (string) $c_9])|noescape}
        {/capture}
        {=og_include('compose/Stack.latte', ['gap' => '2', 'align' => 'stretch', 'attrs' => og_attrs(['data-slot', 'group']), 'children' => (string) $c_10])|noescape}
      {/foreach}
    {/capture}
    {=og_include('compose/Stack.latte', ['gap' => '8', 'align' => 'stretch', 'attrs' => og_attrs(['data-slot', 'groups']), 'children' => (string) $c_11])|noescape}
  {else}
    {=og_include('blocks/job-cards.latte', ['p' => ['jobs' => $v_jobs, 'departments' => $v_departments, 'labels' => $v_labels, 'layout' => $v_layout, 'salary' => $v_salary]])|noescape}
  {/if}
{/capture}
{=og_include('blocks/section-frame.latte', ['p' => ['id' => $v_id, 'title' => $v_title, 'lead' => $v_lead, 'tone' => $v_tone, 'measure' => (og_t(og_eq($v_layout, 'grouped')) ? '3xl' : 'default'), 'landmarkLabel' => $v_landmarkLabel], 'children' => og_markup($c_12)])|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 job-board
blocks/job-board.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-board.json
    Open jobs as cards in two columns, grouped by department, or as a table: the title, the department, the place, the type, an optional salary and an apply link. Axes: layout (grid, grouped, table), salary (show, hide), tone.
    Props (p): id, title, lead, jobs, departments, labels, layout, salary, tone, empty, 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_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') -%}
{%- set v_tone = og_def(p['tone'], 'default') -%}
{%- set v_empty = og_def(p['empty'], '') -%}
{%- set v_landmarkLabel = og_def(p['landmarkLabel'], none) -%}
{%- set c_12 -%}
  {%- if og_t(og_eq(og_len(v_jobs), 0)) %}
    {{ og_include('blocks/empty-state.html.j2', {'p': {'icon': 'briefcase', 'title': v_empty}}) }}
  {%- elif og_t(og_eq(v_layout, 'grouped')) %}
    {%- set c_11 -%}
      {%- for v_d in og_l(v_departments) %}
        {%- set c_10 -%}
          {%- set c_3 -%}
            {%- set c_1 -%}
              {{ og_text(og_get(v_d, ['name'])) }}
            {%- endset -%}
            {{ og_include('compose/title.html.j2', {'p': {'As': 3, 'Size': 'lg', 'Weight': 'bold'}, 'children': c_1}) }}
            {%- set c_2 -%}
              {{ og_text(og_tpl(og_get(v_labels, ['count']), [og_len(og_where(v_jobs, 'dept', og_get(v_d, ['id'])))])) }}
            {%- 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', 'Align': 'baseline', 'Justify': 'between'}, 'children': c_3}) }}
          {%- set c_9 -%}
            {%- for v_j in og_l(og_where(v_jobs, 'dept', og_get(v_d, ['id']))) %}
              {%- set c_8 -%}
                {%- set c_6 -%}
                  {%- set c_4 -%}
                    {{ og_text(og_get(v_j, ['title'])) }}
                  {%- endset -%}
                  {{ og_include('blocks/menu-entry.html.j2', {'p': {'href': og_get(v_j, ['href']), 'className': og_cnv(['font-medium'])}, 'children': og_markup(c_4)}) }}
                  {%- set c_5 -%}
                    {{ og_text(og_tpl('{0}, {1}', [og_get(v_j, ['location']), og_get(v_j, ['type'])])) }}
                  {%- endset -%}
                  {{ og_include('compose/text.html.j2', {'p': {'Size': 'xs', 'Class': 'text-muted-foreground'}, 'children': c_5}) }}
                {%- endset -%}
                {{ og_include('compose/stack.html.j2', {'p': {'Gap': '0'}, 'children': c_6}) }}
                {%- set c_7 -%}
                  {{ og_text(og_get(v_j, ['type'])) }}
                {%- endset -%}
                {{ og_include('compose/badge.html.j2', {'p': {'Variant': 'outline', 'Size': 'default'}, 'children': c_7}) }}
              {%- endset -%}
              {{ og_include('compose/list-item.html.j2', {'p': {'Class': 'flex flex-wrap items-center justify-between gap-4 border-b border-border py-4', 'Attrs': og_attrs(['data-slot', 'item'])}, 'children': c_8}) }}
            {%- endfor %}
          {%- endset -%}
          {{ og_include('compose/list.html.j2', {'p': {'Tag': 'ul', 'Class': 'flex flex-col'}, 'children': c_9}) }}
        {%- endset -%}
        {{ og_include('compose/stack.html.j2', {'p': {'Gap': '2', 'Align': 'stretch', 'Attrs': og_attrs(['data-slot', 'group'])}, 'children': c_10}) }}
      {%- endfor %}
    {%- endset -%}
    {{ og_include('compose/stack.html.j2', {'p': {'Gap': '8', 'Align': 'stretch', 'Attrs': og_attrs(['data-slot', 'groups'])}, 'children': c_11}) }}
  {%- else %}
    {{ og_include('blocks/job-cards.html.j2', {'p': {'jobs': v_jobs, 'departments': v_departments, 'labels': v_labels, 'layout': v_layout, 'salary': v_salary}}) }}
  {%- endif %}
{%- endset -%}
{{ og_include('blocks/section-frame.html.j2', {'p': {'id': v_id, 'title': v_title, 'lead': v_lead, 'tone': v_tone, 'measure': ('3xl' if og_t(og_eq(v_layout, 'grouped')) else 'default'), 'landmarkLabel': v_landmarkLabel}, 'children': og_markup(c_12)}) }}

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.

Open jobs as cards in two columns, grouped by department, or as a table: the title, the department, the place, the type, an optional salary and an apply link. Axes: layout (grid, grouped, table), salary (show, hide), tone.

Props of JobBoard
PropTypeDefault Description
id (required)string-
title (required)string-
lead string""
jobs (required)Job[]-
departments (required)Department[]-
labels (required)JobLabels-
layout "grid" | "grouped" | "table""grid"
salary "show" | "hide""hide"
tone "default" | "muted""default"
empty string""the text of the empty state (no records), from the dictionary
landmarkLabel string-accessible name of the landmark of this component when the page shows it more than once (a variant); replaces the heading name of the root landmark, follows the name of a nested one

Used in