Skip to content
ui8kit

block / marketing

Page Trail

Breadcrumbs over the badge, the heading and the lead; with one large figure, a note card or four key facts at the end.

Install

npx ui8kit add page-trail

Pulls in: block, box, compose, container, kit-box, nav-bar, page-aside, page-crumbs, section-header, stack, stats-band, utils

Preview

Shop

The catalog

Everything in stock, filtered and sorted in one place. Search works as you type.

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 page-trail
blocks/page-trail.svelte
<!-- Code generated by packages/kit-compose/src/organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT. -->
<!--
  The head of an inner page with breadcrumbs. Axes: aside (none, figure: one large figure such as a count or a
  total, note: a small card with a glyph such as a delivery promise or a document version, facts: four key facts
  in two columns), tone.
-->
<script lang="ts" module>
  import type { Snippet } from "svelte";
  import type { PageExtras } from "./page-trail.types";
  import type { NavLink } from "./nav-bar.types";
  import type { Stat } from "./stats-band.types";

  export type PageTrailProps = {
    id: string;
    title: string;
    lead?: string;
    badge?: string;
    label: string;
    crumbs: NavLink[];
    extras: PageExtras;
    aside?: "none" | "figure" | "note" | "facts";
    level?: 1 | 2;
    tone?: "default" | "muted";
    landmarkLabel?: string;
  };
</script>

<script lang="ts">
  import Block from "../compose/Block.svelte";
  import Box from "../compose/Box.svelte";
  import Container from "../compose/Container.svelte";
  import Stack from "../compose/Stack.svelte";
  import PageAside from "../components/page-aside.svelte";
  import PageCrumbs from "../components/page-crumbs.svelte";
  import SectionHeader from "../components/section-header.svelte";
  import { cn } from "../utils";

  let {
    id,
    title,
    lead = "",
    badge = "",
    label,
    crumbs,
    extras,
    aside = "none",
    level = 1,
    tone = "default",
    landmarkLabel,
  }: PageTrailProps = $props();
  const titleId = $derived(id + "-title");
</script>

<Block
  tag="section"
  class={cn("py-8", (((tone as string) === "muted") ? "bg-muted" : ""))}
  aria-labelledby={(landmarkLabel ? undefined : titleId)}
  data-tone={tone}
  data-aside={aside}
  aria-label={landmarkLabel}
  data-slot="section"
