Skip to content
ui8kit

component / components

Footer Group Cards

Footer Group Cards component

Install

npx ui8kit add footer-group-cards

Pulls in: block, box, compose, group, inline, kit-box, kit-text, list, list-item, lucide-icon, 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-cdn
npx ui8kit add footer-group-cards
components/footer-group-cards.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 link groups of FooterSplit as cards: a glyph and the group title over its links, four across on wide
  screens.
-->
<script lang="ts" module>
  import type { Snippet } from "svelte";
  import type { MegaGroup } from "../blocks/mega-menu.types";

  export type FooterGroupCardsProps = {
    label: string;
    groups: MegaGroup[];
    landmarkLabel?: string;
  };
</script>

<script lang="ts">
  import Block from "../compose/Block.svelte";
  import Box from "../compose/Box.svelte";
  import Group from "../compose/Group.svelte";
  import Inline from "../compose/Inline.svelte";
  import List from "../compose/List.svelte";
  import ListItem from "../compose/ListItem.svelte";
  import LucideIcon from "../icons/LucideIcon.svelte";
  import Stack from "../compose/Stack.svelte";
  import Text from "../compose/Text.svelte";
  import MenuEntry from "../components/menu-entry.svelte";

  let { label, groups, landmarkLabel }: FooterGroupCardsProps = $props();
</script>

