Kanban Board
Work items in lanes with a count; cards with a tag and a person. Moving cards is a port contract (SortableList).
Install
npx ui8kit add kanban-boardPulls in: compose, empty-state, grid, group, kit-box, kit-text, list, list-item, pill, section-frame, stack, text, title, utils
Preview
Launch board
To do
2 cards
Write the launch post
ContentMara Quinn
Review pricing copy
GrowthJon Ellis
In progress
2 cards
Build the signup flow
ProductAya Tanaka
Fix the cart total
BugLuis Ortega
Done
2 cards
Publish the docs
DocsMara Quinn
Ship dark mode
DesignAya Tanaka
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-cdnnpx ui8kit add kanban-board<!-- Code generated by packages/kit-compose/src/organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT. -->
<!--
Work items in lanes. Each lane has a title, a count and its cards; a card has a title, an optional tag and the
person it belongs to. Axes: card (simple, detail: tag and person), cols (2, 3), tone, density. Moving a card
between lanes is a port contract.
-->
<script lang="ts" module>
import type { Snippet } from "svelte";
import type { Lane, BoardCard } from "./kanban-board.types";
export type KanbanBoardProps = {
id: string;
title: string;
lanes: Lane[];
empty?: string;
cards: BoardCard[];
countLabel: string;
card?: "simple" | "detail";
cols?: "2" | "3";
tone?: "default" | "muted";
density?: "default" | "compact";
landmarkLabel?: string;
};
</script>
<script lang="ts">
import Grid from "../compose/Grid.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 Pill from "../components/pill.svelte";
import SectionFrame from "../components/section-frame.svelte";
import { cn, tpl } from "../utils";
let {
id,
title,
lanes,
empty = "",
cards,
countLabel,
card = "detail",
cols = "3",
tone = "default",
density = "default",
landmarkLabel,
}: KanbanBoardProps = $props();
</script>
<SectionFrame id={id} title={title} tone={tone} density={density} landmarkLabel={landmarkLabel}>
{#if ((lanes?.length ?? 0) === 0)}
<EmptyState icon="kanban" title={empty} />
{:else}
<Grid cols={(((cols as string) === "2") ? "1-2" : "1-3")} class="items-start gap-4" data-slot="lanes">
{#each lanes as lane (lane.id)}
<Stack gap="4" align="stretch" class="rounded bg-muted p-4" data-slot="lane">
<Group gap="2" align="center" justify="between">
<Title as={3} size="base" weight="bold">
{lane.title}
</Title>
<Text size="xs" class="text-muted-foreground">
{tpl(countLabel, (cards.filter((i) => !lane.key || i["lane"] === lane.key)?.length ?? 0))}
</Text>
</Group>
<List class="m-0 flex list-none flex-col gap-2 p-0">
{#each cards.filter((i) => !lane.key || i["lane"] === lane.key) as c (c.id)}
<ListItem
class={cn(
"flex flex-col rounded bg-card inset-ring inset-ring-border",
(((density as string) === "compact") ? "gap-2 p-2" : "gap-2 p-4")
)}
data-slot="item"
>
<Text size="sm" weight="semibold">
{c.title}
</Text>
{#if ((card as string) === "detail")}
<Group gap="2" align="center" justify="between" class="flex-wrap">
<Pill tone="blue" icon="tag">
{c.tag}
</Pill>
<Text size="xs" class="text-muted-foreground">
{c.who}
</Text>
</Group>
{/if}
</ListItem>
{/each}
</List>
</Stack>
{/each}
</Grid>
{/if}
</SectionFrame>
// 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 Lane = {
id: string;
key: string;
title: string;
};
export type BoardCard = {
id: string;
lane: string;
title: string;
tag: string;
who: string;
};
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-cdnnpx ui8kit add kanban-board// Code generated by packages/kit-compose/src/organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT.
/**
* Work items in lanes. Each lane has a title, a count and its cards; a card has a title, an optional tag and the
* person it belongs to. Axes: card (simple, detail: tag and person), cols (2, 3), tone, density. Moving a card
* between lanes is a port contract.
*/
import { type ReactNode } from "react";
import { Grid, Group, List, ListItem, Stack, Text, Title } from "../compose";
import { EmptyState } from "../components/empty-state";
import { Pill } from "../components/pill";
import { SectionFrame } from "../components/section-frame";
import { cn, tpl } from "../utils";
import type { Lane, BoardCard } from "./kanban-board.types";
export type KanbanBoardProps = {
id: string;
title: string;
lanes: Lane[];
empty?: string;
cards: BoardCard[];
countLabel: string;
card?: "simple" | "detail";
cols?: "2" | "3";
tone?: "default" | "muted";
density?: "default" | "compact";
landmarkLabel?: string;
};
export function KanbanBoard({
id,
title,
lanes,
empty = "",
cards,
countLabel,
card = "detail",
cols = "3",
tone = "default",
density = "default",
landmarkLabel,
}: KanbanBoardProps) {
return (
<SectionFrame id={id} title={title} tone={tone} density={density} landmarkLabel={landmarkLabel}>
{((lanes?.length ?? 0) === 0) ? (
<EmptyState icon="kanban" title={empty} />
) : (
<Grid cols={(((cols as string) === "2") ? "1-2" : "1-3")} className="items-start gap-4" data-slot="lanes">
{(lanes ?? []).map((lane) => (
<Stack key={lane.id} gap="4" align="stretch" className="rounded bg-muted p-4" data-slot="lane">
<Group gap="2" align="center" justify="between">
<Title as={3} size="base" weight="bold">
{lane.title}
</Title>
<Text size="xs" className="text-muted-foreground">
{tpl(countLabel, (cards.filter((i) => !lane.key || i["lane"] === lane.key)?.length ?? 0))}
</Text>
</Group>
<List className="m-0 flex list-none flex-col gap-2 p-0">
{(cards.filter((i) => !lane.key || i["lane"] === lane.key) ?? []).map((c) => (
<ListItem key={c.id}
className={cn(
"flex flex-col rounded bg-card inset-ring inset-ring-border",
(((density as string) === "compact") ? "gap-2 p-2" : "gap-2 p-4")
)}
data-slot="item"
>
<Text size="sm" weight="semibold">
{c.title}
</Text>
{((card as string) === "detail") ? (
<Group gap="2" align="center" justify="between" className="flex-wrap">
<Pill tone="blue" icon="tag">
{c.tag}
</Pill>
<Text size="xs" className="text-muted-foreground">
{c.who}
</Text>
</Group>
) : null}
</ListItem>
))}
</List>
</Stack>
))}
</Grid>
)}
</SectionFrame>
);
}
// 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 Lane = {
id: string;
key: string;
title: string;
};
export type BoardCard = {
id: string;
lane: string;
title: string;
tag: string;
who: string;
};
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-cdnnpx ui8kit add kanban-board// 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 Lane = {
id: string;
key: string;
title: string;
};
export type BoardCard = {
id: string;
lane: string;
title: string;
tag: string;
who: string;
};
<!-- Code generated by packages/kit-compose/src/organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT. -->
<!--
Work items in lanes. Each lane has a title, a count and its cards; a card has a title, an optional tag and the
person it belongs to. Axes: card (simple, detail: tag and person), cols (2, 3), tone, density. Moving a card
between lanes is a port contract.
-->
<script lang="ts">
import type { Lane, BoardCard } from "./kanban-board.types";
export type KanbanBoardProps = {
id: string;
title: string;
lanes: Lane[];
empty?: string;
cards: BoardCard[];
countLabel: string;
card?: "simple" | "detail";
cols?: "2" | "3";
tone?: "default" | "muted";
density?: "default" | "compact";
landmarkLabel?: string;
};
</script>
<script setup lang="ts">
import Grid from "../compose/Grid.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 Pill from "../components/pill.vue";
import SectionFrame from "../components/section-frame.vue";
import { cn, tpl } from "../utils";
const {
id,
title,
lanes,
empty = "",
cards,
countLabel,
card = "detail",
cols = "3",
tone = "default",
density = "default",
landmarkLabel,
} = defineProps<KanbanBoardProps>();
</script>
<template>
<SectionFrame :id="id" :title="title" :tone="tone" :density="density" :landmarkLabel="landmarkLabel">
<EmptyState v-if="((lanes?.length ?? 0) === 0)" icon="kanban" :title="empty" />
<Grid v-else :cols="(((cols as string) === '2') ? '1-2' : '1-3')" class="items-start gap-4" data-slot="lanes">
<Stack
v-for="lane in lanes"
:key="lane.id"
gap="4"
align="stretch"
class="rounded bg-muted p-4"
data-slot="lane"
>
<Group gap="2" align="center" justify="between">
<Title :as="3" size="base" weight="bold">
{{ lane.title }}
</Title>
<Text size="xs" class="text-muted-foreground">
{{ tpl(countLabel, (cards.filter((i) => !lane.key || i["lane"] === lane.key)?.length ?? 0)) }}
</Text>
</Group>
<List class="m-0 flex list-none flex-col gap-2 p-0">
<ListItem v-for="c in cards.filter((i) => !lane.key || i['lane'] === lane.key)" :key="c.id"
:class="cn(
'flex flex-col rounded bg-card inset-ring inset-ring-border',
(((density as string) === 'compact') ? 'gap-2 p-2' : 'gap-2 p-4')
)"
data-slot="item"
>
<Text size="sm" weight="semibold">
{{ c.title }}
</Text>
<Group v-if="((card as string) === 'detail')" gap="2" align="center" justify="between" class="flex-wrap">
<Pill tone="blue" icon="tag">
{{ c.tag }}
</Pill>
<Text size="xs" class="text-muted-foreground">
{{ c.who }}
</Text>
</Group>
</ListItem>
</List>
</Stack>
</Grid>
</SectionFrame>
</template>
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-cdnnpx ui8kit add kanban-board// Code generated by packages/kit-compose/src/organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT.
/**
* Work items in lanes. Each lane has a title, a count and its cards; a card has a title, an optional tag and the
* person it belongs to. Axes: card (simple, detail: tag and person), cols (2, 3), tone, density. Moving a card
* between lanes is a port contract.
*/
import { For, type JSX } from "solid-js";
import { Grid, Group, List, ListItem, Stack, Text, Title } from "../compose";
import { EmptyState } from "../components/empty-state";
import { Pill } from "../components/pill";
import { SectionFrame } from "../components/section-frame";
import { cn, tpl } from "../utils";
import type { Lane, BoardCard } from "./kanban-board.types";
export type KanbanBoardProps = {
id: string;
title: string;
lanes: Lane[];
empty?: string;
cards: BoardCard[];
countLabel: string;
card?: "simple" | "detail";
cols?: "2" | "3";
tone?: "default" | "muted";
density?: "default" | "compact";
landmarkLabel?: string;
};
export function KanbanBoard({
id,
title,
lanes,
empty = "",
cards,
countLabel,
card = "detail",
cols = "3",
tone = "default",
density = "default",
landmarkLabel,
}: KanbanBoardProps) {
return (
<SectionFrame id={id} title={title} tone={tone} density={density} landmarkLabel={landmarkLabel}>
{((lanes?.length ?? 0) === 0) ? (
<EmptyState icon="kanban" title={empty} />
) : (
<Grid cols={(((cols as string) === "2") ? "1-2" : "1-3")} class="items-start gap-4" data-slot="lanes">
<For each={lanes ?? []}>{(lane) => (
<Stack gap="4" align="stretch" class="rounded bg-muted p-4" data-slot="lane">
<Group gap="2" align="center" justify="between">
<Title as={3} size="base" weight="bold">
{lane.title}
</Title>
<Text size="xs" class="text-muted-foreground">
{tpl(countLabel, (cards.filter((i) => !lane.key || i["lane"] === lane.key)?.length ?? 0))}
</Text>
</Group>
<List class="m-0 flex list-none flex-col gap-2 p-0">
<For each={cards.filter((i) => !lane.key || i["lane"] === lane.key) ?? []}>{(c) => (
<ListItem
class={cn(
"flex flex-col rounded bg-card inset-ring inset-ring-border",
(((density as string) === "compact") ? "gap-2 p-2" : "gap-2 p-4")
)}
data-slot="item"
>
<Text size="sm" weight="semibold">
{c.title}
</Text>
{((card as string) === "detail") ? (
<Group gap="2" align="center" justify="between" class="flex-wrap">
<Pill tone="blue" icon="tag">
{c.tag}
</Pill>
<Text size="xs" class="text-muted-foreground">
{c.who}
</Text>
</Group>
) : null}
</ListItem>
)}</For>
</List>
</Stack>
)}</For>
</Grid>
)}
</SectionFrame>
);
}
// 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 Lane = {
id: string;
key: string;
title: string;
};
export type BoardCard = {
id: string;
lane: string;
title: string;
tag: string;
who: string;
};
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-cdnnpx ui8kit add kanban-board// 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/kanban-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"
)
// KanbanBoardProps are the props of KanbanBoard; the values are the JSON shapes of the TypeScript props.
type KanbanBoardProps struct {
Id any `json:"id"`
Title any `json:"title"`
Lanes any `json:"lanes"`
Empty any `json:"empty"`
Cards any `json:"cards"`
CountLabel any `json:"countLabel"`
Card any `json:"card"`
Cols any `json:"cols"`
Tone any `json:"tone"`
Density any `json:"density"`
LandmarkLabel any `json:"landmarkLabel"`
}
// Work items in lanes. Each lane has a title, a count and its cards; a card has a title, an optional tag and the person it belongs to. Axes: card (simple, detail: tag and person), cols (2, 3), tone, density. Moving a card between lanes is a port contract.
templ KanbanBoard(p KanbanBoardProps) {
{{ vId := p.Id }}
{{ vTitle := p.Title }}
{{ vLanes := p.Lanes }}
{{ vEmpty := uiutils.Def(p.Empty, "") }}
{{ vCards := p.Cards }}
{{ vCountLabel := p.CountLabel }}
{{ vCard := uiutils.Def(p.Card, "detail") }}
{{ vCols := uiutils.Def(p.Cols, "3") }}
{{ vTone := uiutils.Def(p.Tone, "default") }}
{{ vDensity := uiutils.Def(p.Density, "default") }}
{{ vLandmarkLabel := p.LandmarkLabel }}
@SectionFrame(SectionFrameProps{Id: vId, Title: vTitle, Tone: vTone, Density: vDensity, LandmarkLabel: vLandmarkLabel}) {
if uiutils.Eq(uiutils.Len(vLanes), float64(0)) {
@EmptyState(EmptyStateProps{Icon: "kanban", Title: vEmpty})
} else {
@compose.Grid(compose.GridProps{Cols: uiutils.S(uiutils.Cond(uiutils.T(uiutils.Eq(vCols, "2")), "1-2", "1-3")), BoxProps: box.BoxProps{Class: "items-start gap-4", Attrs: uiutils.Attrs("data-slot", "lanes")}}) {
for _, vLane := range uiutils.L(vLanes) {
@compose.Stack(compose.StackProps{Gap: "4", Align: "stretch", BoxProps: box.BoxProps{Class: "rounded bg-muted p-4", Attrs: uiutils.Attrs("data-slot", "lane")}}) {
@compose.Group(compose.GroupProps{Gap: "2", Align: "center", Justify: "between", BoxProps: box.BoxProps{}}) {
@compose.Title(compose.TitleProps{As: "3", Size: "base", Weight: "bold", TextProps: text.TextProps{}}) {
{ uiutils.Text(uiutils.Get(vLane, "title")) }
}
@compose.Text(compose.TextProps{Size: "xs", TextProps: text.TextProps{Class: "text-muted-foreground"}}) {
{ uiutils.Text(uiutils.Tpl(vCountLabel, uiutils.Len(uiutils.Where(vCards, "lane", uiutils.Get(vLane, "key"))))) }
}
}
@compose.List(compose.ListProps{BoxProps: box.BoxProps{Class: "m-0 flex list-none flex-col gap-2 p-0"}}) {
for _, vC := range uiutils.L(uiutils.Where(vCards, "lane", uiutils.Get(vLane, "key"))) {
@compose.ListItem(compose.ListItemProps{BoxProps: box.BoxProps{Class: uiutils.S(uiutils.Cnv("flex flex-col rounded bg-card inset-ring inset-ring-border", uiutils.Cond(uiutils.T(uiutils.Eq(vDensity, "compact")), "gap-2 p-2", "gap-2 p-4"))), Attrs: uiutils.Attrs("data-slot", "item")}}) {
@compose.Text(compose.TextProps{Size: "sm", Weight: "semibold", TextProps: text.TextProps{}}) {
{ uiutils.Text(uiutils.Get(vC, "title")) }
}
if uiutils.Eq(vCard, "detail") {
@compose.Group(compose.GroupProps{Gap: "2", Align: "center", Justify: "between", BoxProps: box.BoxProps{Class: "flex-wrap"}}) {
@Pill(PillProps{Tone: "blue", Icon: "tag"}) {
{ uiutils.Text(uiutils.Get(vC, "tag")) }
}
@compose.Text(compose.TextProps{Size: "xs", TextProps: text.TextProps{Class: "text-muted-foreground"}}) {
{ uiutils.Text(uiutils.Get(vC, "who")) }
}
}
}
}
}
}
}
}
}
}
}
}
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-cdnnpx ui8kit add kanban-board{#- 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/kanban-board.json
Work items in lanes. Each lane has a title, a count and its cards; a card has a title, an optional tag and the person it belongs to. Axes: card (simple, detail: tag and person), cols (2, 3), tone, density. Moving a card between lanes is a port contract.
Props (p): id, title, lanes, empty, cards, countLabel, card, cols, tone, density, landmarkLabel. -#}
{%- set v_id = (p.id ?? null) -%}
{%- set v_title = (p.title ?? null) -%}
{%- set v_lanes = (p.lanes ?? null) -%}
{%- set v_empty = (p.empty ?? '') -%}
{%- set v_cards = (p.cards ?? null) -%}
{%- set v_countLabel = (p.countLabel ?? null) -%}
{%- set v_card = (p.card ?? 'detail') -%}
{%- set v_cols = (p.cols ?? '3') -%}
{%- set v_tone = (p.tone ?? 'default') -%}
{%- set v_density = (p.density ?? 'default') -%}
{%- set v_landmarkLabel = (p.landmarkLabel ?? null) -%}
{%- set c_12 -%}
{%- if og_t(og_eq(og_len(v_lanes), 0)) %}
{{ include('blocks/empty-state.html.twig', {'p': {'icon': 'kanban', 'title': v_empty}}, with_context = false) }}
{%- else %}
{%- set c_11 -%}
{%- for v_lane in og_l(v_lanes) %}
{%- set c_10 -%}
{%- set c_3 -%}
{%- set c_1 -%}
{{ og_text(og_get(v_lane, ['title'])) }}
{%- endset -%}
{{ include('compose/Title.html.twig', {'as': 3, 'size': 'base', 'weight': 'bold', 'children': c_1}, with_context = false) }}
{%- set c_2 -%}
{{ og_text(og_tpl(v_countLabel, [og_len(og_where(v_cards, 'lane', og_get(v_lane, ['key'])))])) }}
{%- 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': '2', 'align': 'center', 'justify': 'between', 'children': c_3}, with_context = false) }}
{%- set c_9 -%}
{%- for v_c in og_l(og_where(v_cards, 'lane', og_get(v_lane, ['key']))) %}
{%- set c_8 -%}
{%- set c_4 -%}
{{ og_text(og_get(v_c, ['title'])) }}
{%- endset -%}
{{ include('compose/Text.html.twig', {'size': 'sm', 'weight': 'semibold', 'children': c_4}, with_context = false) }}
{%- if og_t(og_eq(v_card, 'detail')) %}
{%- set c_7 -%}
{%- set c_5 -%}
{{ og_text(og_get(v_c, ['tag'])) }}
{%- endset -%}
{{ include('blocks/pill.html.twig', {'p': {'tone': 'blue', 'icon': 'tag'}, 'children': og_markup(c_5)}, with_context = false) }}
{%- set c_6 -%}
{{ og_text(og_get(v_c, ['who'])) }}
{%- endset -%}
{{ include('compose/Text.html.twig', {'size': 'xs', 'class': 'text-muted-foreground', 'children': c_6}, with_context = false) }}
{%- endset -%}
{{ include('compose/Group.html.twig', {'gap': '2', 'align': 'center', 'justify': 'between', 'class': 'flex-wrap', 'children': c_7}, with_context = false) }}
{%- endif %}
{%- endset -%}
{{ include('compose/ListItem.html.twig', {'class': og_s(og_cnv(['flex flex-col rounded bg-card inset-ring inset-ring-border', (og_t(og_eq(v_density, 'compact')) ? 'gap-2 p-2' : 'gap-2 p-4')])), 'attrs': og_attrs(['data-slot', 'item']), 'children': c_8}, with_context = false) }}
{%- endfor %}
{%- endset -%}
{{ include('compose/List.html.twig', {'class': 'm-0 flex list-none flex-col gap-2 p-0', 'children': c_9}, with_context = false) }}
{%- endset -%}
{{ include('compose/Stack.html.twig', {'gap': '4', 'align': 'stretch', 'class': 'rounded bg-muted p-4', 'attrs': og_attrs(['data-slot', 'lane']), 'children': c_10}, with_context = false) }}
{%- endfor %}
{%- endset -%}
{{ include('compose/Grid.html.twig', {'cols': og_s((og_t(og_eq(v_cols, '2')) ? '1-2' : '1-3')), 'class': 'items-start gap-4', 'attrs': og_attrs(['data-slot', 'lanes']), 'children': c_11}, with_context = false) }}
{%- endif %}
{%- endset -%}
{{ include('blocks/section-frame.html.twig', {'p': {'id': v_id, 'title': v_title, 'tone': v_tone, 'density': v_density, 'landmarkLabel': v_landmarkLabel}, 'children': og_markup(c_12)}, with_context = false) }}
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-cdnnpx ui8kit add kanban-board{* 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/kanban-board.json
Work items in lanes. Each lane has a title, a count and its cards; a card has a title, an optional tag and the person it belongs to. Axes: card (simple, detail: tag and person), cols (2, 3), tone, density. Moving a card between lanes is a port contract.
Props (p): id, title, lanes, empty, cards, countLabel, card, cols, tone, density, landmarkLabel. *}
{var $v_id = ($p['id'] ?? null)}
{var $v_title = ($p['title'] ?? null)}
{var $v_lanes = ($p['lanes'] ?? null)}
{var $v_empty = ($p['empty'] ?? '')}
{var $v_cards = ($p['cards'] ?? null)}
{var $v_countLabel = ($p['countLabel'] ?? null)}
{var $v_card = ($p['card'] ?? 'detail')}
{var $v_cols = ($p['cols'] ?? '3')}
{var $v_tone = ($p['tone'] ?? 'default')}
{var $v_density = ($p['density'] ?? 'default')}
{var $v_landmarkLabel = ($p['landmarkLabel'] ?? null)}
{capture $c_12}
{if og_t(og_eq(og_len($v_lanes), 0))}
{=og_include('blocks/empty-state.latte', ['p' => ['icon' => 'kanban', 'title' => $v_empty]])|noescape}
{else}
{capture $c_11}
{foreach og_l($v_lanes) as $v_lane}
{capture $c_10}
{capture $c_3}
{capture $c_1}
{=og_text(og_get($v_lane, ['title']))}
{/capture}
{=og_include('compose/Title.latte', ['as' => 3, 'size' => 'base', 'weight' => 'bold', 'children' => (string) $c_1])|noescape}
{capture $c_2}
{=og_text(og_tpl($v_countLabel, [og_len(og_where($v_cards, 'lane', og_get($v_lane, ['key'])))]))}
{/capture}
{=og_include('compose/Text.latte', ['size' => 'xs', 'class' => 'text-muted-foreground', 'children' => (string) $c_2])|noescape}
{/capture}
{=og_include('compose/Group.latte', ['gap' => '2', 'align' => 'center', 'justify' => 'between', 'children' => (string) $c_3])|noescape}
{capture $c_9}
{foreach og_l(og_where($v_cards, 'lane', og_get($v_lane, ['key']))) as $v_c}
{capture $c_8}
{capture $c_4}
{=og_text(og_get($v_c, ['title']))}
{/capture}
{=og_include('compose/Text.latte', ['size' => 'sm', 'weight' => 'semibold', 'children' => (string) $c_4])|noescape}
{if og_t(og_eq($v_card, 'detail'))}
{capture $c_7}
{capture $c_5}
{=og_text(og_get($v_c, ['tag']))}
{/capture}
{=og_include('blocks/pill.latte', ['p' => ['tone' => 'blue', 'icon' => 'tag'], 'children' => og_markup($c_5)])|noescape}
{capture $c_6}
{=og_text(og_get($v_c, ['who']))}
{/capture}
{=og_include('compose/Text.latte', ['size' => 'xs', 'class' => 'text-muted-foreground', 'children' => (string) $c_6])|noescape}
{/capture}
{=og_include('compose/Group.latte', ['gap' => '2', 'align' => 'center', 'justify' => 'between', 'class' => 'flex-wrap', 'children' => (string) $c_7])|noescape}
{/if}
{/capture}
{=og_include('compose/ListItem.latte', ['class' => og_s(og_cnv(['flex flex-col rounded bg-card inset-ring inset-ring-border', (og_t(og_eq($v_density, 'compact')) ? 'gap-2 p-2' : 'gap-2 p-4')])), 'attrs' => og_attrs(['data-slot', 'item']), 'children' => (string) $c_8])|noescape}
{/foreach}
{/capture}
{=og_include('compose/List.latte', ['class' => 'm-0 flex list-none flex-col gap-2 p-0', 'children' => (string) $c_9])|noescape}
{/capture}
{=og_include('compose/Stack.latte', ['gap' => '4', 'align' => 'stretch', 'class' => 'rounded bg-muted p-4', 'attrs' => og_attrs(['data-slot', 'lane']), 'children' => (string) $c_10])|noescape}
{/foreach}
{/capture}
{=og_include('compose/Grid.latte', ['cols' => og_s((og_t(og_eq($v_cols, '2')) ? '1-2' : '1-3')), 'class' => 'items-start gap-4', 'attrs' => og_attrs(['data-slot', 'lanes']), 'children' => (string) $c_11])|noescape}
{/if}
{/capture}
{=og_include('blocks/section-frame.latte', ['p' => ['id' => $v_id, 'title' => $v_title, 'tone' => $v_tone, 'density' => $v_density, 'landmarkLabel' => $v_landmarkLabel], 'children' => og_markup($c_12)])|noescape}
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-cdnnpx ui8kit add kanban-board{#- 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/kanban-board.json
Work items in lanes. Each lane has a title, a count and its cards; a card has a title, an optional tag and the person it belongs to. Axes: card (simple, detail: tag and person), cols (2, 3), tone, density. Moving a card between lanes is a port contract.
Props (p): id, title, lanes, empty, cards, countLabel, card, cols, tone, density, landmarkLabel. -#}
{%- set v_id = og_def(p['id'], none) -%}
{%- set v_title = og_def(p['title'], none) -%}
{%- set v_lanes = og_def(p['lanes'], none) -%}
{%- set v_empty = og_def(p['empty'], '') -%}
{%- set v_cards = og_def(p['cards'], none) -%}
{%- set v_countLabel = og_def(p['countLabel'], none) -%}
{%- set v_card = og_def(p['card'], 'detail') -%}
{%- set v_cols = og_def(p['cols'], '3') -%}
{%- set v_tone = og_def(p['tone'], 'default') -%}
{%- set v_density = og_def(p['density'], 'default') -%}
{%- set v_landmarkLabel = og_def(p['landmarkLabel'], none) -%}
{%- set c_12 -%}
{%- if og_t(og_eq(og_len(v_lanes), 0)) %}
{{ og_include('blocks/empty-state.html.j2', {'p': {'icon': 'kanban', 'title': v_empty}}) }}
{%- else %}
{%- set c_11 -%}
{%- for v_lane in og_l(v_lanes) %}
{%- set c_10 -%}
{%- set c_3 -%}
{%- set c_1 -%}
{{ og_text(og_get(v_lane, ['title'])) }}
{%- endset -%}
{{ og_include('compose/title.html.j2', {'p': {'As': 3, 'Size': 'base', 'Weight': 'bold'}, 'children': c_1}) }}
{%- set c_2 -%}
{{ og_text(og_tpl(v_countLabel, [og_len(og_where(v_cards, 'lane', og_get(v_lane, ['key'])))])) }}
{%- 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': '2', 'Align': 'center', 'Justify': 'between'}, 'children': c_3}) }}
{%- set c_9 -%}
{%- for v_c in og_l(og_where(v_cards, 'lane', og_get(v_lane, ['key']))) %}
{%- set c_8 -%}
{%- set c_4 -%}
{{ og_text(og_get(v_c, ['title'])) }}
{%- endset -%}
{{ og_include('compose/text.html.j2', {'p': {'Size': 'sm', 'Weight': 'semibold'}, 'children': c_4}) }}
{%- if og_t(og_eq(v_card, 'detail')) %}
{%- set c_7 -%}
{%- set c_5 -%}
{{ og_text(og_get(v_c, ['tag'])) }}
{%- endset -%}
{{ og_include('blocks/pill.html.j2', {'p': {'tone': 'blue', 'icon': 'tag'}, 'children': og_markup(c_5)}) }}
{%- set c_6 -%}
{{ og_text(og_get(v_c, ['who'])) }}
{%- endset -%}
{{ og_include('compose/text.html.j2', {'p': {'Size': 'xs', 'Class': 'text-muted-foreground'}, 'children': c_6}) }}
{%- endset -%}
{{ og_include('compose/group.html.j2', {'p': {'Gap': '2', 'Align': 'center', 'Justify': 'between', 'Class': 'flex-wrap'}, 'children': c_7}) }}
{%- endif %}
{%- endset -%}
{{ og_include('compose/list-item.html.j2', {'p': {'Class': og_s(og_cnv(['flex flex-col rounded bg-card inset-ring inset-ring-border', ('gap-2 p-2' if og_t(og_eq(v_density, 'compact')) else 'gap-2 p-4')])), 'Attrs': og_attrs(['data-slot', 'item'])}, 'children': c_8}) }}
{%- endfor %}
{%- endset -%}
{{ og_include('compose/list.html.j2', {'p': {'Class': 'm-0 flex list-none flex-col gap-2 p-0'}, 'children': c_9}) }}
{%- endset -%}
{{ og_include('compose/stack.html.j2', {'p': {'Gap': '4', 'Align': 'stretch', 'Class': 'rounded bg-muted p-4', 'Attrs': og_attrs(['data-slot', 'lane'])}, 'children': c_10}) }}
{%- endfor %}
{%- endset -%}
{{ og_include('compose/grid.html.j2', {'p': {'Cols': og_s(('1-2' if og_t(og_eq(v_cols, '2')) else '1-3')), 'Class': 'items-start gap-4', 'Attrs': og_attrs(['data-slot', 'lanes'])}, 'children': c_11}) }}
{%- endif %}
{%- endset -%}
{{ og_include('blocks/section-frame.html.j2', {'p': {'id': v_id, 'title': v_title, 'tone': v_tone, 'density': v_density, 'landmarkLabel': v_landmarkLabel}, 'children': og_markup(c_12)}) }}
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.
Work items in lanes. Each lane has a title, a count and its cards; a card has a title, an optional tag and the person it belongs to. Axes: card (simple, detail: tag and person), cols (2, 3), tone, density. Moving a card between lanes is a port contract.
| Prop | Type | Default | Description |
|---|---|---|---|
| id (required) | string | - | |
| title (required) | string | - | |
| lanes (required) | Lane[] | - | |
| empty | string | "" | the text of the empty state (no records), from the dictionary |
| cards (required) | BoardCard[] | - | |
| countLabel (required) | string | - | template of the card count of a lane, e.g. `{0} cards` |
| card | "simple" | "detail" | "detail" | |
| cols | "2" | "3" | "3" | |
| tone | "default" | "muted" | "default" | |
| density | "default" | "compact" | "default" | |
| landmarkLabel | string | - | accessible name of the landmark of this component when the page shows it more than once (a variant); replaces the heading name of the root landmark, follows the name of a nested one |