Skip to content
ui8kit

component / components

Footer Figures

Footer Figures component

Install

npx ui8kit add footer-figures

Pulls in: compose, footer-split, group, kit-box, kit-text, stack, text, utils

Preview

12,400

Sites published

99.99%

Uptime

3,200

Teams

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-figures
components/footer-figures.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. -->
<!-- Three figures in a row under the brand of FooterSplit. -->
<script lang="ts" module>
  import type { Snippet } from "svelte";
  import type { FooterExtras, FooterSplitLabels } from "../blocks/footer-split.types";

  export type FooterFiguresProps = {
    extras: FooterExtras;
  };
</script>

<script lang="ts">
  import Group from "../compose/Group.svelte";
  import Stack from "../compose/Stack.svelte";
  import Text from "../compose/Text.svelte";

  let { extras }: FooterFiguresProps = $props();
</script>

{#if ((extras.stats?.length ?? 0) > 0)}
  <Group gap="8" class="flex-wrap" data-slot="footer-figures">
    {#each extras.stats as s, i (s.id)}
      {#if (i < 3)}
        <Stack gap="0" data-slot="footer-stat">
          <Text size="xl" weight="bold">
            {s.value}
          </Text>
          <Text size="xs" class="text-muted-foreground">
            {s.label}
          </Text>
        </Stack>
      {/if}
    {/each}
  </Group>
{/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-figures
components/footer-figures.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.
/** Three figures in a row under the brand of FooterSplit. */
import { Fragment, type ReactNode } from "react";
import { Group, Stack, Text } from "../compose";
import type { FooterExtras, FooterSplitLabels } from "../blocks/footer-split.types";

export type FooterFiguresProps = {
  extras: FooterExtras;
};

export function FooterFigures({ extras }: FooterFiguresProps) {
  return (
    <>
      {((extras.stats?.length ?? 0) > 0) ? (
        <Group gap="8" className="flex-wrap" data-slot="footer-figures">
          {(extras.stats ?? []).map((s, i) => (
            <Fragment key={s.id}>
              {(i < 3) ? (
                <Stack gap="0" data-slot="footer-stat">
                  <Text size="xl" weight="bold">
                    {s.value}
                  </Text>
                  <Text size="xs" className="text-muted-foreground">
                    {s.label}
                  </Text>
                </Stack>
              ) : null}
            </Fragment>
          ))}
        </Group>
      ) : 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-figures
components/footer-figures.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. -->
<!-- Three figures in a row under the brand of FooterSplit. -->
<script lang="ts">
import type { FooterExtras, FooterSplitLabels } from "../blocks/footer-split.types";

export type FooterFiguresProps = {
  extras: FooterExtras;
};
</script>

<script setup lang="ts">
import Group from "../compose/Group.vue";
import Stack from "../compose/Stack.vue";
import Text from "../compose/Text.vue";

const { extras } = defineProps<FooterFiguresProps>();
</script>

<template>
  <Group v-if="((extras.stats?.length ?? 0) > 0)" gap="8" class="flex-wrap" data-slot="footer-figures">
    <template v-for="(s, i) in extras.stats" :key="s.id">
      <Stack v-if="(i < 3)" gap="0" data-slot="footer-stat">
        <Text size="xl" weight="bold">
          {{ s.value }}
        </Text>
        <Text size="xs" class="text-muted-foreground">
          {{ s.label }}
        </Text>
      </Stack>
    </template>
  </Group>
</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-figures
components/footer-figures.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.
/** Three figures in a row under the brand of FooterSplit. */
import { For, type JSX } from "solid-js";
import { Group, Stack, Text } from "../compose";
import type { FooterExtras, FooterSplitLabels } from "../blocks/footer-split.types";

export type FooterFiguresProps = {
  extras: FooterExtras;
};

export function FooterFigures({ extras }: FooterFiguresProps) {
  return (
    <>
      {((extras.stats?.length ?? 0) > 0) ? (
        <Group gap="8" class="flex-wrap" data-slot="footer-figures">
          <For each={extras.stats ?? []}>{(s, iOf) => { const i = iOf(); return (
            <>
              {(i < 3) ? (
                <Stack gap="0" data-slot="footer-stat">
                  <Text size="xl" weight="bold">
                    {s.value}
                  </Text>
                  <Text size="xs" class="text-muted-foreground">
                    {s.label}
                  </Text>
                </Stack>
              ) : null}
            </>
          ); }}</For>
        </Group>
      ) : 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-figures
blocks/footer-figures.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-figures.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"
)

// FooterFiguresProps are the props of FooterFigures; the values are the JSON shapes of the TypeScript props.
type FooterFiguresProps struct {
	Extras any `json:"extras"`
}

// Three figures in a row under the brand of FooterSplit.
templ FooterFigures(p FooterFiguresProps) {
	{{ vExtras := p.Extras }}
	if uiutils.Gt(uiutils.Len(uiutils.Get(vExtras, "stats")), float64(0)) {
		@compose.Group(compose.GroupProps{Gap: "8", BoxProps: box.BoxProps{Class: "flex-wrap", Attrs: uiutils.Attrs("data-slot", "footer-figures")}}) {
			for vI, vS := range uiutils.L(uiutils.Get(vExtras, "stats")) {
				if uiutils.Lt(float64(vI), float64(3)) {
					@compose.Stack(compose.StackProps{Gap: "0", BoxProps: box.BoxProps{Attrs: uiutils.Attrs("data-slot", "footer-stat")}}) {
						@compose.Text(compose.TextProps{Size: "xl", Weight: "bold", TextProps: text.TextProps{}}) {
							{ uiutils.Text(uiutils.Get(vS, "value")) }
						}
						@compose.Text(compose.TextProps{Size: "xs", TextProps: text.TextProps{Class: "text-muted-foreground"}}) {
							{ uiutils.Text(uiutils.Get(vS, "label")) }
						}
					}
				}
			}
		}
	}
}

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-figures
blocks/footer-figures.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-figures.json
    Three figures in a row under the brand of FooterSplit.
    Props (p): extras. -#}
{%- set v_extras = (p.extras ?? null) -%}
{%- if og_t(og_gt(og_len(og_get(v_extras, ['stats'])), 0)) %}
  {%- set c_4 -%}
    {%- for v_s in og_l(og_get(v_extras, ['stats'])) %}
      {%- set v_i = loop.index0 -%}
      {%- if og_t(og_lt(v_i, 3)) %}
        {%- set c_3 -%}
          {%- set c_1 -%}
            {{ og_text(og_get(v_s, ['value'])) }}
          {%- endset -%}
          {{ include('compose/Text.html.twig', {'size': 'xl', 'weight': 'bold', 'children': c_1}, with_context = false) }}
          {%- set c_2 -%}
            {{ og_text(og_get(v_s, ['label'])) }}
          {%- endset -%}
          {{ include('compose/Text.html.twig', {'size': 'xs', 'class': 'text-muted-foreground', 'children': c_2}, with_context = false) }}
        {%- endset -%}
        {{ include('compose/Stack.html.twig', {'gap': '0', 'attrs': og_attrs(['data-slot', 'footer-stat']), 'children': c_3}, with_context = false) }}
      {%- endif %}
    {%- endfor %}
  {%- endset -%}
  {{ include('compose/Group.html.twig', {'gap': '8', 'class': 'flex-wrap', 'attrs': og_attrs(['data-slot', 'footer-figures']), 'children': c_4}, 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-figures
blocks/footer-figures.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-figures.json
    Three figures in a row under the brand of FooterSplit.
    Props (p): extras. *}
{var $v_extras = ($p['extras'] ?? null)}
{if og_t(og_gt(og_len(og_get($v_extras, ['stats'])), 0))}
  {capture $c_4}
    {foreach og_l(og_get($v_extras, ['stats'])) as $v_s}
      {var $v_i = $iterator->counter0}
      {if og_t(og_lt($v_i, 3))}
        {capture $c_3}
          {capture $c_1}
            {=og_text(og_get($v_s, ['value']))}
          {/capture}
          {=og_include('compose/Text.latte', ['size' => 'xl', 'weight' => 'bold', 'children' => (string) $c_1])|noescape}
          {capture $c_2}
            {=og_text(og_get($v_s, ['label']))}
          {/capture}
          {=og_include('compose/Text.latte', ['size' => 'xs', 'class' => 'text-muted-foreground', 'children' => (string) $c_2])|noescape}
        {/capture}
        {=og_include('compose/Stack.latte', ['gap' => '0', 'attrs' => og_attrs(['data-slot', 'footer-stat']), 'children' => (string) $c_3])|noescape}
      {/if}
    {/foreach}
  {/capture}
  {=og_include('compose/Group.latte', ['gap' => '8', 'class' => 'flex-wrap', 'attrs' => og_attrs(['data-slot', 'footer-figures']), 'children' => (string) $c_4])|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-figures
blocks/footer-figures.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-figures.json
    Three figures in a row under the brand of FooterSplit.
    Props (p): extras. -#}
{%- set v_extras = og_def(p['extras'], none) -%}
{%- if og_t(og_gt(og_len(og_get(v_extras, ['stats'])), 0)) %}
  {%- set c_4 -%}
    {%- for v_s in og_l(og_get(v_extras, ['stats'])) %}
      {%- set v_i = loop.index0 -%}
      {%- if og_t(og_lt(v_i, 3)) %}
        {%- set c_3 -%}
          {%- set c_1 -%}
            {{ og_text(og_get(v_s, ['value'])) }}
          {%- endset -%}
          {{ og_include('compose/text.html.j2', {'p': {'Size': 'xl', 'Weight': 'bold'}, 'children': c_1}) }}
          {%- set c_2 -%}
            {{ og_text(og_get(v_s, ['label'])) }}
          {%- endset -%}
          {{ og_include('compose/text.html.j2', {'p': {'Size': 'xs', 'Class': 'text-muted-foreground'}, 'children': c_2}) }}
        {%- endset -%}
        {{ og_include('compose/stack.html.j2', {'p': {'Gap': '0', 'Attrs': og_attrs(['data-slot', 'footer-stat'])}, 'children': c_3}) }}
      {%- endif %}
    {%- endfor %}
  {%- endset -%}
  {{ og_include('compose/group.html.j2', {'p': {'Gap': '8', 'Class': 'flex-wrap', 'Attrs': og_attrs(['data-slot', 'footer-figures'])}, 'children': c_4}) }}
{%- 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.

Three figures in a row under the brand of FooterSplit.

Props of FooterFigures
PropTypeDefault Description
extras (required)FooterExtras-the figures, points, contacts and channels

Used in