{#if ((groups?.length ?? 0) > 0)}
  <Block tag="nav" aria-label={(landmarkLabel ?? label)} data-slot="footer-group-cards">
    <Box class="grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4">
      {#each groups as g (g.id)}
        <Stack gap="4" align="stretch" class="rounded bg-card inset-ring inset-ring-border p-6" data-slot="group">
          <Group gap="2" align="center">
            <Inline class="flex size-10 shrink-0 items-center justify-center rounded bg-muted text-foreground">
              <LucideIcon name={g.icon} size={20} />
            </Inline>
            <Text size="sm" weight="semibold">
              {g.title}
            </Text>
          </Group>
          <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>
      {/each}
    </Box>
  </Block>
{/if}

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 footer-group-cards
components/footer-group-cards.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 link groups of FooterSplit as cards: a glyph and the group title over its links, four across on wide
 * screens.
 */
import { type ReactNode } from "react";
import { Block, Box, Group, Inline, List, ListItem, Stack, Text } from "../compose";
import { LucideIcon } from "../icons/LucideIcon";
import { MenuEntry } from "../components/menu-entry";
import type { MegaGroup } from "../blocks/mega-menu.types";

export type FooterGroupCardsProps = {
  label: string;
  groups: MegaGroup[];
  landmarkLabel?: string;
};

export function FooterGroupCards({ label, groups, landmarkLabel }: FooterGroupCardsProps) {
  return (
    <>
      {((groups?.length ?? 0) > 0) ? (
        <Block tag="nav" aria-label={(landmarkLabel ?? label)} data-slot="footer-group-cards">
          <Box className="grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4">
            {(groups ?? []).map((g) => (
              <Stack key={g.id} gap="4" align="stretch" className="rounded bg-card inset-ring inset-ring-border p-6" data-slot="group">
                <Group gap="2" align="center">
                  <Inline className="flex size-10 shrink-0 items-center justify-center rounded bg-muted text-foreground">
                    <LucideIcon name={g.icon} size={20} />
                  </Inline>
                  <Text size="sm" weight="semibold">
                    {g.title}
                  </Text>
                </Group>
                <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>
            ))}
          </Box>
        </Block>
      ) : null}
    </>
  );
}

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 footer-group-cards
components/footer-group-cards.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 link groups of FooterSplit as cards: a glyph and the group title over its links, four across on wide
  screens.
-->
<script lang="ts">
import type { MegaGroup } from "../blocks/mega-menu.types";

export type FooterGroupCardsProps = {
  label: string;
  groups: MegaGroup[];
  landmarkLabel?: string;
};
</script>

<script setup lang="ts">
import Block from "../compose/Block.vue";
import Box from "../compose/Box.vue";
import Group from "../compose/Group.vue";
import Inline from "../compose/Inline.vue";
import List from "../compose/List.vue";
import ListItem from "../compose/ListItem.vue";
import LucideIcon from "../icons/LucideIcon.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<FooterGroupCardsProps>();
</script>

<template>
  <Block
    v-if="((groups?.length ?? 0) > 0)"
    tag="nav"
    :aria-label="(landmarkLabel ?? label)"
    data-slot="footer-group-cards"
  >
    <Box class="grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4">
      <Stack
        v-for="g in groups"
        :key="g.id"
        gap="4"
        align="stretch"
        class="rounded bg-card inset-ring inset-ring-border p-6"
        data-slot="group"
      >
        <Group gap="2" align="center">
          <Inline class="flex size-10 shrink-0 items-center justify-center rounded bg-muted text-foreground">
            <LucideIcon :name="g.icon" :size="20" />
          </Inline>
          <Text size="sm" weight="semibold">
            {{ g.title }}
          </Text>
        </Group>
        <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>
    </Box>
  </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 footer-group-cards
components/footer-group-cards.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 link groups of FooterSplit as cards: a glyph and the group title over its links, four across on wide
 * screens.
 */
import { For, type JSX } from "solid-js";
import { Block, Box, Group, Inline, List, ListItem, Stack, Text } from "../compose";
import { LucideIcon } from "../icons/LucideIcon";
import { MenuEntry } from "../components/menu-entry";
import type { MegaGroup } from "../blocks/mega-menu.types";

export type FooterGroupCardsProps = {
  label: string;
  groups: MegaGroup[];
  landmarkLabel?: string;
};

export function FooterGroupCards({ label, groups, landmarkLabel }: FooterGroupCardsProps) {
  return (
    <>
      {((groups?.length ?? 0) > 0) ? (
        <Block tag="nav" aria-label={(landmarkLabel ?? label)} data-slot="footer-group-cards">
          <Box class="grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4">
            <For each={groups ?? []}>{(g) => (
              <Stack gap="4" align="stretch" class="rounded bg-card inset-ring inset-ring-border p-6" data-slot="group">
                <Group gap="2" align="center">
                  <Inline class="flex size-10 shrink-0 items-center justify-center rounded bg-muted text-foreground">
                    <LucideIcon name={g.icon} size={20} />
                  </Inline>
                  <Text size="sm" weight="semibold">
                    {g.title}
                  </Text>
                </Group>
                <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>
            )}</For>
          </Box>
        </Block>
      ) : null}
    </>
  );
}

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 footer-group-cards
blocks/footer-group-cards.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/footer-group-cards.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/icons"
	"github.com/ui8kit/codegen/generated/templ/ui/text"
	uiutils "github.com/ui8kit/codegen/generated/templ/orgutils"
)

// FooterGroupCardsProps are the props of FooterGroupCards; the values are the JSON shapes of the TypeScript props.
type FooterGroupCardsProps struct {
	Label any `json:"label"`
	Groups any `json:"groups"`
	LandmarkLabel any `json:"landmarkLabel"`
}

// The link groups of FooterSplit as cards: a glyph and the group title over its links, four across on wide screens.
templ FooterGroupCards(p FooterGroupCardsProps) {
	{{ 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-group-cards")}}) {
			@compose.Box(compose.BoxProps{BoxProps: box.BoxProps{Class: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4"}}) {
				for _, vG := range uiutils.L(vGroups) {
					@compose.Stack(compose.StackProps{Gap: "4", Align: "stretch", BoxProps: box.BoxProps{Class: "rounded bg-card inset-ring inset-ring-border p-6", Attrs: uiutils.Attrs("data-slot", "group")}}) {
						@compose.Group(compose.GroupProps{Gap: "2", Align: "center", BoxProps: box.BoxProps{}}) {
							@compose.Inline(compose.InlineProps{TextProps: text.TextProps{Class: "flex size-10 shrink-0 items-center justify-center rounded bg-muted text-foreground"}}) {
								@icons.LucideIcon(icons.LucideIconProps{Name: uiutils.S(uiutils.Get(vG, "icon")), Size: 20})
							}
							@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")) }
									}
								}
							}
						}
					}
				}
			}
		}
	}
}

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 footer-group-cards
blocks/footer-group-cards.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/footer-group-cards.json
    The link groups of FooterSplit as cards: a glyph and the group title over its links, four across on wide screens.
    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_9 -%}
    {%- set c_8 -%}
      {%- for v_g in og_l(v_groups) %}
        {%- set c_7 -%}
          {%- set c_3 -%}
            {%- set c_1 -%}
              {{ include('icons/LucideIcon.html.twig', {'name': og_s(og_get(v_g, ['icon'])), 'size': 20}, with_context = false) }}
            {%- endset -%}
            {{ include('compose/Inline.html.twig', {'class': 'flex size-10 shrink-0 items-center justify-center rounded bg-muted text-foreground', 'children': c_1}, with_context = false) }}
            {%- set c_2 -%}
              {{ og_text(og_get(v_g, ['title'])) }}
            {%- endset -%}
            {{ include('compose/Text.html.twig', {'size': 'sm', 'weight': 'semibold', 'children': c_2}, with_context = false) }}
          {%- endset -%}
          {{ include('compose/Group.html.twig', {'gap': '2', 'align': 'center', 'children': c_3}, with_context = false) }}
          {%- set c_6 -%}
            {%- for v_item in og_l(og_get(v_g, ['links'])) %}
              {%- set c_5 -%}
                {%- set c_4 -%}
                  {{ 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_4)}, with_context = false) }}
              {%- endset -%}
              {{ include('compose/ListItem.html.twig', {'attrs': og_attrs(['data-slot', 'links-row']), 'children': c_5}, with_context = false) }}
            {%- endfor %}
          {%- endset -%}
          {{ include('compose/List.html.twig', {'class': 'm-0 flex list-none flex-col gap-2 p-0', 'children': c_6}, with_context = false) }}
        {%- endset -%}
        {{ include('compose/Stack.html.twig', {'gap': '4', 'align': 'stretch', 'class': 'rounded bg-card inset-ring inset-ring-border p-6', 'attrs': og_attrs(['data-slot', 'group']), 'children': c_7}, with_context = false) }}
      {%- endfor %}
    {%- endset -%}
    {{ include('compose/Box.html.twig', {'class': 'grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4', 'children': c_8}, 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-group-cards']), 'children': c_9}, with_context = false) }}
{%- endif %}

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 footer-group-cards
blocks/footer-group-cards.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/footer-group-cards.json
    The link groups of FooterSplit as cards: a glyph and the group title over its links, four across on wide screens.
    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_9}
    {capture $c_8}
      {foreach og_l($v_groups) as $v_g}
        {capture $c_7}
          {capture $c_3}
            {capture $c_1}
              {=og_include('icons/LucideIcon.latte', ['name' => og_s(og_get($v_g, ['icon'])), 'size' => 20])|noescape}
            {/capture}
            {=og_include('compose/Inline.latte', ['class' => 'flex size-10 shrink-0 items-center justify-center rounded bg-muted text-foreground', 'children' => (string) $c_1])|noescape}
            {capture $c_2}
              {=og_text(og_get($v_g, ['title']))}
            {/capture}
            {=og_include('compose/Text.latte', ['size' => 'sm', 'weight' => 'semibold', 'children' => (string) $c_2])|noescape}
          {/capture}
          {=og_include('compose/Group.latte', ['gap' => '2', 'align' => 'center', 'children' => (string) $c_3])|noescape}
          {capture $c_6}
            {foreach og_l(og_get($v_g, ['links'])) as $v_item}
              {capture $c_5}
                {capture $c_4}
                  {=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_4)])|noescape}
              {/capture}
              {=og_include('compose/ListItem.latte', ['attrs' => og_attrs(['data-slot', 'links-row']), 'children' => (string) $c_5])|noescape}
            {/foreach}
          {/capture}
          {=og_include('compose/List.latte', ['class' => 'm-0 flex list-none flex-col gap-2 p-0', 'children' => (string) $c_6])|noescape}
        {/capture}
        {=og_include('compose/Stack.latte', ['gap' => '4', 'align' => 'stretch', 'class' => 'rounded bg-card inset-ring inset-ring-border p-6', 'attrs' => og_attrs(['data-slot', 'group']), 'children' => (string) $c_7])|noescape}
      {/foreach}
    {/capture}
    {=og_include('compose/Box.latte', ['class' => 'grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4', 'children' => (string) $c_8])|noescape}
  {/capture}
  {=og_include('compose/Block.latte', ['tag' => 'nav', 'attrs' => og_attrs(['aria-label', og_coalesce([$v_landmarkLabel, $v_label]), 'data-slot', 'footer-group-cards']), 'children' => (string) $c_9])|noescape}
{/if}

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 footer-group-cards
blocks/footer-group-cards.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/footer-group-cards.json
    The link groups of FooterSplit as cards: a glyph and the group title over its links, four across on wide screens.
    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_9 -%}
    {%- set c_8 -%}
      {%- for v_g in og_l(v_groups) %}
        {%- set c_7 -%}
          {%- set c_3 -%}
            {%- set c_1 -%}
              {{ og_include('icons/lucide-icon.html.j2', {'p': {'Name': og_s(og_get(v_g, ['icon'])), 'Size': 20}}) }}
            {%- endset -%}
            {{ og_include('compose/inline.html.j2', {'p': {'Class': 'flex size-10 shrink-0 items-center justify-center rounded bg-muted text-foreground'}, 'children': c_1}) }}
            {%- set c_2 -%}
              {{ og_text(og_get(v_g, ['title'])) }}
            {%- endset -%}
            {{ og_include('compose/text.html.j2', {'p': {'Size': 'sm', 'Weight': 'semibold'}, 'children': c_2}) }}
          {%- endset -%}
          {{ og_include('compose/group.html.j2', {'p': {'Gap': '2', 'Align': 'center'}, 'children': c_3}) }}
          {%- set c_6 -%}
            {%- for v_item in og_l(og_get(v_g, ['links'])) %}
              {%- set c_5 -%}
                {%- set c_4 -%}
                  {{ 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_4)}) }}
              {%- endset -%}
              {{ og_include('compose/list-item.html.j2', {'p': {'Attrs': og_attrs(['data-slot', 'links-row'])}, 'children': c_5}) }}
            {%- endfor %}
          {%- endset -%}
          {{ og_include('compose/list.html.j2', {'p': {'Class': 'm-0 flex list-none flex-col gap-2 p-0'}, 'children': c_6}) }}
        {%- endset -%}
        {{ og_include('compose/stack.html.j2', {'p': {'Gap': '4', 'Align': 'stretch', 'Class': 'rounded bg-card inset-ring inset-ring-border p-6', 'Attrs': og_attrs(['data-slot', 'group'])}, 'children': c_7}) }}
      {%- endfor %}
    {%- endset -%}
    {{ og_include('compose/box.html.j2', {'p': {'Class': 'grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4'}, 'children': c_8}) }}
  {%- endset -%}
  {{ og_include('compose/block.html.j2', {'p': {'Tag': 'nav', 'Attrs': og_attrs(['aria-label', og_coalesce([v_landmarkLabel, v_label]), 'data-slot', 'footer-group-cards'])}, 'children': c_9}) }}
{%- endif %}

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 link groups of FooterSplit as cards: a glyph and the group title over its links, four across on wide screens.

Props of FooterGroupCards
PropTypeDefault 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

Used in