Site Footer
Copyright and links.
Install
npx ui8kit add site-footerPulls in: block, compose, container, group, kit-box, kit-text, menu-entry, nav-block, site-header, text, utils
Preview
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 site-footer<!-- 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 page footer: the copyright line and the same two links. Axes: layout (minimal, centered), density
(default, compact).
-->
<script lang="ts" module>
import type { Snippet } from "svelte";
import type { SiteFooterLabels } from "./site-footer.types";
import type { SiteRoutes } from "./site-header.types";
export type SiteFooterProps = {
labels: SiteFooterLabels;
routes?: SiteRoutes;
layout?: "minimal" | "centered";
density?: "default" | "compact";
landmarkLabel?: string;
};
</script>
<script lang="ts">
import Block from "../compose/Block.svelte";
import Container from "../compose/Container.svelte";
import Group from "../compose/Group.svelte";
import Text from "../compose/Text.svelte";
import MenuEntry from "../components/menu-entry.svelte";
import NavBlock from "../components/nav-block.svelte";
import { cn, tpl, uniqLabel } from "../utils";
let { labels, routes, layout = "minimal", density = "default", landmarkLabel }: SiteFooterProps = $props();
</script>
<Block
tag="footer"
class="mt-12 border-t border-border"
data-layout={layout}
aria-label={landmarkLabel}
data-slot="site-footer"
>
<Container
class={cn(
"mx-auto w-full max-w-6xl px-4",
"flex flex-wrap items-center gap-4",
(((density as string) === "compact") ? "py-4" : "py-6"),
(((layout as string) === "centered") ? "flex-col text-center" : "justify-between")
)}
data-slot="container"
>
<Text size="sm" class="text-muted-foreground" data-slot="copyright">
{labels.copyright}
</Text>
<NavBlock label={(landmarkLabel ? uniqLabel(tpl("{0}, {1}", labels.nav, landmarkLabel)) : labels.nav)}>
<Group gap="4">
<MenuEntry href={routes?.home} class="font-semibold">
{labels.home}
</MenuEntry>
<MenuEntry href={routes?.pricing} class="font-semibold">
{labels.pricing}
</MenuEntry>
</Group>
</NavBlock>
</Container>
</Block>
// 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 SiteFooterLabels = {
copyright: string;
nav: string;
home: string;
pricing: 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 site-footer// 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 page footer: the copyright line and the same two links. Axes: layout (minimal, centered), density
* (default, compact).
*/
import { type ReactNode } from "react";
import { Block, Container, Group, Text } from "../compose";
import { MenuEntry } from "../components/menu-entry";
import { NavBlock } from "../components/nav-block";
import { cn, tpl, uniqLabel } from "../utils";
import type { SiteFooterLabels } from "./site-footer.types";
import type { SiteRoutes } from "./site-header.types";
export type SiteFooterProps = {
labels: SiteFooterLabels;
routes?: SiteRoutes;
layout?: "minimal" | "centered";
density?: "default" | "compact";
landmarkLabel?: string;
};
export function SiteFooter({
labels,
routes,
layout = "minimal",
density = "default",
landmarkLabel,
}: SiteFooterProps) {
return (
<Block
tag="footer"
className="mt-12 border-t border-border"
data-layout={layout}
aria-label={landmarkLabel}
data-slot="site-footer"
>
<Container
className={cn(
"mx-auto w-full max-w-6xl px-4",
"flex flex-wrap items-center gap-4",
(((density as string) === "compact") ? "py-4" : "py-6"),
(((layout as string) === "centered") ? "flex-col text-center" : "justify-between")
)}
data-slot="container"
>
<Text size="sm" className="text-muted-foreground" data-slot="copyright">
{labels.copyright}
</Text>
<NavBlock label={(landmarkLabel ? uniqLabel(tpl("{0}, {1}", labels.nav, landmarkLabel)) : labels.nav)}>
<Group gap="4">
<MenuEntry href={routes?.home} className="font-semibold">
{labels.home}
</MenuEntry>
<MenuEntry href={routes?.pricing} className="font-semibold">
{labels.pricing}
</MenuEntry>
</Group>
</NavBlock>
</Container>
</Block>
);
}
// 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 SiteFooterLabels = {
copyright: string;
nav: string;
home: string;
pricing: 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 site-footer// 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 SiteFooterLabels = {
copyright: string;
nav: string;
home: string;
pricing: 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. -->
<!--
The page footer: the copyright line and the same two links. Axes: layout (minimal, centered), density
(default, compact).
-->
<script lang="ts">
import type { SiteFooterLabels } from "./site-footer.types";
import type { SiteRoutes } from "./site-header.types";
export type SiteFooterProps = {
labels: SiteFooterLabels;
routes?: SiteRoutes;
layout?: "minimal" | "centered";
density?: "default" | "compact";
landmarkLabel?: string;
};
</script>
<script setup lang="ts">
import Block from "../compose/Block.vue";
import Container from "../compose/Container.vue";
import Group from "../compose/Group.vue";
import Text from "../compose/Text.vue";
import MenuEntry from "../components/menu-entry.vue";
import NavBlock from "../components/nav-block.vue";
import { cn, tpl, uniqLabel } from "../utils";
const {
labels,
routes,
layout = "minimal",
density = "default",
landmarkLabel,
} = defineProps<SiteFooterProps>();
</script>
<template>
<Block
tag="footer"
class="mt-12 border-t border-border"
:data-layout="layout"
:aria-label="landmarkLabel"
data-slot="site-footer"
>
<Container
:class="cn(
'mx-auto w-full max-w-6xl px-4',
'flex flex-wrap items-center gap-4',
(((density as string) === 'compact') ? 'py-4' : 'py-6'),
(((layout as string) === 'centered') ? 'flex-col text-center' : 'justify-between')
)"
data-slot="container"
>
<Text size="sm" class="text-muted-foreground" data-slot="copyright">
{{ labels.copyright }}
</Text>
<NavBlock :label="(landmarkLabel ? uniqLabel(tpl('{0}, {1}', labels.nav, landmarkLabel)) : labels.nav)">
<Group gap="4">
<MenuEntry :href="routes?.home" class="font-semibold">
{{ labels.home }}
</MenuEntry>
<MenuEntry :href="routes?.pricing" class="font-semibold">
{{ labels.pricing }}
</MenuEntry>
</Group>
</NavBlock>
</Container>
</Block>
</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 site-footer// 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 page footer: the copyright line and the same two links. Axes: layout (minimal, centered), density
* (default, compact).
*/
import { type JSX } from "solid-js";
import { Block, Container, Group, Text } from "../compose";
import { MenuEntry } from "../components/menu-entry";
import { NavBlock } from "../components/nav-block";
import { cn, tpl, uniqLabel } from "../utils";
import type { SiteFooterLabels } from "./site-footer.types";
import type { SiteRoutes } from "./site-header.types";
export type SiteFooterProps = {
labels: SiteFooterLabels;
routes?: SiteRoutes;
layout?: "minimal" | "centered";
density?: "default" | "compact";
landmarkLabel?: string;
};
export function SiteFooter({
labels,
routes,
layout = "minimal",
density = "default",
landmarkLabel,
}: SiteFooterProps) {
return (
<Block
tag="footer"
class="mt-12 border-t border-border"
data-layout={layout}
aria-label={landmarkLabel}
data-slot="site-footer"
>
<Container
class={cn(
"mx-auto w-full max-w-6xl px-4",
"flex flex-wrap items-center gap-4",
(((density as string) === "compact") ? "py-4" : "py-6"),
(((layout as string) === "centered") ? "flex-col text-center" : "justify-between")
)}
data-slot="container"
>
<Text size="sm" class="text-muted-foreground" data-slot="copyright">
{labels.copyright}
</Text>
<NavBlock label={(landmarkLabel ? uniqLabel(tpl("{0}, {1}", labels.nav, landmarkLabel)) : labels.nav)}>
<Group gap="4">
<MenuEntry href={routes?.home} class="font-semibold">
{labels.home}
</MenuEntry>
<MenuEntry href={routes?.pricing} class="font-semibold">
{labels.pricing}
</MenuEntry>
</Group>
</NavBlock>
</Container>
</Block>
);
}
// 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 SiteFooterLabels = {
copyright: string;
nav: string;
home: string;
pricing: 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 site-footer// 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/site-footer.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"
)
// SiteFooterProps are the props of SiteFooter; the values are the JSON shapes of the TypeScript props.
type SiteFooterProps struct {
Labels any `json:"labels"`
Routes any `json:"routes"`
Layout any `json:"layout"`
Density any `json:"density"`
LandmarkLabel any `json:"landmarkLabel"`
}
// The page footer: the copyright line and the same two links. Axes: layout (minimal, centered), density (default, compact).
templ SiteFooter(p SiteFooterProps) {
{{ vLabels := p.Labels }}
{{ vRoutes := p.Routes }}
{{ vLayout := uiutils.Def(p.Layout, "minimal") }}
{{ vDensity := uiutils.Def(p.Density, "default") }}
{{ vLandmarkLabel := p.LandmarkLabel }}
@compose.Block(compose.BlockProps{BoxProps: box.BoxProps{Tag: "footer", Class: "mt-12 border-t border-border", Attrs: uiutils.Attrs("data-layout", vLayout, "aria-label", vLandmarkLabel, "data-slot", "site-footer")}}) {
@compose.Container(compose.ContainerProps{BoxProps: box.BoxProps{Class: uiutils.S(uiutils.Cnv("mx-auto w-full max-w-6xl px-4", "flex flex-wrap items-center gap-4", uiutils.Cond(uiutils.T(uiutils.Eq(vDensity, "compact")), "py-4", "py-6"), uiutils.Cond(uiutils.T(uiutils.Eq(vLayout, "centered")), "flex-col text-center", "justify-between"))), Attrs: uiutils.Attrs("data-slot", "container")}}) {
@compose.Text(compose.TextProps{Size: "sm", TextProps: text.TextProps{Class: "text-muted-foreground", Attrs: uiutils.Attrs("data-slot", "copyright")}}) {
{ uiutils.Text(uiutils.Get(vLabels, "copyright")) }
}
@NavBlock(NavBlockProps{Label: uiutils.Cond(uiutils.T(vLandmarkLabel), uiutils.Uniq(uiutils.Tpl("{0}, {1}", uiutils.Get(vLabels, "nav"), vLandmarkLabel)), uiutils.Get(vLabels, "nav"))}) {
@compose.Group(compose.GroupProps{Gap: "4", BoxProps: box.BoxProps{}}) {
@MenuEntry(MenuEntryProps{Href: uiutils.Get(vRoutes, "home"), Class: uiutils.Cnv("font-semibold")}) {
{ uiutils.Text(uiutils.Get(vLabels, "home")) }
}
@MenuEntry(MenuEntryProps{Href: uiutils.Get(vRoutes, "pricing"), Class: uiutils.Cnv("font-semibold")}) {
{ uiutils.Text(uiutils.Get(vLabels, "pricing")) }
}
}
}
}
}
}
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 site-footer{#- 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/site-footer.json
The page footer: the copyright line and the same two links. Axes: layout (minimal, centered), density (default, compact).
Props (p): labels, routes, layout, density, landmarkLabel. -#}
{%- set v_labels = (p.labels ?? null) -%}
{%- set v_routes = (p.routes ?? null) -%}
{%- set v_layout = (p.layout ?? 'minimal') -%}
{%- set v_density = (p.density ?? 'default') -%}
{%- set v_landmarkLabel = (p.landmarkLabel ?? null) -%}
{%- set c_7 -%}
{%- set c_6 -%}
{%- set c_1 -%}
{{ og_text(og_get(v_labels, ['copyright'])) }}
{%- endset -%}
{{ include('compose/Text.html.twig', {'size': 'sm', 'class': 'text-muted-foreground', 'attrs': og_attrs(['data-slot', 'copyright']), 'children': c_1}, with_context = false) }}
{%- set c_5 -%}
{%- set c_4 -%}
{%- set c_2 -%}
{{ og_text(og_get(v_labels, ['home'])) }}
{%- endset -%}
{{ include('blocks/menu-entry.html.twig', {'p': {'href': og_get(v_routes, ['home']), 'className': og_cnv(['font-semibold'])}, 'children': og_markup(c_2)}, with_context = false) }}
{%- set c_3 -%}
{{ og_text(og_get(v_labels, ['pricing'])) }}
{%- endset -%}
{{ include('blocks/menu-entry.html.twig', {'p': {'href': og_get(v_routes, ['pricing']), 'className': og_cnv(['font-semibold'])}, 'children': og_markup(c_3)}, with_context = false) }}
{%- endset -%}
{{ include('compose/Group.html.twig', {'gap': '4', 'children': c_4}, with_context = false) }}
{%- endset -%}
{{ include('blocks/nav-block.html.twig', {'p': {'label': (og_t(v_landmarkLabel) ? og_uniq(og_tpl('{0}, {1}', [og_get(v_labels, ['nav']), v_landmarkLabel])) : og_get(v_labels, ['nav']))}, 'children': og_markup(c_5)}, 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-wrap items-center gap-4', (og_t(og_eq(v_density, 'compact')) ? 'py-4' : 'py-6'), (og_t(og_eq(v_layout, 'centered')) ? 'flex-col text-center' : 'justify-between')])), 'attrs': og_attrs(['data-slot', 'container']), 'children': c_6}, with_context = false) }}
{%- endset -%}
{{ include('compose/Block.html.twig', {'tag': 'footer', 'class': 'mt-12 border-t border-border', 'attrs': og_attrs(['data-layout', v_layout, 'aria-label', v_landmarkLabel, 'data-slot', 'site-footer']), 'children': c_7}, 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 site-footer{* 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/site-footer.json
The page footer: the copyright line and the same two links. Axes: layout (minimal, centered), density (default, compact).
Props (p): labels, routes, layout, density, landmarkLabel. *}
{var $v_labels = ($p['labels'] ?? null)}
{var $v_routes = ($p['routes'] ?? null)}
{var $v_layout = ($p['layout'] ?? 'minimal')}
{var $v_density = ($p['density'] ?? 'default')}
{var $v_landmarkLabel = ($p['landmarkLabel'] ?? null)}
{capture $c_7}
{capture $c_6}
{capture $c_1}
{=og_text(og_get($v_labels, ['copyright']))}
{/capture}
{=og_include('compose/Text.latte', ['size' => 'sm', 'class' => 'text-muted-foreground', 'attrs' => og_attrs(['data-slot', 'copyright']), 'children' => (string) $c_1])|noescape}
{capture $c_5}
{capture $c_4}
{capture $c_2}
{=og_text(og_get($v_labels, ['home']))}
{/capture}
{=og_include('blocks/menu-entry.latte', ['p' => ['href' => og_get($v_routes, ['home']), 'className' => og_cnv(['font-semibold'])], 'children' => og_markup($c_2)])|noescape}
{capture $c_3}
{=og_text(og_get($v_labels, ['pricing']))}
{/capture}
{=og_include('blocks/menu-entry.latte', ['p' => ['href' => og_get($v_routes, ['pricing']), 'className' => og_cnv(['font-semibold'])], 'children' => og_markup($c_3)])|noescape}
{/capture}
{=og_include('compose/Group.latte', ['gap' => '4', 'children' => (string) $c_4])|noescape}
{/capture}
{=og_include('blocks/nav-block.latte', ['p' => ['label' => (og_t($v_landmarkLabel) ? og_uniq(og_tpl('{0}, {1}', [og_get($v_labels, ['nav']), $v_landmarkLabel])) : og_get($v_labels, ['nav']))], 'children' => og_markup($c_5)])|noescape}
{/capture}
{=og_include('compose/Container.latte', ['class' => og_s(og_cnv(['mx-auto w-full max-w-6xl px-4', 'flex flex-wrap items-center gap-4', (og_t(og_eq($v_density, 'compact')) ? 'py-4' : 'py-6'), (og_t(og_eq($v_layout, 'centered')) ? 'flex-col text-center' : 'justify-between')])), 'attrs' => og_attrs(['data-slot', 'container']), 'children' => (string) $c_6])|noescape}
{/capture}
{=og_include('compose/Block.latte', ['tag' => 'footer', 'class' => 'mt-12 border-t border-border', 'attrs' => og_attrs(['data-layout', $v_layout, 'aria-label', $v_landmarkLabel, 'data-slot', 'site-footer']), 'children' => (string) $c_7])|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 site-footer{#- 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/site-footer.json
The page footer: the copyright line and the same two links. Axes: layout (minimal, centered), density (default, compact).
Props (p): labels, routes, layout, density, landmarkLabel. -#}
{%- set v_labels = og_def(p['labels'], none) -%}
{%- set v_routes = og_def(p['routes'], none) -%}
{%- set v_layout = og_def(p['layout'], 'minimal') -%}
{%- set v_density = og_def(p['density'], 'default') -%}
{%- set v_landmarkLabel = og_def(p['landmarkLabel'], none) -%}
{%- set c_7 -%}
{%- set c_6 -%}
{%- set c_1 -%}
{{ og_text(og_get(v_labels, ['copyright'])) }}
{%- endset -%}
{{ og_include('compose/text.html.j2', {'p': {'Size': 'sm', 'Class': 'text-muted-foreground', 'Attrs': og_attrs(['data-slot', 'copyright'])}, 'children': c_1}) }}
{%- set c_5 -%}
{%- set c_4 -%}
{%- set c_2 -%}
{{ og_text(og_get(v_labels, ['home'])) }}
{%- endset -%}
{{ og_include('blocks/menu-entry.html.j2', {'p': {'href': og_get(v_routes, ['home']), 'className': og_cnv(['font-semibold'])}, 'children': og_markup(c_2)}) }}
{%- set c_3 -%}
{{ og_text(og_get(v_labels, ['pricing'])) }}
{%- endset -%}
{{ og_include('blocks/menu-entry.html.j2', {'p': {'href': og_get(v_routes, ['pricing']), 'className': og_cnv(['font-semibold'])}, 'children': og_markup(c_3)}) }}
{%- endset -%}
{{ og_include('compose/group.html.j2', {'p': {'Gap': '4'}, 'children': c_4}) }}
{%- endset -%}
{{ og_include('blocks/nav-block.html.j2', {'p': {'label': (og_uniq(og_tpl('{0}, {1}', [og_get(v_labels, ['nav']), v_landmarkLabel])) if og_t(v_landmarkLabel) else og_get(v_labels, ['nav']))}, 'children': og_markup(c_5)}) }}
{%- endset -%}
{{ og_include('compose/container.html.j2', {'p': {'Class': og_s(og_cnv(['mx-auto w-full max-w-6xl px-4', 'flex flex-wrap items-center gap-4', ('py-4' if og_t(og_eq(v_density, 'compact')) else 'py-6'), ('flex-col text-center' if og_t(og_eq(v_layout, 'centered')) else 'justify-between')])), 'Attrs': og_attrs(['data-slot', 'container'])}, 'children': c_6}) }}
{%- endset -%}
{{ og_include('compose/block.html.j2', {'p': {'Tag': 'footer', 'Class': 'mt-12 border-t border-border', 'Attrs': og_attrs(['data-layout', v_layout, 'aria-label', v_landmarkLabel, 'data-slot', 'site-footer'])}, 'children': c_7}) }}
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 page footer: the copyright line and the same two links. Axes: layout (minimal, centered), density (default, compact).
| Prop | Type | Default | Description |
|---|---|---|---|
| labels (required) | SiteFooterLabels | - | |
| routes | SiteRoutes | - | the addresses of the two pages, from the app; none: text, not links |
| layout | "minimal" | "centered" | "minimal" | minimal: one row; centered: stacked and centered |
| 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 |