Footer Link Columns
Footer Link Columns component
Install
npx ui8kit add footer-link-columnsPulls in: block, box, compose, kit-box, kit-text, list, list-item, mega-menu, menu-entry, stack, 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 footer-link-columns<!-- 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 first three link groups of FooterSplit as small columns beside each other. -->
<script lang="ts" module>
import type { Snippet } from "svelte";
import type { MegaGroup } from "../blocks/mega-menu.types";
export type FooterLinkColumnsProps = {
label: string;
groups: MegaGroup[];
landmarkLabel?: string;
};
</script>
<script lang="ts">
import Block from "../compose/Block.svelte";
import Box from "../compose/Box.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 MenuEntry from "../components/menu-entry.svelte";
let { label, groups, landmarkLabel }: FooterLinkColumnsProps = $props();
</script>
{#if ((groups?.length ?? 0) > 0)}
<Block tag="nav" aria-label={(landmarkLabel ?? label)} data-slot="footer-link-columns">
<Box class="grid grid-cols-2 gap-8 sm:grid-cols-3">
{#each groups as g, i (g.id)}
{#if (i < 3)}
<Stack gap="2" data-slot="group">
<Text size="sm" weight="semibold">
{g.title}
</Text>
<List class="m-0 flex list-none flex-col gap-2 p-0">
{#each g.links as item (item.id)}
<ListItem data-slot="links-row">
<MenuEntry href={item.href} class="text-sm text-muted-foreground" variant="muted" size="sm">
{item.name}
</MenuEntry>
</ListItem>
{/each}
</List>
</Stack>
{/if}
{/each}
</Box>
</Block>
{/if}
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 footer-link-columns// 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 first three link groups of FooterSplit as small columns beside each other. */
import { Fragment, type ReactNode } from "react";
import { Block, Box, List, ListItem, Stack, Text } from "../compose";
import { MenuEntry } from "../components/menu-entry";
import type { MegaGroup } from "../blocks/mega-menu.types";
export type FooterLinkColumnsProps = {
label: string;
groups: MegaGroup[];
landmarkLabel?: string;
};
export function FooterLinkColumns({ label, groups, landmarkLabel }: FooterLinkColumnsProps) {
return (
<>
{((groups?.length ?? 0) > 0) ? (
<Block tag="nav" aria-label={(landmarkLabel ?? label)} data-slot="footer-link-columns">
<Box className="grid grid-cols-2 gap-8 sm:grid-cols-3">
{(groups ?? []).map((g, i) => (
<Fragment key={g.id}>
{(i < 3) ? (
<Stack gap="2" data-slot="group">
<Text size="sm" weight="semibold">
{g.title}
</Text>
<List className="m-0 flex list-none flex-col gap-2 p-0">
{(g.links ?? []).map((item) => (
<ListItem key={item.id} data-slot="links-row">
<MenuEntry href={item.href} className="text-sm text-muted-foreground" variant="muted" size="sm">
{item.name}
</MenuEntry>
</ListItem>
))}
</List>
</Stack>
) : null}
</Fragment>
))}
</Box>
</Block>
) : null}
</>
);
}
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 footer-link-columns<!-- 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 first three link groups of FooterSplit as small columns beside each other. -->
<script lang="ts">
import type { MegaGroup } from "../blocks/mega-menu.types";
export type FooterLinkColumnsProps = {
label: string;
groups: MegaGroup[];
landmarkLabel?: string;
};
</script>
<script setup lang="ts">
import Block from "../compose/Block.vue";
import Box from "../compose/Box.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 MenuEntry from "../components/menu-entry.vue";
const { label, groups, landmarkLabel } = defineProps<FooterLinkColumnsProps>();
</script>
<template>
<Block
v-if="((groups?.length ?? 0) > 0)"
tag="nav"
:aria-label="(landmarkLabel ?? label)"
data-slot="footer-link-columns"
>
<Box class="grid grid-cols-2 gap-8 sm:grid-cols-3">
<template v-for="(g, i) in groups" :key="g.id">
<Stack v-if="(i < 3)" gap="2" data-slot="group">
<Text size="sm" weight="semibold">
{{ g.title }}
</Text>
<List class="m-0 flex list-none flex-col gap-2 p-0">
<ListItem v-for="item in g.links" :key="item.id" data-slot="links-row">
<MenuEntry :href="item.href" class="text-sm text-muted-foreground" variant="muted" size="sm">
{{ item.name }}
</MenuEntry>
</ListItem>
</List>
</Stack>
</template>
</Box>
</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 footer-link-columns// 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 first three link groups of FooterSplit as small columns beside each other. */
import { For, type JSX } from "solid-js";
import { Block, Box, List, ListItem, Stack, Text } from "../compose";
import { MenuEntry } from "../components/menu-entry";
import type { MegaGroup } from "../blocks/mega-menu.types";
export type FooterLinkColumnsProps = {
label: string;
groups: MegaGroup[];
landmarkLabel?: string;
};
export function FooterLinkColumns({ label, groups, landmarkLabel }: FooterLinkColumnsProps) {
return (
<>
{((groups?.length ?? 0) > 0) ? (
<Block tag="nav" aria-label={(landmarkLabel ?? label)} data-slot="footer-link-columns">
<Box class="grid grid-cols-2 gap-8 sm:grid-cols-3">
<For each={groups ?? []}>{(g, iOf) => { const i = iOf(); return (
<>
{(i < 3) ? (
<Stack gap="2" data-slot="group">
<Text size="sm" weight="semibold">
{g.title}
</Text>
<List class="m-0 flex list-none flex-col gap-2 p-0">
<For each={g.links ?? []}>{(item) => (
<ListItem data-slot="links-row">
<MenuEntry href={item.href} class="text-sm text-muted-foreground" variant="muted" size="sm">
{item.name}
</MenuEntry>
</ListItem>
)}</For>
</List>
</Stack>
) : null}
</>
); }}</For>
</Box>
</Block>
) : null}
</>
);
}
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 footer-link-columns// 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/footer-link-columns.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"
)
// FooterLinkColumnsProps are the props of FooterLinkColumns; the values are the JSON shapes of the TypeScript props.
type FooterLinkColumnsProps struct {
Label any `json:"label"`
Groups any `json:"groups"`
LandmarkLabel any `json:"landmarkLabel"`
}
// The first three link groups of FooterSplit as small columns beside each other.
templ FooterLinkColumns(p FooterLinkColumnsProps) {
{{ vLabel := p.Label }}
{{ vGroups := p.Groups }}
{{ vLandmarkLabel := p.LandmarkLabel }}
if uiutils.Gt(uiutils.Len(vGroups), float64(0)) {
@compose.Block(compose.BlockProps{BoxProps: box.BoxProps{Tag: "nav", Attrs: uiutils.Attrs("aria-label", uiutils.Coalesce(vLandmarkLabel, vLabel), "data-slot", "footer-link-columns")}}) {
@compose.Box(compose.BoxProps{BoxProps: box.BoxProps{Class: "grid grid-cols-2 gap-8 sm:grid-cols-3"}}) {
for vI, vG := range uiutils.L(vGroups) {
if uiutils.Lt(float64(vI), float64(3)) {
@compose.Stack(compose.StackProps{Gap: "2", BoxProps: box.BoxProps{Attrs: uiutils.Attrs("data-slot", "group")}}) {
@compose.Text(compose.TextProps{Size: "sm", Weight: "semibold", TextProps: text.TextProps{}}) {
{ uiutils.Text(uiutils.Get(vG, "title")) }
}
@compose.List(compose.ListProps{BoxProps: box.BoxProps{Class: "m-0 flex list-none flex-col gap-2 p-0"}}) {
for _, vItem := range uiutils.L(uiutils.Get(vG, "links")) {
@compose.ListItem(compose.ListItemProps{BoxProps: box.BoxProps{Attrs: uiutils.Attrs("data-slot", "links-row")}}) {
@MenuEntry(MenuEntryProps{Href: uiutils.Get(vItem, "href"), Class: uiutils.Cnv("text-sm text-muted-foreground"), Variant: "muted", Size: "sm"}) {
{ uiutils.Text(uiutils.Get(vItem, "name")) }
}
}
}
}
}
}
}
}
}
}
}
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 footer-link-columns{#- 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/footer-link-columns.json
The first three link groups of FooterSplit as small columns beside each other.
Props (p): label, groups, landmarkLabel. -#}
{%- set v_label = (p.label ?? null) -%}
{%- set v_groups = (p.groups ?? null) -%}
{%- set v_landmarkLabel = (p.landmarkLabel ?? null) -%}
{%- if og_t(og_gt(og_len(v_groups), 0)) %}
{%- set c_7 -%}
{%- set c_6 -%}
{%- for v_g in og_l(v_groups) %}
{%- set v_i = loop.index0 -%}
{%- if og_t(og_lt(v_i, 3)) %}
{%- set c_5 -%}
{%- set c_1 -%}
{{ og_text(og_get(v_g, ['title'])) }}
{%- endset -%}
{{ include('compose/Text.html.twig', {'size': 'sm', 'weight': 'semibold', 'children': c_1}, with_context = false) }}
{%- set c_4 -%}
{%- for v_item in og_l(og_get(v_g, ['links'])) %}
{%- set c_3 -%}
{%- set c_2 -%}
{{ og_text(og_get(v_item, ['name'])) }}
{%- endset -%}
{{ include('blocks/menu-entry.html.twig', {'p': {'href': og_get(v_item, ['href']), 'className': og_cnv(['text-sm text-muted-foreground']), 'variant': 'muted', 'size': 'sm'}, 'children': og_markup(c_2)}, with_context = false) }}
{%- endset -%}
{{ include('compose/ListItem.html.twig', {'attrs': og_attrs(['data-slot', 'links-row']), 'children': c_3}, with_context = false) }}
{%- endfor %}
{%- endset -%}
{{ include('compose/List.html.twig', {'class': 'm-0 flex list-none flex-col gap-2 p-0', 'children': c_4}, with_context = false) }}
{%- endset -%}
{{ include('compose/Stack.html.twig', {'gap': '2', 'attrs': og_attrs(['data-slot', 'group']), 'children': c_5}, with_context = false) }}
{%- endif %}
{%- endfor %}
{%- endset -%}
{{ include('compose/Box.html.twig', {'class': 'grid grid-cols-2 gap-8 sm:grid-cols-3', 'children': c_6}, with_context = false) }}
{%- endset -%}
{{ include('compose/Block.html.twig', {'tag': 'nav', 'attrs': og_attrs(['aria-label', og_coalesce([v_landmarkLabel, v_label]), 'data-slot', 'footer-link-columns']), 'children': c_7}, with_context = false) }}
{%- endif %}
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 footer-link-columns{* 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/footer-link-columns.json
The first three link groups of FooterSplit as small columns beside each other.
Props (p): label, groups, landmarkLabel. *}
{var $v_label = ($p['label'] ?? null)}
{var $v_groups = ($p['groups'] ?? null)}
{var $v_landmarkLabel = ($p['landmarkLabel'] ?? null)}
{if og_t(og_gt(og_len($v_groups), 0))}
{capture $c_7}
{capture $c_6}
{foreach og_l($v_groups) as $v_g}
{var $v_i = $iterator->counter0}
{if og_t(og_lt($v_i, 3))}
{capture $c_5}
{capture $c_1}
{=og_text(og_get($v_g, ['title']))}
{/capture}
{=og_include('compose/Text.latte', ['size' => 'sm', 'weight' => 'semibold', 'children' => (string) $c_1])|noescape}
{capture $c_4}
{foreach og_l(og_get($v_g, ['links'])) as $v_item}
{capture $c_3}
{capture $c_2}
{=og_text(og_get($v_item, ['name']))}
{/capture}
{=og_include('blocks/menu-entry.latte', ['p' => ['href' => og_get($v_item, ['href']), 'className' => og_cnv(['text-sm text-muted-foreground']), 'variant' => 'muted', 'size' => 'sm'], 'children' => og_markup($c_2)])|noescape}
{/capture}
{=og_include('compose/ListItem.latte', ['attrs' => og_attrs(['data-slot', 'links-row']), 'children' => (string) $c_3])|noescape}
{/foreach}
{/capture}
{=og_include('compose/List.latte', ['class' => 'm-0 flex list-none flex-col gap-2 p-0', 'children' => (string) $c_4])|noescape}
{/capture}
{=og_include('compose/Stack.latte', ['gap' => '2', 'attrs' => og_attrs(['data-slot', 'group']), 'children' => (string) $c_5])|noescape}
{/if}
{/foreach}
{/capture}
{=og_include('compose/Box.latte', ['class' => 'grid grid-cols-2 gap-8 sm:grid-cols-3', 'children' => (string) $c_6])|noescape}
{/capture}
{=og_include('compose/Block.latte', ['tag' => 'nav', 'attrs' => og_attrs(['aria-label', og_coalesce([$v_landmarkLabel, $v_label]), 'data-slot', 'footer-link-columns']), 'children' => (string) $c_7])|noescape}
{/if}
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 footer-link-columns{#- 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/footer-link-columns.json
The first three link groups of FooterSplit as small columns beside each other.
Props (p): label, groups, landmarkLabel. -#}
{%- set v_label = og_def(p['label'], none) -%}
{%- set v_groups = og_def(p['groups'], none) -%}
{%- set v_landmarkLabel = og_def(p['landmarkLabel'], none) -%}
{%- if og_t(og_gt(og_len(v_groups), 0)) %}
{%- set c_7 -%}
{%- set c_6 -%}
{%- for v_g in og_l(v_groups) %}
{%- set v_i = loop.index0 -%}
{%- if og_t(og_lt(v_i, 3)) %}
{%- set c_5 -%}
{%- set c_1 -%}
{{ og_text(og_get(v_g, ['title'])) }}
{%- endset -%}
{{ og_include('compose/text.html.j2', {'p': {'Size': 'sm', 'Weight': 'semibold'}, 'children': c_1}) }}
{%- set c_4 -%}
{%- for v_item in og_l(og_get(v_g, ['links'])) %}
{%- set c_3 -%}
{%- set c_2 -%}
{{ og_text(og_get(v_item, ['name'])) }}
{%- endset -%}
{{ og_include('blocks/menu-entry.html.j2', {'p': {'href': og_get(v_item, ['href']), 'className': og_cnv(['text-sm text-muted-foreground']), 'variant': 'muted', 'size': 'sm'}, 'children': og_markup(c_2)}) }}
{%- endset -%}
{{ og_include('compose/list-item.html.j2', {'p': {'Attrs': og_attrs(['data-slot', 'links-row'])}, 'children': c_3}) }}
{%- endfor %}
{%- endset -%}
{{ og_include('compose/list.html.j2', {'p': {'Class': 'm-0 flex list-none flex-col gap-2 p-0'}, 'children': c_4}) }}
{%- endset -%}
{{ og_include('compose/stack.html.j2', {'p': {'Gap': '2', 'Attrs': og_attrs(['data-slot', 'group'])}, 'children': c_5}) }}
{%- endif %}
{%- endfor %}
{%- endset -%}
{{ og_include('compose/box.html.j2', {'p': {'Class': 'grid grid-cols-2 gap-8 sm:grid-cols-3'}, 'children': c_6}) }}
{%- endset -%}
{{ og_include('compose/block.html.j2', {'p': {'Tag': 'nav', 'Attrs': og_attrs(['aria-label', og_coalesce([v_landmarkLabel, v_label]), 'data-slot', 'footer-link-columns'])}, 'children': c_7}) }}
{%- endif %}
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 first three link groups of FooterSplit as small columns beside each other.
| Prop | Type | Default | Description |
|---|---|---|---|
| label (required) | string | - | accessible name of the link groups |
| groups (required) | MegaGroup[] | - | |
| 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 |