Checklist
Tasks to finish after sign-up, with progress.
Install
npx ui8kit add checklistPulls in: compose, disclosure, empty-state, icon-badge, kit-box, kit-disclosure, kit-progress, kit-text, list, list-item, lucide-icon, progress, section-frame, stack, summary, text, utils
Preview
Get started
Complete your profile
Add a name and a picture.
Invite your team
Teammates get access to every page.
Connect your data
Link a collection or upload a file.
Publish your first page
Pick a block and press publish.
Add a custom domain
Point your own address at the site.
Code
Point the CLI at this runtime once, then add the item:
npx ui8kit init --yes --framework svelte --dir src --registry-url https://registry.buildy.tw/svelte --strict-cdnnpx ui8kit add checklist<!-- Code generated by packages/kit-compose/src/organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT. -->
<!--
An onboarding checklist: the tasks with a done mark, a progress bar or a count. Axes: layout (card, plain),
progress (bar, text, none), marker (check, number), tone (default, muted).
-->
<script lang="ts" module>
import type { Snippet } from "svelte";
import type { Task } from "./checklist.types";
export type ChecklistProps = {
id: string;
title: string;
tasks: Task[];
empty?: string;
progressLabel: string;
layout?: "card" | "plain";
progress?: "bar" | "text" | "none";
marker?: "check" | "number";
detail?: "always" | "expand";
tone?: "default" | "muted";
landmarkLabel?: string;
};
</script>
<script lang="ts">
import Disclosure from "../compose/Disclosure.svelte";
import IconBadge from "../compose/IconBadge.svelte";
import List from "../compose/List.svelte";
import ListItem from "../compose/ListItem.svelte";
import LucideIcon from "../icons/LucideIcon.svelte";
import Progress from "../compose/Progress.svelte";
import Stack from "../compose/Stack.svelte";
import Summary from "../compose/Summary.svelte";
import Text from "../compose/Text.svelte";
import EmptyState from "../components/empty-state.svelte";
import SectionFrame from "../components/section-frame.svelte";
import { tpl } from "../utils";
let {
id,
title,
tasks,
empty = "",
progressLabel,
layout = "card",
progress = "bar",
marker = "check",
detail = "always",
tone = "default",
landmarkLabel,
}: ChecklistProps = $props();
</script>
<SectionFrame id={id} title={title} tone={tone} measure="2xl" landmarkLabel={landmarkLabel}>
{#if ((tasks?.length ?? 0) === 0)}
<EmptyState icon="list-checks" title={empty} />
{:else}
<Stack
gap="4"
align="stretch"
class={(((layout as string) === "card") ? "rounded bg-card p-6 inset-ring inset-ring-border" : "")}
data-slot="checklist"
>
{#if ((progress as string) === "bar")}
<Progress
value={
Math.round(((tasks.filter((i) => i["done"]).length * 100) / (tasks?.length ?? 0))) == null ? undefined
: String(Math.round(((tasks.filter((i) => i["done"]).length * 100) / (tasks?.length ?? 0))))
}
max="100"
aria-label={tpl(progressLabel, tasks.filter((i) => i["done"]).length, (tasks?.length ?? 0))}
/>
{/if}
{#if ((progress as string) === "text")}
<Text size="sm" class="text-muted-foreground" data-slot="progress-text">
{tpl(progressLabel, tasks.filter((i) => i["done"]).length, (tasks?.length ?? 0))}
</Text>
{/if}
<List class="m-0 flex list-none flex-col gap-4 p-0" data-slot="items">
{#each tasks as task, i (task.id)}
<ListItem
class="flex items-start gap-4"
data-done={(task.done == null ? undefined : String(task.done))}
data-slot="item"
>
{#if ((marker as string) === "number")}
<IconBadge variant={(task.done ? "primary" : "outline")} size="xs">
{((i + 1) == null ? undefined : String((i + 1)))}
</IconBadge>
{:else}
<LucideIcon
name={(task.done ? "circle-check" : "circle")}
size={24}
class={(task.done ? "shrink-0 text-primary" : "shrink-0 text-muted-foreground")}
/>
{/if}
{#if ((detail as string) === "expand")}
<Disclosure variant="ghost" class="flex-1" data-slot="task-detail">
<Summary variant="ghost">
{task.title}
</Summary>
<Text size="sm" class="pb-2 text-muted-foreground">
{task.text}
</Text>
</Disclosure>
{:else}
<Stack gap="0">
<Text size="base" weight="semibold">
{task.title}
</Text>
<Text size="sm" class="text-muted-foreground">
{task.text}
</Text>
</Stack>
{/if}
</ListItem>
{/each}
</List>
</Stack>
{/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 Task = {
id: string;
title: string;
text: string;
done: boolean;
};
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 checklist// Code generated by packages/kit-compose/src/organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT.
/**
* An onboarding checklist: the tasks with a done mark, a progress bar or a count. Axes: layout (card, plain),
* progress (bar, text, none), marker (check, number), tone (default, muted).
*/
import { type ReactNode } from "react";
import { Disclosure, IconBadge, List, ListItem, Progress, Stack, Summary, Text } from "../compose";
import { LucideIcon } from "../icons/LucideIcon";
import { EmptyState } from "../components/empty-state";
import { SectionFrame } from "../components/section-frame";
import { tpl } from "../utils";
import type { Task } from "./checklist.types";
export type ChecklistProps = {
id: string;
title: string;
tasks: Task[];
empty?: string;
progressLabel: string;
layout?: "card" | "plain";
progress?: "bar" | "text" | "none";
marker?: "check" | "number";
detail?: "always" | "expand";
tone?: "default" | "muted";
landmarkLabel?: string;
};
export function Checklist({
id,
title,
tasks,
empty = "",
progressLabel,
layout = "card",
progress = "bar",
marker = "check",
detail = "always",
tone = "default",
landmarkLabel,
}: ChecklistProps) {
return (
<SectionFrame id={id} title={title} tone={tone} measure="2xl" landmarkLabel={landmarkLabel}>
{((tasks?.length ?? 0) === 0) ? (
<EmptyState icon="list-checks" title={empty} />
) : (
<Stack
gap="4"
align="stretch"
className={
(layout as string) === "card" ? "rounded bg-card p-6 inset-ring inset-ring-border"
: ""
}
data-slot="checklist"
>
{((progress as string) === "bar") ? (
<Progress
value={
Math.round(((tasks.filter((i) => i["done"]).length * 100) / (tasks?.length ?? 0))) == null ? undefined
: String(Math.round(((tasks.filter((i) => i["done"]).length * 100) / (tasks?.length ?? 0))))
}
max="100"
aria-label={tpl(progressLabel, tasks.filter((i) => i["done"]).length, (tasks?.length ?? 0))}
/>
) : null}
{((progress as string) === "text") ? (
<Text size="sm" className="text-muted-foreground" data-slot="progress-text">
{tpl(progressLabel, tasks.filter((i) => i["done"]).length, (tasks?.length ?? 0))}
</Text>
) : null}
<List className="m-0 flex list-none flex-col gap-4 p-0" data-slot="items">
{(tasks ?? []).map((task, i) => (
<ListItem key={task.id}
className="flex items-start gap-4"
data-done={(task.done == null ? undefined : String(task.done))}
data-slot="item"
>
{((marker as string) === "number") ? (
<IconBadge variant={(task.done ? "primary" : "outline")} size="xs">
{((i + 1) == null ? undefined : String((i + 1)))}
</IconBadge>
) : (
<LucideIcon
name={(task.done ? "circle-check" : "circle")}
size={24}
className={(task.done ? "shrink-0 text-primary" : "shrink-0 text-muted-foreground")}
/>
)}
{((detail as string) === "expand") ? (
<Disclosure variant="ghost" className="flex-1" data-slot="task-detail">
<Summary variant="ghost">
{task.title}
</Summary>
<Text size="sm" className="pb-2 text-muted-foreground">
{task.text}
</Text>
</Disclosure>
) : (
<Stack gap="0">
<Text size="base" weight="semibold">
{task.title}
</Text>
<Text size="sm" className="text-muted-foreground">
{task.text}
</Text>
</Stack>
)}
</ListItem>
))}
</List>
</Stack>
)}
</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 Task = {
id: string;
title: string;
text: string;
done: boolean;
};
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 checklist// 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 Task = {
id: string;
title: string;
text: string;
done: boolean;
};
<!-- Code generated by packages/kit-compose/src/organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT. -->
<!--
An onboarding checklist: the tasks with a done mark, a progress bar or a count. Axes: layout (card, plain),
progress (bar, text, none), marker (check, number), tone (default, muted).
-->
<script lang="ts">
import type { Task } from "./checklist.types";
export type ChecklistProps = {
id: string;
title: string;
tasks: Task[];
empty?: string;
progressLabel: string;
layout?: "card" | "plain";
progress?: "bar" | "text" | "none";
marker?: "check" | "number";
detail?: "always" | "expand";
tone?: "default" | "muted";
landmarkLabel?: string;
};
</script>
<script setup lang="ts">
import Disclosure from "../compose/Disclosure.vue";
import IconBadge from "../compose/IconBadge.vue";
import List from "../compose/List.vue";
import ListItem from "../compose/ListItem.vue";
import LucideIcon from "../icons/LucideIcon.vue";
import Progress from "../compose/Progress.vue";
import Stack from "../compose/Stack.vue";
import Summary from "../compose/Summary.vue";
import Text from "../compose/Text.vue";
import EmptyState from "../components/empty-state.vue";
import SectionFrame from "../components/section-frame.vue";
import { tpl } from "../utils";
const {
id,
title,
tasks,
empty = "",
progressLabel,
layout = "card",
progress = "bar",
marker = "check",
detail = "always",
tone = "default",
landmarkLabel,
} = defineProps<ChecklistProps>();
</script>
<template>
<SectionFrame :id="id" :title="title" :tone="tone" measure="2xl" :landmarkLabel="landmarkLabel">
<EmptyState v-if="((tasks?.length ?? 0) === 0)" icon="list-checks" :title="empty" />
<Stack v-else
gap="4"
align="stretch"
:class="(((layout as string) === 'card') ? 'rounded bg-card p-6 inset-ring inset-ring-border' : '')"
data-slot="checklist"
>
<Progress v-if="((progress as string) === 'bar')"
:value="
Math.round(((tasks.filter((i) => i['done']).length * 100) / (tasks?.length ?? 0))) == null ? undefined
: String(Math.round(((tasks.filter((i) => i['done']).length * 100) / (tasks?.length ?? 0))))
"
max="100"
:aria-label="tpl(progressLabel, tasks.filter((i) => i['done']).length, (tasks?.length ?? 0))"
/>
<Text
v-if="((progress as string) === 'text')"
size="sm"
class="text-muted-foreground"
data-slot="progress-text"
>
{{ tpl(progressLabel, tasks.filter((i) => i["done"]).length, (tasks?.length ?? 0)) }}
</Text>
<List class="m-0 flex list-none flex-col gap-4 p-0" data-slot="items">
<ListItem v-for="(task, i) in tasks" :key="task.id"
class="flex items-start gap-4"
:data-done="(task.done == null ? undefined : String(task.done))"
data-slot="item"
>
<IconBadge v-if="((marker as string) === 'number')" :variant="(task.done ? 'primary' : 'outline')" size="xs">
{{ ((i + 1) == null ? undefined : String((i + 1))) }}
</IconBadge>
<LucideIcon v-else
:name="(task.done ? 'circle-check' : 'circle')"
:size="24"
:class="(task.done ? 'shrink-0 text-primary' : 'shrink-0 text-muted-foreground')"
/>
<Disclosure v-if="((detail as string) === 'expand')" variant="ghost" class="flex-1" data-slot="task-detail">
<Summary variant="ghost">
{{ task.title }}
</Summary>
<Text size="sm" class="pb-2 text-muted-foreground">
{{ task.text }}
</Text>
</Disclosure>
<Stack v-else gap="0">
<Text size="base" weight="semibold">
{{ task.title }}
</Text>
<Text size="sm" class="text-muted-foreground">
{{ task.text }}
</Text>
</Stack>
</ListItem>
</List>
</Stack>
</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 checklist// Code generated by packages/kit-compose/src/organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT.
/**
* An onboarding checklist: the tasks with a done mark, a progress bar or a count. Axes: layout (card, plain),
* progress (bar, text, none), marker (check, number), tone (default, muted).
*/
import { For, type JSX } from "solid-js";
import { Disclosure, IconBadge, List, ListItem, Progress, Stack, Summary, Text } from "../compose";
import { LucideIcon } from "../icons/LucideIcon";
import { EmptyState } from "../components/empty-state";
import { SectionFrame } from "../components/section-frame";
import { tpl } from "../utils";
import type { Task } from "./checklist.types";
export type ChecklistProps = {
id: string;
title: string;
tasks: Task[];
empty?: string;
progressLabel: string;
layout?: "card" | "plain";
progress?: "bar" | "text" | "none";
marker?: "check" | "number";
detail?: "always" | "expand";
tone?: "default" | "muted";
landmarkLabel?: string;
};
export function Checklist({
id,
title,
tasks,
empty = "",
progressLabel,
layout = "card",
progress = "bar",
marker = "check",
detail = "always",
tone = "default",
landmarkLabel,
}: ChecklistProps) {
return (
<SectionFrame id={id} title={title} tone={tone} measure="2xl" landmarkLabel={landmarkLabel}>
{((tasks?.length ?? 0) === 0) ? (
<EmptyState icon="list-checks" title={empty} />
) : (
<Stack
gap="4"
align="stretch"
class={(((layout as string) === "card") ? "rounded bg-card p-6 inset-ring inset-ring-border" : "")}
data-slot="checklist"
>
{((progress as string) === "bar") ? (
<Progress
value={
Math.round(((tasks.filter((i) => i["done"]).length * 100) / (tasks?.length ?? 0))) == null ? undefined
: String(Math.round(((tasks.filter((i) => i["done"]).length * 100) / (tasks?.length ?? 0))))
}
max="100"
aria-label={tpl(progressLabel, tasks.filter((i) => i["done"]).length, (tasks?.length ?? 0))}
/>
) : null}
{((progress as string) === "text") ? (
<Text size="sm" class="text-muted-foreground" data-slot="progress-text">
{tpl(progressLabel, tasks.filter((i) => i["done"]).length, (tasks?.length ?? 0))}
</Text>
) : null}
<List class="m-0 flex list-none flex-col gap-4 p-0" data-slot="items">
<For each={tasks ?? []}>{(task, iOf) => { const i = iOf(); return (
<ListItem
class="flex items-start gap-4"
data-done={(task.done == null ? undefined : String(task.done))}
data-slot="item"
>
{((marker as string) === "number") ? (
<IconBadge variant={(task.done ? "primary" : "outline")} size="xs">
{((i + 1) == null ? undefined : String((i + 1)))}
</IconBadge>
) : (
<LucideIcon
name={(task.done ? "circle-check" : "circle")}
size={24}
class={(task.done ? "shrink-0 text-primary" : "shrink-0 text-muted-foreground")}
/>
)}
{((detail as string) === "expand") ? (
<Disclosure variant="ghost" class="flex-1" data-slot="task-detail">
<Summary variant="ghost">
{task.title}
</Summary>
<Text size="sm" class="pb-2 text-muted-foreground">
{task.text}
</Text>
</Disclosure>
) : (
<Stack gap="0">
<Text size="base" weight="semibold">
{task.title}
</Text>
<Text size="sm" class="text-muted-foreground">
{task.text}
</Text>
</Stack>
)}
</ListItem>
); }}</For>
</List>
</Stack>
)}
</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 Task = {
id: string;
title: string;
text: string;
done: boolean;
};
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 checklist// 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/checklist.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/disclosure"
"github.com/ui8kit/codegen/generated/templ/icons"
"github.com/ui8kit/codegen/generated/templ/ui/progress"
"github.com/ui8kit/codegen/generated/templ/ui/text"
uiutils "github.com/ui8kit/codegen/generated/templ/orgutils"
)
// ChecklistProps are the props of Checklist; the values are the JSON shapes of the TypeScript props.
type ChecklistProps struct {
Id any `json:"id"`
Title any `json:"title"`
Tasks any `json:"tasks"`
Empty any `json:"empty"`
ProgressLabel any `json:"progressLabel"`
Layout any `json:"layout"`
Progress any `json:"progress"`
Marker any `json:"marker"`
Detail any `json:"detail"`
Tone any `json:"tone"`
LandmarkLabel any `json:"landmarkLabel"`
}
// An onboarding checklist: the tasks with a done mark, a progress bar or a count. Axes: layout (card, plain), progress (bar, text, none), marker (check, number), tone (default, muted).
templ Checklist(p ChecklistProps) {
{{ vId := p.Id }}
{{ vTitle := p.Title }}
{{ vTasks := p.Tasks }}
{{ vEmpty := uiutils.Def(p.Empty, "") }}
{{ vProgressLabel := p.ProgressLabel }}
{{ vLayout := uiutils.Def(p.Layout, "card") }}
{{ vProgress := uiutils.Def(p.Progress, "bar") }}
{{ vMarker := uiutils.Def(p.Marker, "check") }}
{{ vDetail := uiutils.Def(p.Detail, "always") }}
{{ vTone := uiutils.Def(p.Tone, "default") }}
{{ vLandmarkLabel := p.LandmarkLabel }}
@SectionFrame(SectionFrameProps{Id: vId, Title: vTitle, Tone: vTone, Measure: "2xl", LandmarkLabel: vLandmarkLabel}) {
if uiutils.Eq(uiutils.Len(vTasks), float64(0)) {
@EmptyState(EmptyStateProps{Icon: "list-checks", Title: vEmpty})
} else {
@compose.Stack(compose.StackProps{Gap: "4", Align: "stretch", BoxProps: box.BoxProps{Class: uiutils.S(uiutils.Cond(uiutils.T(uiutils.Eq(vLayout, "card")), "rounded bg-card p-6 inset-ring inset-ring-border", "")), Attrs: uiutils.Attrs("data-slot", "checklist")}}) {
if uiutils.Eq(vProgress, "bar") {
@compose.Progress(compose.ProgressProps{ProgressProps: progress.ProgressProps{Value: uiutils.SP(uiutils.Str(uiutils.Round(uiutils.Div(uiutils.Mul(uiutils.Count(vTasks, "done"), float64(100)), uiutils.Len(vTasks))))), Max: "100", Attrs: uiutils.Attrs("aria-label", uiutils.Tpl(vProgressLabel, uiutils.Count(vTasks, "done"), uiutils.Len(vTasks)))}})
}
if uiutils.Eq(vProgress, "text") {
@compose.Text(compose.TextProps{Size: "sm", TextProps: text.TextProps{Class: "text-muted-foreground", Attrs: uiutils.Attrs("data-slot", "progress-text")}}) {
{ uiutils.Text(uiutils.Tpl(vProgressLabel, uiutils.Count(vTasks, "done"), uiutils.Len(vTasks))) }
}
}
@compose.List(compose.ListProps{BoxProps: box.BoxProps{Class: "m-0 flex list-none flex-col gap-4 p-0", Attrs: uiutils.Attrs("data-slot", "items")}}) {
for vI, vTask := range uiutils.L(vTasks) {
@compose.ListItem(compose.ListItemProps{BoxProps: box.BoxProps{Class: "flex items-start gap-4", Attrs: uiutils.Attrs("data-done", uiutils.Str(uiutils.Get(vTask, "done")), "data-slot", "item")}}) {
if uiutils.Eq(vMarker, "number") {
@compose.IconBadge(compose.IconBadgeProps{Variant: uiutils.S(uiutils.Cond(uiutils.T(uiutils.Get(vTask, "done")), "primary", "outline")), Size: "xs", TextProps: text.TextProps{}}) {
{ uiutils.Text(uiutils.Str(uiutils.Add(float64(vI), float64(1)))) }
}
} else {
@icons.LucideIcon(icons.LucideIconProps{Name: uiutils.S(uiutils.Cond(uiutils.T(uiutils.Get(vTask, "done")), "circle-check", "circle")), Size: 24, Class: uiutils.S(uiutils.Cond(uiutils.T(uiutils.Get(vTask, "done")), "shrink-0 text-primary", "shrink-0 text-muted-foreground"))})
}
if uiutils.Eq(vDetail, "expand") {
@compose.Disclosure(compose.DisclosureProps{Variant: "ghost", DisclosureProps: disclosure.DisclosureProps{Class: "flex-1", Attrs: uiutils.Attrs("data-slot", "task-detail")}}) {
@compose.Summary(compose.SummaryProps{Variant: "ghost", SummaryProps: disclosure.SummaryProps{}}) {
{ uiutils.Text(uiutils.Get(vTask, "title")) }
}
@compose.Text(compose.TextProps{Size: "sm", TextProps: text.TextProps{Class: "pb-2 text-muted-foreground"}}) {
{ uiutils.Text(uiutils.Get(vTask, "text")) }
}
}
} else {
@compose.Stack(compose.StackProps{Gap: "0", BoxProps: box.BoxProps{}}) {
@compose.Text(compose.TextProps{Size: "base", Weight: "semibold", TextProps: text.TextProps{}}) {
{ uiutils.Text(uiutils.Get(vTask, "title")) }
}
@compose.Text(compose.TextProps{Size: "sm", TextProps: text.TextProps{Class: "text-muted-foreground"}}) {
{ uiutils.Text(uiutils.Get(vTask, "text")) }
}
}
}
}
}
}
}
}
}
}
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 checklist{#- 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/checklist.json
An onboarding checklist: the tasks with a done mark, a progress bar or a count. Axes: layout (card, plain), progress (bar, text, none), marker (check, number), tone (default, muted).
Props (p): id, title, tasks, empty, progressLabel, layout, progress, marker, detail, tone, landmarkLabel. -#}
{%- set v_id = (p.id ?? null) -%}
{%- set v_title = (p.title ?? null) -%}
{%- set v_tasks = (p.tasks ?? null) -%}
{%- set v_empty = (p.empty ?? '') -%}
{%- set v_progressLabel = (p.progressLabel ?? null) -%}
{%- set v_layout = (p.layout ?? 'card') -%}
{%- set v_progress = (p.progress ?? 'bar') -%}
{%- set v_marker = (p.marker ?? 'check') -%}
{%- set v_detail = (p.detail ?? 'always') -%}
{%- set v_tone = (p.tone ?? 'default') -%}
{%- set v_landmarkLabel = (p.landmarkLabel ?? null) -%}
{%- set c_12 -%}
{%- if og_t(og_eq(og_len(v_tasks), 0)) %}
{{ include('blocks/empty-state.html.twig', {'p': {'icon': 'list-checks', 'title': v_empty}}, with_context = false) }}
{%- else %}
{%- set c_11 -%}
{%- if og_t(og_eq(v_progress, 'bar')) %}
{{ include('compose/Progress.html.twig', {'value': og_s(og_str(og_round(og_div(og_mul(og_count(v_tasks, 'done'), 100), og_len(v_tasks))))), 'max': '100', 'attrs': og_attrs(['aria-label', og_tpl(v_progressLabel, [og_count(v_tasks, 'done'), og_len(v_tasks)])])}, with_context = false) }}
{%- endif %}
{%- if og_t(og_eq(v_progress, 'text')) %}
{%- set c_1 -%}
{{ og_text(og_tpl(v_progressLabel, [og_count(v_tasks, 'done'), og_len(v_tasks)])) }}
{%- endset -%}
{{ include('compose/Text.html.twig', {'size': 'sm', 'class': 'text-muted-foreground', 'attrs': og_attrs(['data-slot', 'progress-text']), 'children': c_1}, with_context = false) }}
{%- endif %}
{%- set c_10 -%}
{%- for v_task in og_l(v_tasks) %}
{%- set v_i = loop.index0 -%}
{%- set c_9 -%}
{%- if og_t(og_eq(v_marker, 'number')) %}
{%- set c_2 -%}
{{ og_text(og_str(og_add(v_i, 1))) }}
{%- endset -%}
{{ include('compose/IconBadge.html.twig', {'variant': og_s((og_t(og_get(v_task, ['done'])) ? 'primary' : 'outline')), 'size': 'xs', 'children': c_2}, with_context = false) }}
{%- else %}
{{ include('icons/LucideIcon.html.twig', {'name': og_s((og_t(og_get(v_task, ['done'])) ? 'circle-check' : 'circle')), 'size': 24, 'class': og_s((og_t(og_get(v_task, ['done'])) ? 'shrink-0 text-primary' : 'shrink-0 text-muted-foreground'))}, with_context = false) }}
{%- endif %}
{%- if og_t(og_eq(v_detail, 'expand')) %}
{%- set c_5 -%}
{%- set c_3 -%}
{{ og_text(og_get(v_task, ['title'])) }}
{%- endset -%}
{{ include('compose/Summary.html.twig', {'variant': 'ghost', 'children': c_3}, with_context = false) }}
{%- set c_4 -%}
{{ og_text(og_get(v_task, ['text'])) }}
{%- endset -%}
{{ include('compose/Text.html.twig', {'size': 'sm', 'class': 'pb-2 text-muted-foreground', 'children': c_4}, with_context = false) }}
{%- endset -%}
{{ include('compose/Disclosure.html.twig', {'variant': 'ghost', 'class': 'flex-1', 'attrs': og_attrs(['data-slot', 'task-detail']), 'children': c_5}, with_context = false) }}
{%- else %}
{%- set c_8 -%}
{%- set c_6 -%}
{{ og_text(og_get(v_task, ['title'])) }}
{%- endset -%}
{{ include('compose/Text.html.twig', {'size': 'base', 'weight': 'semibold', 'children': c_6}, with_context = false) }}
{%- set c_7 -%}
{{ og_text(og_get(v_task, ['text'])) }}
{%- endset -%}
{{ include('compose/Text.html.twig', {'size': 'sm', 'class': 'text-muted-foreground', 'children': c_7}, with_context = false) }}
{%- endset -%}
{{ include('compose/Stack.html.twig', {'gap': '0', 'children': c_8}, with_context = false) }}
{%- endif %}
{%- endset -%}
{{ include('compose/ListItem.html.twig', {'class': 'flex items-start gap-4', 'attrs': og_attrs(['data-done', og_str(og_get(v_task, ['done'])), 'data-slot', 'item']), 'children': c_9}, with_context = false) }}
{%- endfor %}
{%- endset -%}
{{ include('compose/List.html.twig', {'class': 'm-0 flex list-none flex-col gap-4 p-0', 'attrs': og_attrs(['data-slot', 'items']), 'children': c_10}, with_context = false) }}
{%- endset -%}
{{ include('compose/Stack.html.twig', {'gap': '4', 'align': 'stretch', 'class': og_s((og_t(og_eq(v_layout, 'card')) ? 'rounded bg-card p-6 inset-ring inset-ring-border' : '')), 'attrs': og_attrs(['data-slot', 'checklist']), 'children': c_11}, with_context = false) }}
{%- endif %}
{%- endset -%}
{{ include('blocks/section-frame.html.twig', {'p': {'id': v_id, 'title': v_title, 'tone': v_tone, 'measure': '2xl', '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 checklist{* 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/checklist.json
An onboarding checklist: the tasks with a done mark, a progress bar or a count. Axes: layout (card, plain), progress (bar, text, none), marker (check, number), tone (default, muted).
Props (p): id, title, tasks, empty, progressLabel, layout, progress, marker, detail, tone, landmarkLabel. *}
{var $v_id = ($p['id'] ?? null)}
{var $v_title = ($p['title'] ?? null)}
{var $v_tasks = ($p['tasks'] ?? null)}
{var $v_empty = ($p['empty'] ?? '')}
{var $v_progressLabel = ($p['progressLabel'] ?? null)}
{var $v_layout = ($p['layout'] ?? 'card')}
{var $v_progress = ($p['progress'] ?? 'bar')}
{var $v_marker = ($p['marker'] ?? 'check')}
{var $v_detail = ($p['detail'] ?? 'always')}
{var $v_tone = ($p['tone'] ?? 'default')}
{var $v_landmarkLabel = ($p['landmarkLabel'] ?? null)}
{capture $c_12}
{if og_t(og_eq(og_len($v_tasks), 0))}
{=og_include('blocks/empty-state.latte', ['p' => ['icon' => 'list-checks', 'title' => $v_empty]])|noescape}
{else}
{capture $c_11}
{if og_t(og_eq($v_progress, 'bar'))}
{=og_include('compose/Progress.latte', ['value' => og_s(og_str(og_round(og_div(og_mul(og_count($v_tasks, 'done'), 100), og_len($v_tasks))))), 'max' => '100', 'attrs' => og_attrs(['aria-label', og_tpl($v_progressLabel, [og_count($v_tasks, 'done'), og_len($v_tasks)])])])|noescape}
{/if}
{if og_t(og_eq($v_progress, 'text'))}
{capture $c_1}
{=og_text(og_tpl($v_progressLabel, [og_count($v_tasks, 'done'), og_len($v_tasks)]))}
{/capture}
{=og_include('compose/Text.latte', ['size' => 'sm', 'class' => 'text-muted-foreground', 'attrs' => og_attrs(['data-slot', 'progress-text']), 'children' => (string) $c_1])|noescape}
{/if}
{capture $c_10}
{foreach og_l($v_tasks) as $v_task}
{var $v_i = $iterator->counter0}
{capture $c_9}
{if og_t(og_eq($v_marker, 'number'))}
{capture $c_2}
{=og_text(og_str(og_add($v_i, 1)))}
{/capture}
{=og_include('compose/IconBadge.latte', ['variant' => og_s((og_t(og_get($v_task, ['done'])) ? 'primary' : 'outline')), 'size' => 'xs', 'children' => (string) $c_2])|noescape}
{else}
{=og_include('icons/LucideIcon.latte', ['name' => og_s((og_t(og_get($v_task, ['done'])) ? 'circle-check' : 'circle')), 'size' => 24, 'class' => og_s((og_t(og_get($v_task, ['done'])) ? 'shrink-0 text-primary' : 'shrink-0 text-muted-foreground'))])|noescape}
{/if}
{if og_t(og_eq($v_detail, 'expand'))}
{capture $c_5}
{capture $c_3}
{=og_text(og_get($v_task, ['title']))}
{/capture}
{=og_include('compose/Summary.latte', ['variant' => 'ghost', 'children' => (string) $c_3])|noescape}
{capture $c_4}
{=og_text(og_get($v_task, ['text']))}
{/capture}
{=og_include('compose/Text.latte', ['size' => 'sm', 'class' => 'pb-2 text-muted-foreground', 'children' => (string) $c_4])|noescape}
{/capture}
{=og_include('compose/Disclosure.latte', ['variant' => 'ghost', 'class' => 'flex-1', 'attrs' => og_attrs(['data-slot', 'task-detail']), 'children' => (string) $c_5])|noescape}
{else}
{capture $c_8}
{capture $c_6}
{=og_text(og_get($v_task, ['title']))}
{/capture}
{=og_include('compose/Text.latte', ['size' => 'base', 'weight' => 'semibold', 'children' => (string) $c_6])|noescape}
{capture $c_7}
{=og_text(og_get($v_task, ['text']))}
{/capture}
{=og_include('compose/Text.latte', ['size' => 'sm', 'class' => 'text-muted-foreground', 'children' => (string) $c_7])|noescape}
{/capture}
{=og_include('compose/Stack.latte', ['gap' => '0', 'children' => (string) $c_8])|noescape}
{/if}
{/capture}
{=og_include('compose/ListItem.latte', ['class' => 'flex items-start gap-4', 'attrs' => og_attrs(['data-done', og_str(og_get($v_task, ['done'])), 'data-slot', 'item']), 'children' => (string) $c_9])|noescape}
{/foreach}
{/capture}
{=og_include('compose/List.latte', ['class' => 'm-0 flex list-none flex-col gap-4 p-0', 'attrs' => og_attrs(['data-slot', 'items']), 'children' => (string) $c_10])|noescape}
{/capture}
{=og_include('compose/Stack.latte', ['gap' => '4', 'align' => 'stretch', 'class' => og_s((og_t(og_eq($v_layout, 'card')) ? 'rounded bg-card p-6 inset-ring inset-ring-border' : '')), 'attrs' => og_attrs(['data-slot', 'checklist']), 'children' => (string) $c_11])|noescape}
{/if}
{/capture}
{=og_include('blocks/section-frame.latte', ['p' => ['id' => $v_id, 'title' => $v_title, 'tone' => $v_tone, 'measure' => '2xl', '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 checklist{#- 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/checklist.json
An onboarding checklist: the tasks with a done mark, a progress bar or a count. Axes: layout (card, plain), progress (bar, text, none), marker (check, number), tone (default, muted).
Props (p): id, title, tasks, empty, progressLabel, layout, progress, marker, detail, tone, landmarkLabel. -#}
{%- set v_id = og_def(p['id'], none) -%}
{%- set v_title = og_def(p['title'], none) -%}
{%- set v_tasks = og_def(p['tasks'], none) -%}
{%- set v_empty = og_def(p['empty'], '') -%}
{%- set v_progressLabel = og_def(p['progressLabel'], none) -%}
{%- set v_layout = og_def(p['layout'], 'card') -%}
{%- set v_progress = og_def(p['progress'], 'bar') -%}
{%- set v_marker = og_def(p['marker'], 'check') -%}
{%- set v_detail = og_def(p['detail'], 'always') -%}
{%- set v_tone = og_def(p['tone'], 'default') -%}
{%- set v_landmarkLabel = og_def(p['landmarkLabel'], none) -%}
{%- set c_12 -%}
{%- if og_t(og_eq(og_len(v_tasks), 0)) %}
{{ og_include('blocks/empty-state.html.j2', {'p': {'icon': 'list-checks', 'title': v_empty}}) }}
{%- else %}
{%- set c_11 -%}
{%- if og_t(og_eq(v_progress, 'bar')) %}
{{ og_include('compose/progress.html.j2', {'p': {'Value': og_s(og_str(og_round(og_div(og_mul(og_count(v_tasks, 'done'), 100), og_len(v_tasks))))), 'Max': '100', 'Attrs': og_attrs(['aria-label', og_tpl(v_progressLabel, [og_count(v_tasks, 'done'), og_len(v_tasks)])])}}) }}
{%- endif %}
{%- if og_t(og_eq(v_progress, 'text')) %}
{%- set c_1 -%}
{{ og_text(og_tpl(v_progressLabel, [og_count(v_tasks, 'done'), og_len(v_tasks)])) }}
{%- endset -%}
{{ og_include('compose/text.html.j2', {'p': {'Size': 'sm', 'Class': 'text-muted-foreground', 'Attrs': og_attrs(['data-slot', 'progress-text'])}, 'children': c_1}) }}
{%- endif %}
{%- set c_10 -%}
{%- for v_task in og_l(v_tasks) %}
{%- set v_i = loop.index0 -%}
{%- set c_9 -%}
{%- if og_t(og_eq(v_marker, 'number')) %}
{%- set c_2 -%}
{{ og_text(og_str(og_add(v_i, 1))) }}
{%- endset -%}
{{ og_include('compose/icon-badge.html.j2', {'p': {'Variant': og_s(('primary' if og_t(og_get(v_task, ['done'])) else 'outline')), 'Size': 'xs'}, 'children': c_2}) }}
{%- else %}
{{ og_include('icons/lucide-icon.html.j2', {'p': {'Name': og_s(('circle-check' if og_t(og_get(v_task, ['done'])) else 'circle')), 'Size': 24, 'Class': og_s(('shrink-0 text-primary' if og_t(og_get(v_task, ['done'])) else 'shrink-0 text-muted-foreground'))}}) }}
{%- endif %}
{%- if og_t(og_eq(v_detail, 'expand')) %}
{%- set c_5 -%}
{%- set c_3 -%}
{{ og_text(og_get(v_task, ['title'])) }}
{%- endset -%}
{{ og_include('compose/summary.html.j2', {'p': {'Variant': 'ghost'}, 'children': c_3}) }}
{%- set c_4 -%}
{{ og_text(og_get(v_task, ['text'])) }}
{%- endset -%}
{{ og_include('compose/text.html.j2', {'p': {'Size': 'sm', 'Class': 'pb-2 text-muted-foreground'}, 'children': c_4}) }}
{%- endset -%}
{{ og_include('compose/disclosure.html.j2', {'p': {'Variant': 'ghost', 'Class': 'flex-1', 'Attrs': og_attrs(['data-slot', 'task-detail'])}, 'children': c_5}) }}
{%- else %}
{%- set c_8 -%}
{%- set c_6 -%}
{{ og_text(og_get(v_task, ['title'])) }}
{%- endset -%}
{{ og_include('compose/text.html.j2', {'p': {'Size': 'base', 'Weight': 'semibold'}, 'children': c_6}) }}
{%- set c_7 -%}
{{ og_text(og_get(v_task, ['text'])) }}
{%- endset -%}
{{ og_include('compose/text.html.j2', {'p': {'Size': 'sm', 'Class': 'text-muted-foreground'}, 'children': c_7}) }}
{%- endset -%}
{{ og_include('compose/stack.html.j2', {'p': {'Gap': '0'}, 'children': c_8}) }}
{%- endif %}
{%- endset -%}
{{ og_include('compose/list-item.html.j2', {'p': {'Class': 'flex items-start gap-4', 'Attrs': og_attrs(['data-done', og_str(og_get(v_task, ['done'])), 'data-slot', 'item'])}, 'children': c_9}) }}
{%- endfor %}
{%- endset -%}
{{ og_include('compose/list.html.j2', {'p': {'Class': 'm-0 flex list-none flex-col gap-4 p-0', 'Attrs': og_attrs(['data-slot', 'items'])}, 'children': c_10}) }}
{%- endset -%}
{{ og_include('compose/stack.html.j2', {'p': {'Gap': '4', 'Align': 'stretch', 'Class': og_s(('rounded bg-card p-6 inset-ring inset-ring-border' if og_t(og_eq(v_layout, 'card')) else '')), 'Attrs': og_attrs(['data-slot', 'checklist'])}, 'children': c_11}) }}
{%- endif %}
{%- endset -%}
{{ og_include('blocks/section-frame.html.j2', {'p': {'id': v_id, 'title': v_title, 'tone': v_tone, 'measure': '2xl', '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.
An onboarding checklist: the tasks with a done mark, a progress bar or a count. Axes: layout (card, plain), progress (bar, text, none), marker (check, number), tone (default, muted).
| Prop | Type | Default | Description |
|---|---|---|---|
| id (required) | string | - | |
| title (required) | string | - | |
| tasks (required) | Task[] | - | |
| empty | string | "" | the text of the empty state (no records), from the dictionary |
| progressLabel (required) | string | - | template of the count, e.g. `{0} of {1} done` |
| layout | "card" | "plain" | "card" | |
| progress | "bar" | "text" | "none" | "bar" | |
| marker | "check" | "number" | "check" | |
| detail | "always" | "expand" | "always" | expand: the sentence of a task opens under its title |
| tone | "default" | "muted" | "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 |