Footer Channels
Footer Channels component
Install
npx ui8kit add footer-channelsPulls in: box, compose, footer-split, inline, kit-box, kit-text, lucide-icon, stack, text, utils
Preview
Community forum
Ask and answer questions
Video lessons
Short walkthroughs every week
Group chat
Talk with other builders
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-channels<!-- 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 channels of the community as three cards: a glyph over the name and one line. -->
<script lang="ts" module>
import type { Snippet } from "svelte";
import type { FooterExtras, FooterSplitLabels } from "../blocks/footer-split.types";
export type FooterChannelsProps = {
extras: FooterExtras;
};
</script>
<script lang="ts">
import Box from "../compose/Box.svelte";
import Inline from "../compose/Inline.svelte";
import LucideIcon from "../icons/LucideIcon.svelte";
import Stack from "../compose/Stack.svelte";
import Text from "../compose/Text.svelte";
let { extras }: FooterChannelsProps = $props();
</script>
{#if ((extras.channels?.length ?? 0) > 0)}
<Box class="grid grid-cols-1 gap-4 sm:grid-cols-3" data-slot="footer-channels">
{#each extras.channels as c, i (c.id)}
{#if (i < 3)}
<Stack
gap="2"
align="start"
class="rounded bg-card inset-ring inset-ring-border p-4"
data-slot="footer-channel"
>
<Inline class="flex size-10 shrink-0 items-center justify-center rounded bg-muted text-foreground">
<LucideIcon name={c.icon} size={20} />
</Inline>
<Text size="sm" weight="semibold">
{c.title}
</Text>
<Text size="xs" class="text-muted-foreground">
{c.text}
</Text>
</Stack>
{/if}
{/each}
</Box>
{/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-channels// 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 channels of the community as three cards: a glyph over the name and one line. */
import { Fragment, type ReactNode } from "react";
import { Box, Inline, Stack, Text } from "../compose";
import { LucideIcon } from "../icons/LucideIcon";
import type { FooterExtras, FooterSplitLabels } from "../blocks/footer-split.types";
export type FooterChannelsProps = {
extras: FooterExtras;
};
export function FooterChannels({ extras }: FooterChannelsProps) {
return (
<>
{((extras.channels?.length ?? 0) > 0) ? (
<Box className="grid grid-cols-1 gap-4 sm:grid-cols-3" data-slot="footer-channels">
{(extras.channels ?? []).map((c, i) => (
<Fragment key={c.id}>
{(i < 3) ? (
<Stack
gap="2"
align="start"
className="rounded bg-card inset-ring inset-ring-border p-4"
data-slot="footer-channel"
>
<Inline className="flex size-10 shrink-0 items-center justify-center rounded bg-muted text-foreground">
<LucideIcon name={c.icon} size={20} />
</Inline>
<Text size="sm" weight="semibold">
{c.title}
</Text>
<Text size="xs" className="text-muted-foreground">
{c.text}
</Text>
</Stack>
) : null}
</Fragment>
))}
</Box>
) : 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-channels<!-- 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 channels of the community as three cards: a glyph over the name and one line. -->
<script lang="ts">
import type { FooterExtras, FooterSplitLabels } from "../blocks/footer-split.types";
export type FooterChannelsProps = {
extras: FooterExtras;
};
</script>
<script setup lang="ts">
import Box from "../compose/Box.vue";
import Inline from "../compose/Inline.vue";
import LucideIcon from "../icons/LucideIcon.vue";
import Stack from "../compose/Stack.vue";
import Text from "../compose/Text.vue";
const { extras } = defineProps<FooterChannelsProps>();
</script>
<template>
<Box
v-if="((extras.channels?.length ?? 0) > 0)"
class="grid grid-cols-1 gap-4 sm:grid-cols-3"
data-slot="footer-channels"
>
<template v-for="(c, i) in extras.channels" :key="c.id">
<Stack v-if="(i < 3)"
gap="2"
align="start"
class="rounded bg-card inset-ring inset-ring-border p-4"
data-slot="footer-channel"
>
<Inline class="flex size-10 shrink-0 items-center justify-center rounded bg-muted text-foreground">
<LucideIcon :name="c.icon" :size="20" />
</Inline>
<Text size="sm" weight="semibold">
{{ c.title }}
</Text>
<Text size="xs" class="text-muted-foreground">
{{ c.text }}
</Text>
</Stack>
</template>
</Box>
</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-channels// 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 channels of the community as three cards: a glyph over the name and one line. */
import { For, type JSX } from "solid-js";
import { Box, Inline, Stack, Text } from "../compose";
import { LucideIcon } from "../icons/LucideIcon";
import type { FooterExtras, FooterSplitLabels } from "../blocks/footer-split.types";
export type FooterChannelsProps = {
extras: FooterExtras;
};
export function FooterChannels({ extras }: FooterChannelsProps) {
return (
<>
{((extras.channels?.length ?? 0) > 0) ? (
<Box class="grid grid-cols-1 gap-4 sm:grid-cols-3" data-slot="footer-channels">
<For each={extras.channels ?? []}>{(c, iOf) => { const i = iOf(); return (
<>
{(i < 3) ? (
<Stack
gap="2"
align="start"
class="rounded bg-card inset-ring inset-ring-border p-4"
data-slot="footer-channel"
>
<Inline class="flex size-10 shrink-0 items-center justify-center rounded bg-muted text-foreground">
<LucideIcon name={c.icon} size={20} />
</Inline>
<Text size="sm" weight="semibold">
{c.title}
</Text>
<Text size="xs" class="text-muted-foreground">
{c.text}
</Text>
</Stack>
) : null}
</>
); }}</For>
</Box>
) : 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-channels// 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-channels.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"
)
// FooterChannelsProps are the props of FooterChannels; the values are the JSON shapes of the TypeScript props.
type FooterChannelsProps struct {
Extras any `json:"extras"`
}
// The channels of the community as three cards: a glyph over the name and one line.
templ FooterChannels(p FooterChannelsProps) {
{{ vExtras := p.Extras }}
if uiutils.Gt(uiutils.Len(uiutils.Get(vExtras, "channels")), float64(0)) {
@compose.Box(compose.BoxProps{BoxProps: box.BoxProps{Class: "grid grid-cols-1 gap-4 sm:grid-cols-3", Attrs: uiutils.Attrs("data-slot", "footer-channels")}}) {
for vI, vC := range uiutils.L(uiutils.Get(vExtras, "channels")) {
if uiutils.Lt(float64(vI), float64(3)) {
@compose.Stack(compose.StackProps{Gap: "2", Align: "start", BoxProps: box.BoxProps{Class: "rounded bg-card inset-ring inset-ring-border p-4", Attrs: uiutils.Attrs("data-slot", "footer-channel")}}) {
@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(vC, "icon")), Size: 20})
}
@compose.Text(compose.TextProps{Size: "sm", Weight: "semibold", TextProps: text.TextProps{}}) {
{ uiutils.Text(uiutils.Get(vC, "title")) }
}
@compose.Text(compose.TextProps{Size: "xs", TextProps: text.TextProps{Class: "text-muted-foreground"}}) {
{ uiutils.Text(uiutils.Get(vC, "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 footer-channels{#- 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-channels.json
The channels of the community as three cards: a glyph over the name and one line.
Props (p): extras. -#}
{%- set v_extras = (p.extras ?? null) -%}
{%- if og_t(og_gt(og_len(og_get(v_extras, ['channels'])), 0)) %}
{%- set c_5 -%}
{%- for v_c in og_l(og_get(v_extras, ['channels'])) %}
{%- set v_i = loop.index0 -%}
{%- if og_t(og_lt(v_i, 3)) %}
{%- set c_4 -%}
{%- set c_1 -%}
{{ include('icons/LucideIcon.html.twig', {'name': og_s(og_get(v_c, ['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_c, ['title'])) }}
{%- endset -%}
{{ include('compose/Text.html.twig', {'size': 'sm', 'weight': 'semibold', 'children': c_2}, with_context = false) }}
{%- set c_3 -%}
{{ og_text(og_get(v_c, ['text'])) }}
{%- endset -%}
{{ include('compose/Text.html.twig', {'size': 'xs', 'class': 'text-muted-foreground', 'children': c_3}, with_context = false) }}
{%- endset -%}
{{ include('compose/Stack.html.twig', {'gap': '2', 'align': 'start', 'class': 'rounded bg-card inset-ring inset-ring-border p-4', 'attrs': og_attrs(['data-slot', 'footer-channel']), 'children': c_4}, with_context = false) }}
{%- endif %}
{%- endfor %}
{%- endset -%}
{{ include('compose/Box.html.twig', {'class': 'grid grid-cols-1 gap-4 sm:grid-cols-3', 'attrs': og_attrs(['data-slot', 'footer-channels']), 'children': c_5}, 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-channels{* 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-channels.json
The channels of the community as three cards: a glyph over the name and one line.
Props (p): extras. *}
{var $v_extras = ($p['extras'] ?? null)}
{if og_t(og_gt(og_len(og_get($v_extras, ['channels'])), 0))}
{capture $c_5}
{foreach og_l(og_get($v_extras, ['channels'])) as $v_c}
{var $v_i = $iterator->counter0}
{if og_t(og_lt($v_i, 3))}
{capture $c_4}
{capture $c_1}
{=og_include('icons/LucideIcon.latte', ['name' => og_s(og_get($v_c, ['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_c, ['title']))}
{/capture}
{=og_include('compose/Text.latte', ['size' => 'sm', 'weight' => 'semibold', 'children' => (string) $c_2])|noescape}
{capture $c_3}
{=og_text(og_get($v_c, ['text']))}
{/capture}
{=og_include('compose/Text.latte', ['size' => 'xs', 'class' => 'text-muted-foreground', 'children' => (string) $c_3])|noescape}
{/capture}
{=og_include('compose/Stack.latte', ['gap' => '2', 'align' => 'start', 'class' => 'rounded bg-card inset-ring inset-ring-border p-4', 'attrs' => og_attrs(['data-slot', 'footer-channel']), 'children' => (string) $c_4])|noescape}
{/if}
{/foreach}
{/capture}
{=og_include('compose/Box.latte', ['class' => 'grid grid-cols-1 gap-4 sm:grid-cols-3', 'attrs' => og_attrs(['data-slot', 'footer-channels']), 'children' => (string) $c_5])|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-channels{#- 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-channels.json
The channels of the community as three cards: a glyph over the name and one line.
Props (p): extras. -#}
{%- set v_extras = og_def(p['extras'], none) -%}
{%- if og_t(og_gt(og_len(og_get(v_extras, ['channels'])), 0)) %}
{%- set c_5 -%}
{%- for v_c in og_l(og_get(v_extras, ['channels'])) %}
{%- set v_i = loop.index0 -%}
{%- if og_t(og_lt(v_i, 3)) %}
{%- set c_4 -%}
{%- set c_1 -%}
{{ og_include('icons/lucide-icon.html.j2', {'p': {'Name': og_s(og_get(v_c, ['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_c, ['title'])) }}
{%- endset -%}
{{ og_include('compose/text.html.j2', {'p': {'Size': 'sm', 'Weight': 'semibold'}, 'children': c_2}) }}
{%- set c_3 -%}
{{ og_text(og_get(v_c, ['text'])) }}
{%- endset -%}
{{ og_include('compose/text.html.j2', {'p': {'Size': 'xs', 'Class': 'text-muted-foreground'}, 'children': c_3}) }}
{%- endset -%}
{{ og_include('compose/stack.html.j2', {'p': {'Gap': '2', 'Align': 'start', 'Class': 'rounded bg-card inset-ring inset-ring-border p-4', 'Attrs': og_attrs(['data-slot', 'footer-channel'])}, 'children': c_4}) }}
{%- endif %}
{%- endfor %}
{%- endset -%}
{{ og_include('compose/box.html.j2', {'p': {'Class': 'grid grid-cols-1 gap-4 sm:grid-cols-3', 'Attrs': og_attrs(['data-slot', 'footer-channels'])}, 'children': c_5}) }}
{%- 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 channels of the community as three cards: a glyph over the name and one line.
| Prop | Type | Default | Description |
|---|---|---|---|
| extras (required) | FooterExtras | - | the figures, points, contacts and channels |