>
  <Container class={cn("mx-auto w-full max-w-6xl px-4", "flex flex-col gap-6")} data-slot="container">
    {#if ((crumbs?.length ?? 0) > 0)}
      <PageCrumbs label={label} crumbs={crumbs} landmarkLabel={landmarkLabel} />
    {/if}
    <Box
      class={
        (aside as string) === "facts" ? "grid grid-cols-1 items-center gap-8 lg:grid-cols-2"
        : "flex flex-col gap-6 md:flex-row md:items-end md:justify-between"
      }
    >
      <Stack gap="4" align="start" class="min-w-0">
        <SectionHeader titleId={titleId} title={title} heading={{ level, badge }} lead={lead} />
      </Stack>
      {#if ((aside as string) !== "none")}
        <PageAside extras={extras} mode={aside} />
      {/if}
    </Box>
  </Container>
</Block>
blocks/page-trail.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.

import type { Stat } from "./stats-band.types";

export type PageExtras = {
  value: string;
  caption: string;
  note: string;
  icon: string;
  facts: Stat[];
};

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 page-trail
blocks/page-trail.tsx
// Code generated by packages/kit-compose/src/organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT.
/**
 * The head of an inner page with breadcrumbs. Axes: aside (none, figure: one large figure such as a count or a
 * total, note: a small card with a glyph such as a delivery promise or a document version, facts: four key facts
 * in two columns), tone.
 */
import { type ReactNode } from "react";
import { Block, Box, Container, Stack } from "../compose";
import { PageAside } from "../components/page-aside";
import { PageCrumbs } from "../components/page-crumbs";
import { SectionHeader } from "../components/section-header";
import { cn } from "../utils";
import type { PageExtras } from "./page-trail.types";
import type { NavLink } from "./nav-bar.types";
import type { Stat } from "./stats-band.types";

export type PageTrailProps = {
  id: string;
  title: string;
  lead?: string;
  badge?: string;
  label: string;
  crumbs: NavLink[];
  extras: PageExtras;
  aside?: "none" | "figure" | "note" | "facts";
  level?: 1 | 2;
  tone?: "default" | "muted";
  landmarkLabel?: string;
};

export function PageTrail({
  id,
  title,
  lead = "",
  badge = "",
  label,
  crumbs,
  extras,
  aside = "none",
  level = 1,
  tone = "default",
  landmarkLabel,
}: PageTrailProps) {
  const titleId = id + "-title";
  return (
    <Block
      tag="section"
      className={cn("py-8", (((tone as string) === "muted") ? "bg-muted" : ""))}
      aria-labelledby={(landmarkLabel ? undefined : titleId)}
      data-tone={tone}
      data-aside={aside}
      aria-label={landmarkLabel}
      data-slot="section"
    >
      <Container className={cn("mx-auto w-full max-w-6xl px-4", "flex flex-col gap-6")} data-slot="container">
        {((crumbs?.length ?? 0) > 0) ? (
          <PageCrumbs label={label} crumbs={crumbs} landmarkLabel={landmarkLabel} />
        ) : null}
        <Box
          className={
            (aside as string) === "facts" ? "grid grid-cols-1 items-center gap-8 lg:grid-cols-2"
            : "flex flex-col gap-6 md:flex-row md:items-end md:justify-between"
          }
        >
          <Stack gap="4" align="start" className="min-w-0">
            <SectionHeader titleId={titleId} title={title} heading={{ level, badge }} lead={lead} />
          </Stack>
          {((aside as string) !== "none") ? (
            <PageAside extras={extras} mode={aside} />
          ) : null}
        </Box>
      </Container>
    </Block>
  );
}
blocks/page-trail.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.

import type { Stat } from "./stats-band.types";

export type PageExtras = {
  value: string;
  caption: string;
  note: string;
  icon: string;
  facts: Stat[];
};

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 page-trail
blocks/page-trail.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.

import type { Stat } from "./stats-band.types";

export type PageExtras = {
  value: string;
  caption: string;
  note: string;
  icon: string;
  facts: Stat[];
};
blocks/page-trail.vue
<!-- Code generated by packages/kit-compose/src/organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT. -->
<!--
  The head of an inner page with breadcrumbs. Axes: aside (none, figure: one large figure such as a count or a
  total, note: a small card with a glyph such as a delivery promise or a document version, facts: four key facts
  in two columns), tone.
-->
<script lang="ts">
import type { PageExtras } from "./page-trail.types";
import type { NavLink } from "./nav-bar.types";
import type { Stat } from "./stats-band.types";

export type PageTrailProps = {
  id: string;
  title: string;
  lead?: string;
  badge?: string;
  label: string;
  crumbs: NavLink[];
  extras: PageExtras;
  aside?: "none" | "figure" | "note" | "facts";
  level?: 1 | 2;
  tone?: "default" | "muted";
  landmarkLabel?: string;
};
</script>

<script setup lang="ts">
import { computed } from "vue";
import Block from "../compose/Block.vue";
import Box from "../compose/Box.vue";
import Container from "../compose/Container.vue";
import Stack from "../compose/Stack.vue";
import PageAside from "../components/page-aside.vue";
import PageCrumbs from "../components/page-crumbs.vue";
import SectionHeader from "../components/section-header.vue";
import { cn } from "../utils";

const {
  id,
  title,
  lead = "",
  badge = "",
  label,
  crumbs,
  extras,
  aside = "none",
  level = 1,
  tone = "default",
  landmarkLabel,
} = defineProps<PageTrailProps>();
const titleId = computed(() => id + "-title");
</script>

<template>
  <Block
    tag="section"
    :class="cn('py-8', (((tone as string) === 'muted') ? 'bg-muted' : ''))"
    :aria-labelledby="(landmarkLabel ? undefined : titleId)"
    :data-tone="tone"
    :data-aside="aside"
    :aria-label="landmarkLabel"
    data-slot="section"
  >
    <Container :class="cn('mx-auto w-full max-w-6xl px-4', 'flex flex-col gap-6')" data-slot="container">
      <PageCrumbs
        v-if="((crumbs?.length ?? 0) > 0)"
        :label="label"
        :crumbs="crumbs"
        :landmarkLabel="landmarkLabel"
      />
      <Box
        :class="
          (aside as string) === 'facts' ? 'grid grid-cols-1 items-center gap-8 lg:grid-cols-2'
          : 'flex flex-col gap-6 md:flex-row md:items-end md:justify-between'
        "
      >
        <Stack gap="4" align="start" class="min-w-0">
          <SectionHeader :titleId="titleId" :title="title" :heading="{ level, badge }" :lead="lead" />
        </Stack>
        <PageAside v-if="((aside as string) !== 'none')" :extras="extras" :mode="aside" />
      </Box>
    </Container>
  </Block>
</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 page-trail
blocks/page-trail.tsx
// Code generated by packages/kit-compose/src/organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT.
/**
 * The head of an inner page with breadcrumbs. Axes: aside (none, figure: one large figure such as a count or a
 * total, note: a small card with a glyph such as a delivery promise or a document version, facts: four key facts
 * in two columns), tone.
 */
import { type JSX } from "solid-js";
import { Block, Box, Container, Stack } from "../compose";
import { PageAside } from "../components/page-aside";
import { PageCrumbs } from "../components/page-crumbs";
import { SectionHeader } from "../components/section-header";
import { cn } from "../utils";
import type { PageExtras } from "./page-trail.types";
import type { NavLink } from "./nav-bar.types";
import type { Stat } from "./stats-band.types";

export type PageTrailProps = {
  id: string;
  title: string;
  lead?: string;
  badge?: string;
  label: string;
  crumbs: NavLink[];
  extras: PageExtras;
  aside?: "none" | "figure" | "note" | "facts";
  level?: 1 | 2;
  tone?: "default" | "muted";
  landmarkLabel?: string;
};

export function PageTrail({
  id,
  title,
  lead = "",
  badge = "",
  label,
  crumbs,
  extras,
  aside = "none",
  level = 1,
  tone = "default",
  landmarkLabel,
}: PageTrailProps) {
  const titleId = id + "-title";
  return (
    <Block
      tag="section"
      class={cn("py-8", (((tone as string) === "muted") ? "bg-muted" : ""))}
      aria-labelledby={(landmarkLabel ? undefined : titleId)}
      data-tone={tone}
      data-aside={aside}
      aria-label={landmarkLabel}
      data-slot="section"
    >
      <Container class={cn("mx-auto w-full max-w-6xl px-4", "flex flex-col gap-6")} data-slot="container">
        {((crumbs?.length ?? 0) > 0) ? (
          <PageCrumbs label={label} crumbs={crumbs} landmarkLabel={landmarkLabel} />
        ) : null}
        <Box
          class={
            (aside as string) === "facts" ? "grid grid-cols-1 items-center gap-8 lg:grid-cols-2"
            : "flex flex-col gap-6 md:flex-row md:items-end md:justify-between"
          }
        >
          <Stack gap="4" align="start" class="min-w-0">
            <SectionHeader titleId={titleId} title={title} heading={{ level, badge }} lead={lead} />
          </Stack>
          {((aside as string) !== "none") ? (
            <PageAside extras={extras} mode={aside} />
          ) : null}
        </Box>
      </Container>
    </Block>
  );
}
blocks/page-trail.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.

import type { Stat } from "./stats-band.types";

export type PageExtras = {
  value: string;
  caption: string;
  note: string;
  icon: string;
  facts: Stat[];
};

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 page-trail
blocks/page-trail.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/page-trail.json

package blocks

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

// PageTrailProps are the props of PageTrail; the values are the JSON shapes of the TypeScript props.
type PageTrailProps struct {
	Id any `json:"id"`
	Title any `json:"title"`
	Lead any `json:"lead"`
	Badge any `json:"badge"`
	Label any `json:"label"`
	Crumbs any `json:"crumbs"`
	Extras any `json:"extras"`
	Aside any `json:"aside"`
	Level any `json:"level"`
	Tone any `json:"tone"`
	LandmarkLabel any `json:"landmarkLabel"`
}

// The head of an inner page with breadcrumbs. Axes: aside (none, figure: one large figure such as a count or a total, note: a small card with a glyph such as a delivery promise or a document version, facts: four key facts in two columns), tone.
templ PageTrail(p PageTrailProps) {
	{{ vId := p.Id }}
	{{ vTitle := p.Title }}
	{{ vLead := uiutils.Def(p.Lead, "") }}
	{{ vBadge := uiutils.Def(p.Badge, "") }}
	{{ vLabel := p.Label }}
	{{ vCrumbs := p.Crumbs }}
	{{ vExtras := p.Extras }}
	{{ vAside := uiutils.Def(p.Aside, "none") }}
	{{ vLevel := uiutils.Def(p.Level, float64(1)) }}
	{{ vTone := uiutils.Def(p.Tone, "default") }}
	{{ vLandmarkLabel := p.LandmarkLabel }}
	{{ vTitleId := any(uiutils.Add(vId, "-title")) }}
	@compose.Block(compose.BlockProps{BoxProps: box.BoxProps{Tag: "section", Class: uiutils.S(uiutils.Cnv("py-8", uiutils.Cond(uiutils.T(uiutils.Eq(vTone, "muted")), "bg-muted", ""))), Attrs: uiutils.Attrs("aria-labelledby", uiutils.Cond(uiutils.T(vLandmarkLabel), nil, vTitleId), "data-tone", vTone, "data-aside", vAside, "aria-label", vLandmarkLabel, "data-slot", "section")}}) {
		@compose.Container(compose.ContainerProps{BoxProps: box.BoxProps{Class: uiutils.S(uiutils.Cnv("mx-auto w-full max-w-6xl px-4", "flex flex-col gap-6")), Attrs: uiutils.Attrs("data-slot", "container")}}) {
			if uiutils.Gt(uiutils.Len(vCrumbs), float64(0)) {
				@PageCrumbs(PageCrumbsProps{Label: vLabel, Crumbs: vCrumbs, LandmarkLabel: vLandmarkLabel})
			}
			@compose.Box(compose.BoxProps{BoxProps: box.BoxProps{Class: uiutils.S(uiutils.Cond(uiutils.T(uiutils.Eq(vAside, "facts")), "grid grid-cols-1 items-center gap-8 lg:grid-cols-2", "flex flex-col gap-6 md:flex-row md:items-end md:justify-between"))}}) {
				@compose.Stack(compose.StackProps{Gap: "4", Align: "start", BoxProps: box.BoxProps{Class: "min-w-0"}}) {
					@SectionHeader(SectionHeaderProps{TitleId: vTitleId, Title: vTitle, Heading: map[string]any{"level": vLevel, "badge": vBadge}, Lead: vLead})
				}
				if !uiutils.Eq(vAside, "none") {
					@PageAside(PageAsideProps{Extras: vExtras, Mode: vAside})
				}
			}
		}
	}
}

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 page-trail
blocks/page-trail.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/page-trail.json
    The head of an inner page with breadcrumbs. Axes: aside (none, figure: one large figure such as a count or a total, note: a small card with a glyph such as a delivery promise or a document version, facts: four key facts in two columns), tone.
    Props (p): id, title, lead, badge, label, crumbs, extras, aside, level, tone, landmarkLabel. -#}
{%- set v_id = (p.id ?? null) -%}
{%- set v_title = (p.title ?? null) -%}
{%- set v_lead = (p.lead ?? '') -%}
{%- set v_badge = (p.badge ?? '') -%}
{%- set v_label = (p.label ?? null) -%}
{%- set v_crumbs = (p.crumbs ?? null) -%}
{%- set v_extras = (p.extras ?? null) -%}
{%- set v_aside = (p.aside ?? 'none') -%}
{%- set v_level = (p.level ?? 1) -%}
{%- set v_tone = (p.tone ?? 'default') -%}
{%- set v_landmarkLabel = (p.landmarkLabel ?? null) -%}
{%- set v_titleId = og_add(v_id, '-title') -%}
{%- set c_4 -%}
  {%- set c_3 -%}
    {%- if og_t(og_gt(og_len(v_crumbs), 0)) %}
      {{ include('blocks/page-crumbs.html.twig', {'p': {'label': v_label, 'crumbs': v_crumbs, 'landmarkLabel': v_landmarkLabel}}, with_context = false) }}
    {%- endif %}
    {%- set c_2 -%}
      {%- set c_1 -%}
        {{ include('blocks/section-header.html.twig', {'p': {'titleId': v_titleId, 'title': v_title, 'heading': {'level': v_level, 'badge': v_badge}, 'lead': v_lead}}, with_context = false) }}
      {%- endset -%}
      {{ include('compose/Stack.html.twig', {'gap': '4', 'align': 'start', 'class': 'min-w-0', 'children': c_1}, with_context = false) }}
      {%- if og_t(not (og_eq(v_aside, 'none'))) %}
        {{ include('blocks/page-aside.html.twig', {'p': {'extras': v_extras, 'mode': v_aside}}, with_context = false) }}
      {%- endif %}
    {%- endset -%}
    {{ include('compose/Box.html.twig', {'class': og_s((og_t(og_eq(v_aside, 'facts')) ? 'grid grid-cols-1 items-center gap-8 lg:grid-cols-2' : 'flex flex-col gap-6 md:flex-row md:items-end md:justify-between')), 'children': c_2}, with_context = false) }}
  {%- endset -%}
  {{ include('compose/Container.html.twig', {'class': og_s(og_cnv(['mx-auto w-full max-w-6xl px-4', 'flex flex-col gap-6'])), 'attrs': og_attrs(['data-slot', 'container']), 'children': c_3}, with_context = false) }}
{%- endset -%}
{{ include('compose/Block.html.twig', {'tag': 'section', 'class': og_s(og_cnv(['py-8', (og_t(og_eq(v_tone, 'muted')) ? 'bg-muted' : '')])), 'attrs': og_attrs(['aria-labelledby', (og_t(v_landmarkLabel) ? null : v_titleId), 'data-tone', v_tone, 'data-aside', v_aside, 'aria-label', v_landmarkLabel, 'data-slot', 'section']), 'children': c_4}, 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 page-trail
blocks/page-trail.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/page-trail.json
    The head of an inner page with breadcrumbs. Axes: aside (none, figure: one large figure such as a count or a total, note: a small card with a glyph such as a delivery promise or a document version, facts: four key facts in two columns), tone.
    Props (p): id, title, lead, badge, label, crumbs, extras, aside, level, tone, landmarkLabel. *}
{var $v_id = ($p['id'] ?? null)}
{var $v_title = ($p['title'] ?? null)}
{var $v_lead = ($p['lead'] ?? '')}
{var $v_badge = ($p['badge'] ?? '')}
{var $v_label = ($p['label'] ?? null)}
{var $v_crumbs = ($p['crumbs'] ?? null)}
{var $v_extras = ($p['extras'] ?? null)}
{var $v_aside = ($p['aside'] ?? 'none')}
{var $v_level = ($p['level'] ?? 1)}
{var $v_tone = ($p['tone'] ?? 'default')}
{var $v_landmarkLabel = ($p['landmarkLabel'] ?? null)}
{var $v_titleId = og_add($v_id, '-title')}
{capture $c_4}
  {capture $c_3}
    {if og_t(og_gt(og_len($v_crumbs), 0))}
      {=og_include('blocks/page-crumbs.latte', ['p' => ['label' => $v_label, 'crumbs' => $v_crumbs, 'landmarkLabel' => $v_landmarkLabel]])|noescape}
    {/if}
    {capture $c_2}
      {capture $c_1}
        {=og_include('blocks/section-header.latte', ['p' => ['titleId' => $v_titleId, 'title' => $v_title, 'heading' => ['level' => $v_level, 'badge' => $v_badge], 'lead' => $v_lead]])|noescape}
      {/capture}
      {=og_include('compose/Stack.latte', ['gap' => '4', 'align' => 'start', 'class' => 'min-w-0', 'children' => (string) $c_1])|noescape}
      {if og_t(!(og_eq($v_aside, 'none')))}
        {=og_include('blocks/page-aside.latte', ['p' => ['extras' => $v_extras, 'mode' => $v_aside]])|noescape}
      {/if}
    {/capture}
    {=og_include('compose/Box.latte', ['class' => og_s((og_t(og_eq($v_aside, 'facts')) ? 'grid grid-cols-1 items-center gap-8 lg:grid-cols-2' : 'flex flex-col gap-6 md:flex-row md:items-end md:justify-between')), 'children' => (string) $c_2])|noescape}
  {/capture}
  {=og_include('compose/Container.latte', ['class' => og_s(og_cnv(['mx-auto w-full max-w-6xl px-4', 'flex flex-col gap-6'])), 'attrs' => og_attrs(['data-slot', 'container']), 'children' => (string) $c_3])|noescape}
{/capture}
{=og_include('compose/Block.latte', ['tag' => 'section', 'class' => og_s(og_cnv(['py-8', (og_t(og_eq($v_tone, 'muted')) ? 'bg-muted' : '')])), 'attrs' => og_attrs(['aria-labelledby', (og_t($v_landmarkLabel) ? null : $v_titleId), 'data-tone', $v_tone, 'data-aside', $v_aside, 'aria-label', $v_landmarkLabel, 'data-slot', 'section']), 'children' => (string) $c_4])|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 page-trail
blocks/page-trail.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/page-trail.json
    The head of an inner page with breadcrumbs. Axes: aside (none, figure: one large figure such as a count or a total, note: a small card with a glyph such as a delivery promise or a document version, facts: four key facts in two columns), tone.
    Props (p): id, title, lead, badge, label, crumbs, extras, aside, level, tone, 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_badge = og_def(p['badge'], '') -%}
{%- set v_label = og_def(p['label'], none) -%}
{%- set v_crumbs = og_def(p['crumbs'], none) -%}
{%- set v_extras = og_def(p['extras'], none) -%}
{%- set v_aside = og_def(p['aside'], 'none') -%}
{%- set v_level = og_def(p['level'], 1) -%}
{%- set v_tone = og_def(p['tone'], 'default') -%}
{%- set v_landmarkLabel = og_def(p['landmarkLabel'], none) -%}
{%- set v_titleId = og_add(v_id, '-title') -%}
{%- set c_4 -%}
  {%- set c_3 -%}
    {%- if og_t(og_gt(og_len(v_crumbs), 0)) %}
      {{ og_include('blocks/page-crumbs.html.j2', {'p': {'label': v_label, 'crumbs': v_crumbs, 'landmarkLabel': v_landmarkLabel}}) }}
    {%- endif %}
    {%- set c_2 -%}
      {%- set c_1 -%}
        {{ og_include('blocks/section-header.html.j2', {'p': {'titleId': v_titleId, 'title': v_title, 'heading': {'level': v_level, 'badge': v_badge}, 'lead': v_lead}}) }}
      {%- endset -%}
      {{ og_include('compose/stack.html.j2', {'p': {'Gap': '4', 'Align': 'start', 'Class': 'min-w-0'}, 'children': c_1}) }}
      {%- if og_t(not (og_eq(v_aside, 'none'))) %}
        {{ og_include('blocks/page-aside.html.j2', {'p': {'extras': v_extras, 'mode': v_aside}}) }}
      {%- endif %}
    {%- endset -%}
    {{ og_include('compose/box.html.j2', {'p': {'Class': og_s(('grid grid-cols-1 items-center gap-8 lg:grid-cols-2' if og_t(og_eq(v_aside, 'facts')) else 'flex flex-col gap-6 md:flex-row md:items-end md:justify-between'))}, 'children': c_2}) }}
  {%- endset -%}
  {{ og_include('compose/container.html.j2', {'p': {'Class': og_s(og_cnv(['mx-auto w-full max-w-6xl px-4', 'flex flex-col gap-6'])), 'Attrs': og_attrs(['data-slot', 'container'])}, 'children': c_3}) }}
{%- endset -%}
{{ og_include('compose/block.html.j2', {'p': {'Tag': 'section', 'Class': og_s(og_cnv(['py-8', ('bg-muted' if og_t(og_eq(v_tone, 'muted')) else '')])), 'Attrs': og_attrs(['aria-labelledby', (none if og_t(v_landmarkLabel) else v_titleId), 'data-tone', v_tone, 'data-aside', v_aside, 'aria-label', v_landmarkLabel, 'data-slot', 'section'])}, 'children': c_4}) }}

Jinja2 registry item (JSON)

Props

Names and types come from the xgen specs of the source. Standard HTML attributes (id, role, tabIndex, aria-*) pass through to the root element; the class prop is className in React.

The head of an inner page with breadcrumbs. Axes: aside (none, figure: one large figure such as a count or a total, note: a small card with a glyph such as a delivery promise or a document version, facts: four key facts in two columns), tone.

Props of PageTrail
PropTypeDefault Description
id (required)string-
title (required)string-
lead string""
badge string""a short pill above the heading
label (required)string-accessible name of the breadcrumbs
crumbs (required)NavLink[]-the trail of pages (a parent_id chain): the parent pages, then the current page; empty: no breadcrumbs
extras (required)PageExtras-the figure or note (value, caption, note, icon) and the facts
aside "none" | "figure" | "note" | "facts""none"
level 1 | 21
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

Used in