Skip to content
ui8kit

component / components

Quote Figures

Quote Figures component

Install

npx ui8kit add quote-figures

Pulls in: box, compose, kit-box, kit-text, quote-split, stack, testimonial-grid, 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 quote-figures
components/quote-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 above the quotes of QuoteSplit. -->
<script lang="ts" module>
  import type { Snippet } from "svelte";
  import type { QuoteExtras } from "../blocks/quote-split.types";
  import type { QuoteLabels } from "../blocks/testimonial-grid.types";

  export type QuoteFiguresProps = {
    extras: QuoteExtras;
  };
</script>

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

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

<Box class="grid grid-cols-3 gap-4 border-b border-border pb-8" data-slot="quote-figures">
  {#each extras.stats as s, i (s.id)}
    {#if (i < 3)}
      <Stack gap="0" data-slot="quote-stat">
        <Text size="3xl" weight="bold">
          {s.value}
        </Text>
        <Text size="xs" class="text-muted-foreground">
          {s.label}
        </Text>
      </Stack>
    {/if}
  {/each}
</Box>

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 quote-figures
components/quote-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 above the quotes of QuoteSplit. */
import { Fragment, type ReactNode } from "react";
import { Box, Stack, Text } from "../compose";
import type { QuoteExtras } from "../blocks/quote-split.types";
import type { QuoteLabels } from "../blocks/testimonial-grid.types";

export type QuoteFiguresProps = {
  extras: QuoteExtras;
};

export function QuoteFigures({ extras }: QuoteFiguresProps) {
  return (
    <Box className="grid grid-cols-3 gap-4 border-b border-border pb-8" data-slot="quote-figures">
      {(extras.stats ?? []).map((s, i) => (
        <Fragment key={s.id}>
          {(i < 3) ? (
            <Stack gap="0" data-slot="quote-stat">
              <Text size="3xl" weight="bold">
                {s.value}
              </Text>
              <Text size="xs" className="text-muted-foreground">
                {s.label}
              </Text>
            </Stack>
          ) : null}
        </Fragment>
      ))}
    </Box>
  );
}

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 quote-figures
components/quote-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 above the quotes of QuoteSplit. -->
<script lang="ts">
import type { QuoteExtras } from "../blocks/quote-split.types";
import type { QuoteLabels } from "../blocks/testimonial-grid.types";

export type QuoteFiguresProps = {
  extras: QuoteExtras;
};
</script>

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

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

<template>
  <Box class="grid grid-cols-3 gap-4 border-b border-border pb-8" data-slot="quote-figures">
    <template v-for="(s, i) in extras.stats" :key="s.id">
      <Stack v-if="(i < 3)" gap="0" data-slot="quote-stat">
        <Text size="3xl" weight="bold">
          {{ s.value }}
        </Text>
        <Text size="xs" class="text-muted-foreground">
          {{ s.label }}
        </Text>
      </Stack>
    </template>
  </Box>
</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 quote-figures
components/quote-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 above the quotes of QuoteSplit. */
import { For, type JSX } from "solid-js";
import { Box, Stack, Text } from "../compose";
import type { QuoteExtras } from "../blocks/quote-split.types";
import type { QuoteLabels } from "../blocks/testimonial-grid.types";

export type QuoteFiguresProps = {
  extras: QuoteExtras;
};

export function QuoteFigures({ extras }: QuoteFiguresProps) {
  return (
    <Box class="grid grid-cols-3 gap-4 border-b border-border pb-8" data-slot="quote-figures">
      <For each={extras.stats ?? []}>{(s, iOf) => { const i = iOf(); return (
        <>
          {(i < 3) ? (
            <Stack gap="0" data-slot="quote-stat">
              <Text size="3xl" weight="bold">
                {s.value}
              </Text>
              <Text size="xs" class="text-muted-foreground">
                {s.label}
              </Text>
            </Stack>
          ) : null}
        </>
      ); }}</For>
    </Box>
  );
}

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 quote-figures
blocks/quote-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/quote-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"
)

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

// Three figures in a row above the quotes of QuoteSplit.
templ QuoteFigures(p QuoteFiguresProps) {
	{{ vExtras := p.Extras }}
	@compose.Box(compose.BoxProps{BoxProps: box.BoxProps{Class: "grid grid-cols-3 gap-4 border-b border-border pb-8", Attrs: uiutils.Attrs("data-slot", "quote-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", "quote-stat")}}) {
					@compose.Text(compose.TextProps{Size: "3xl", 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 quote-figures
blocks/quote-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/quote-figures.json
    Three figures in a row above the quotes of QuoteSplit.
    Props (p): extras. -#}
{%- set v_extras = (p.extras ?? null) -%}
{%- 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': '3xl', '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', 'quote-stat']), 'children': c_3}, with_context = false) }}
    {%- endif %}
  {%- endfor %}
{%- endset -%}
{{ include('compose/Box.html.twig', {'class': 'grid grid-cols-3 gap-4 border-b border-border pb-8', 'attrs': og_attrs(['data-slot', 'quote-figures']), 'children': c_4}, with_context = false) }}

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 quote-figures
blocks/quote-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/quote-figures.json
    Three figures in a row above the quotes of QuoteSplit.
    Props (p): extras. *}
{var $v_extras = ($p['extras'] ?? null)}
{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' => '3xl', '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', 'quote-stat']), 'children' => (string) $c_3])|noescape}
    {/if}
  {/foreach}
{/capture}
{=og_include('compose/Box.latte', ['class' => 'grid grid-cols-3 gap-4 border-b border-border pb-8', 'attrs' => og_attrs(['data-slot', 'quote-figures']), 'children' => (string) $c_4])|noescape}

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 quote-figures
blocks/quote-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/quote-figures.json
    Three figures in a row above the quotes of QuoteSplit.
    Props (p): extras. -#}
{%- set v_extras = og_def(p['extras'], none) -%}
{%- 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': '3xl', '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', 'quote-stat'])}, 'children': c_3}) }}
    {%- endif %}
  {%- endfor %}
{%- endset -%}
{{ og_include('compose/box.html.j2', {'p': {'Class': 'grid grid-cols-3 gap-4 border-b border-border pb-8', 'Attrs': og_attrs(['data-slot', 'quote-figures'])}, 'children': c_4}) }}

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 above the quotes of QuoteSplit.

Props of QuoteFigures
PropTypeDefault Description
extras (required)QuoteExtras-the figures, logos and rating summary

Used in