Skip to content
ui8kit

component / components

Stat Tile

Stat Tile component

Install

npx ui8kit add stat-tile

Pulls in: box, compose, icon-badge, kit-box, kit-link, kit-text, link, lucide-icon, text, utils

Preview

Revenue

$48,200

+8% this month

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 stat-tile
components/stat-tile.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. -->
<!--
  A dashboard counter: an icon, a big number, a caption. With `href` the whole tile is a link, without it the
  tile is a plain figure.
-->
<script lang="ts" module>
  import type { Snippet } from "svelte";

  export type StatTileProps = {
    label: string;
    value: string | number;
    icon: string;
    href?: string;
    hint?: string;
  };
</script>

<script lang="ts">
  import Box from "../compose/Box.svelte";
  import IconBadge from "../compose/IconBadge.svelte";
  import Link from "../compose/Link.svelte";
  import LucideIcon from "../icons/LucideIcon.svelte";
  import Text from "../compose/Text.svelte";
  import { urlOf } from "../utils";

  let { label, value, icon, href, hint }: StatTileProps = $props();
</script>

<Box class="min-w-0" data-slot="stat-tile">
  {#if href}
    <Link
      href={urlOf(href)}
      variant="block"
      class={"flex min-w-0 flex-col gap-4 rounded bg-card p-6 text-foreground no-underline inset-ring inset-ring-border " +
        "hover:bg-muted"}
    >
      <Box class="flex items-center justify-between gap-2">
        <Text class="m-0 text-xs font-bold text-muted-foreground">
          {label}
        </Text>
        <IconBadge size="sm">
          <LucideIcon name={icon} size={16} />
        </IconBadge>
      </Box>
      <Text size="2xl" weight="bold" class="m-0 leading-8">
        {value}
      </Text>
      {#if hint}
        <Text class="m-0 text-xs font-medium text-muted-foreground">
          {hint}
        </Text>
      {/if}
    </Link>
  {:else}
    <Box class="flex min-w-0 flex-col gap-4 rounded bg-card p-6 text-foreground inset-ring inset-ring-border">
      <Box class="flex items-center justify-between gap-2">
        <Text class="m-0 text-xs font-bold text-muted-foreground">
          {label}
        </Text>
        <IconBadge size="sm">
          <LucideIcon name={icon} size={16} />
        </IconBadge>
      </Box>
      <Text size="2xl" weight="bold" class="m-0 leading-8">
        {value}
      </Text>
      {#if hint}
        <Text class="m-0 text-xs font-medium text-muted-foreground">
          {hint}
        </Text>
      {/if}
    </Box>
  {/if}
</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 stat-tile
components/stat-tile.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.
/**
 * A dashboard counter: an icon, a big number, a caption. With `href` the whole tile is a link, without it the
 * tile is a plain figure.
 */
import { type ReactNode } from "react";
import { Box, IconBadge, Link, Text } from "../compose";
import { LucideIcon } from "../icons/LucideIcon";
import { urlOf } from "../utils";

export type StatTileProps = {
  label: string;
  value: string | number;
  icon: string;
  href?: string;
  hint?: string;
};

export function StatTile({ label, value, icon, href, hint }: StatTileProps) {
  return (
    <Box className="min-w-0" data-slot="stat-tile">
      {href ? (
        <Link
          href={urlOf(href)}
          variant="block"
          className={"flex min-w-0 flex-col gap-4 rounded bg-card p-6 text-foreground no-underline inset-ring inset-ring-border " +
            "hover:bg-muted"}
        >
          <Box className="flex items-center justify-between gap-2">
            <Text className="m-0 text-xs font-bold text-muted-foreground">
              {label}
            </Text>
            <IconBadge size="sm">
              <LucideIcon name={icon} size={16} />
            </IconBadge>
          </Box>
          <Text size="2xl" weight="bold" className="m-0 leading-8">
            {value}
          </Text>
          {hint ? (
            <Text className="m-0 text-xs font-medium text-muted-foreground">
              {hint}
            </Text>
          ) : null}
        </Link>
      ) : (
        <Box className={"flex min-w-0 flex-col gap-4 rounded bg-card p-6 text-foreground inset-ring inset-ring-border"}>
          <Box className="flex items-center justify-between gap-2">
            <Text className="m-0 text-xs font-bold text-muted-foreground">
              {label}
            </Text>
            <IconBadge size="sm">
              <LucideIcon name={icon} size={16} />
            </IconBadge>
          </Box>
          <Text size="2xl" weight="bold" className="m-0 leading-8">
            {value}
          </Text>
          {hint ? (
            <Text className="m-0 text-xs font-medium text-muted-foreground">
              {hint}
            </Text>
          ) : null}
        </Box>
      )}
    </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 stat-tile
components/stat-tile.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. -->
<!--
  A dashboard counter: an icon, a big number, a caption. With `href` the whole tile is a link, without it the
  tile is a plain figure.
-->
<script lang="ts">
export type StatTileProps = {
  label: string;
  value: string | number;
  icon: string;
  href?: string;
  hint?: string;
};
</script>

<script setup lang="ts">
import Box from "../compose/Box.vue";
import IconBadge from "../compose/IconBadge.vue";
import Link from "../compose/Link.vue";
import LucideIcon from "../icons/LucideIcon.vue";
import Text from "../compose/Text.vue";
import { urlOf } from "../utils";

const { label, value, icon, href, hint } = defineProps<StatTileProps>();
</script>

<template>
  <Box class="min-w-0" data-slot="stat-tile">
    <Link v-if="href"
      :href="urlOf(href)"
      variant="block"
      :class="'flex min-w-0 flex-col gap-4 rounded bg-card p-6 text-foreground no-underline inset-ring inset-ring-border ' +
        'hover:bg-muted'"
    >
      <Box class="flex items-center justify-between gap-2">
        <Text class="m-0 text-xs font-bold text-muted-foreground">
          {{ label }}
        </Text>
        <IconBadge size="sm">
          <LucideIcon :name="icon" :size="16" />
        </IconBadge>
      </Box>
      <Text size="2xl" weight="bold" class="m-0 leading-8">
        {{ value }}
      </Text>
      <Text v-if="hint" class="m-0 text-xs font-medium text-muted-foreground">
        {{ hint }}
      </Text>
    </Link>
    <Box
      v-else
      class="flex min-w-0 flex-col gap-4 rounded bg-card p-6 text-foreground inset-ring inset-ring-border"
    >
      <Box class="flex items-center justify-between gap-2">
        <Text class="m-0 text-xs font-bold text-muted-foreground">
          {{ label }}
        </Text>
        <IconBadge size="sm">
          <LucideIcon :name="icon" :size="16" />
        </IconBadge>
      </Box>
      <Text size="2xl" weight="bold" class="m-0 leading-8">
        {{ value }}
      </Text>
      <Text v-if="hint" class="m-0 text-xs font-medium text-muted-foreground">
        {{ hint }}
      </Text>
    </Box>
  </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 stat-tile
components/stat-tile.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.
/**
 * A dashboard counter: an icon, a big number, a caption. With `href` the whole tile is a link, without it the
 * tile is a plain figure.
 */
import { type JSX } from "solid-js";
import { Box, IconBadge, Link, Text } from "../compose";
import { LucideIcon } from "../icons/LucideIcon";
import { urlOf } from "../utils";

export type StatTileProps = {
  label: string;
  value: string | number;
  icon: string;
  href?: string;
  hint?: string;
};

export function StatTile({ label, value, icon, href, hint }: StatTileProps) {
  return (
    <Box class="min-w-0" data-slot="stat-tile">
      {href ? (
        <Link
          href={urlOf(href)}
          variant="block"
          class={"flex min-w-0 flex-col gap-4 rounded bg-card p-6 text-foreground no-underline inset-ring inset-ring-border " +
            "hover:bg-muted"}
        >
          <Box class="flex items-center justify-between gap-2">
            <Text class="m-0 text-xs font-bold text-muted-foreground">
              {label}
            </Text>
            <IconBadge size="sm">
              <LucideIcon name={icon} size={16} />
            </IconBadge>
          </Box>
          <Text size="2xl" weight="bold" class="m-0 leading-8">
            {value}
          </Text>
          {hint ? (
            <Text class="m-0 text-xs font-medium text-muted-foreground">
              {hint}
            </Text>
          ) : null}
        </Link>
      ) : (
        <Box class="flex min-w-0 flex-col gap-4 rounded bg-card p-6 text-foreground inset-ring inset-ring-border">
          <Box class="flex items-center justify-between gap-2">
            <Text class="m-0 text-xs font-bold text-muted-foreground">
              {label}
            </Text>
            <IconBadge size="sm">
              <LucideIcon name={icon} size={16} />
            </IconBadge>
          </Box>
          <Text size="2xl" weight="bold" class="m-0 leading-8">
            {value}
          </Text>
          {hint ? (
            <Text class="m-0 text-xs font-medium text-muted-foreground">
              {hint}
            </Text>
          ) : null}
        </Box>
      )}
    </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 stat-tile
blocks/stat-tile.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/parts/stat-tile.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/link"
	"github.com/ui8kit/codegen/generated/templ/ui/text"
	uiutils "github.com/ui8kit/codegen/generated/templ/orgutils"
)

// StatTileProps are the props of StatTile; the values are the JSON shapes of the TypeScript props.
type StatTileProps struct {
	Label any `json:"label"`
	Value any `json:"value"`
	Icon any `json:"icon"`
	Href any `json:"href"`
	Hint any `json:"hint"`
}

// A dashboard counter: an icon, a big number, a caption. With `href` the whole tile is a link, without it the tile is a plain figure.
templ StatTile(p StatTileProps) {
	{{ vLabel := p.Label }}
	{{ vValue := p.Value }}
	{{ vIcon := p.Icon }}
	{{ vHref := p.Href }}
	{{ vHint := p.Hint }}
	@compose.Box(compose.BoxProps{BoxProps: box.BoxProps{Class: "min-w-0", Attrs: uiutils.Attrs("data-slot", "stat-tile")}}) {
		if uiutils.T(vHref) {
			@compose.Link(compose.LinkProps{Variant: "block", LinkProps: link.LinkProps{Href: uiutils.URL(vHref, false), Class: "flex min-w-0 flex-col gap-4 rounded bg-card p-6 text-foreground no-underline inset-ring inset-ring-border hover:bg-muted"}}) {
				@compose.Box(compose.BoxProps{BoxProps: box.BoxProps{Class: "flex items-center justify-between gap-2"}}) {
					@compose.Text(compose.TextProps{TextProps: text.TextProps{Class: "m-0 text-xs font-bold text-muted-foreground"}}) {
						{ uiutils.Text(vLabel) }
					}
					@compose.IconBadge(compose.IconBadgeProps{Size: "sm", TextProps: text.TextProps{}}) {
						@icons.LucideIcon(icons.LucideIconProps{Name: uiutils.S(vIcon), Size: 16})
					}
				}
				@compose.Text(compose.TextProps{Size: "2xl", Weight: "bold", TextProps: text.TextProps{Class: "m-0 leading-8"}}) {
					{ uiutils.Text(vValue) }
				}
				if uiutils.T(vHint) {
					@compose.Text(compose.TextProps{TextProps: text.TextProps{Class: "m-0 text-xs font-medium text-muted-foreground"}}) {
						{ uiutils.Text(vHint) }
					}
				}
			}
		} else {
			@compose.Box(compose.BoxProps{BoxProps: box.BoxProps{Class: "flex min-w-0 flex-col gap-4 rounded bg-card p-6 text-foreground inset-ring inset-ring-border"}}) {
				@compose.Box(compose.BoxProps{BoxProps: box.BoxProps{Class: "flex items-center justify-between gap-2"}}) {
					@compose.Text(compose.TextProps{TextProps: text.TextProps{Class: "m-0 text-xs font-bold text-muted-foreground"}}) {
						{ uiutils.Text(vLabel) }
					}
					@compose.IconBadge(compose.IconBadgeProps{Size: "sm", TextProps: text.TextProps{}}) {
						@icons.LucideIcon(icons.LucideIconProps{Name: uiutils.S(vIcon), Size: 16})
					}
				}
				@compose.Text(compose.TextProps{Size: "2xl", Weight: "bold", TextProps: text.TextProps{Class: "m-0 leading-8"}}) {
					{ uiutils.Text(vValue) }
				}
				if uiutils.T(vHint) {
					@compose.Text(compose.TextProps{TextProps: text.TextProps{Class: "m-0 text-xs font-medium text-muted-foreground"}}) {
						{ uiutils.Text(vHint) }
					}
				}
			}
		}
	}
}

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 stat-tile
blocks/stat-tile.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/parts/stat-tile.json
    A dashboard counter: an icon, a big number, a caption. With `href` the whole tile is a link, without it the tile is a plain figure.
    Props (p): label, value, icon, href, hint. -#}
{%- set v_label = (p.label ?? null) -%}
{%- set v_value = (p.value ?? null) -%}
{%- set v_icon = (p.icon ?? null) -%}
{%- set v_href = (p.href ?? null) -%}
{%- set v_hint = (p.hint ?? null) -%}
{%- set c_13 -%}
  {%- if og_t(v_href) %}
    {%- set c_6 -%}
      {%- set c_3 -%}
        {%- set c_1 -%}
          {{ og_text(v_label) }}
        {%- endset -%}
        {{ include('compose/Text.html.twig', {'class': 'm-0 text-xs font-bold text-muted-foreground', 'children': c_1}, with_context = false) }}
        {%- set c_2 -%}
          {{ include('icons/LucideIcon.html.twig', {'name': og_s(v_icon), 'size': 16}, with_context = false) }}
        {%- endset -%}
        {{ include('compose/IconBadge.html.twig', {'size': 'sm', 'children': c_2}, with_context = false) }}
      {%- endset -%}
      {{ include('compose/Box.html.twig', {'class': 'flex items-center justify-between gap-2', 'children': c_3}, with_context = false) }}
      {%- set c_4 -%}
        {{ og_text(v_value) }}
      {%- endset -%}
      {{ include('compose/Text.html.twig', {'size': '2xl', 'weight': 'bold', 'class': 'm-0 leading-8', 'children': c_4}, with_context = false) }}
      {%- if og_t(v_hint) %}
        {%- set c_5 -%}
          {{ og_text(v_hint) }}
        {%- endset -%}
        {{ include('compose/Text.html.twig', {'class': 'm-0 text-xs font-medium text-muted-foreground', 'children': c_5}, with_context = false) }}
      {%- endif %}
    {%- endset -%}
    {{ include('compose/Link.html.twig', {'href': og_url(og_s(v_href)), 'variant': 'block', 'class': 'flex min-w-0 flex-col gap-4 rounded bg-card p-6 text-foreground no-underline inset-ring inset-ring-border hover:bg-muted', 'children': c_6}, with_context = false) }}
  {%- else %}
    {%- set c_12 -%}
      {%- set c_9 -%}
        {%- set c_7 -%}
          {{ og_text(v_label) }}
        {%- endset -%}
        {{ include('compose/Text.html.twig', {'class': 'm-0 text-xs font-bold text-muted-foreground', 'children': c_7}, with_context = false) }}
        {%- set c_8 -%}
          {{ include('icons/LucideIcon.html.twig', {'name': og_s(v_icon), 'size': 16}, with_context = false) }}
        {%- endset -%}
        {{ include('compose/IconBadge.html.twig', {'size': 'sm', 'children': c_8}, with_context = false) }}
      {%- endset -%}
      {{ include('compose/Box.html.twig', {'class': 'flex items-center justify-between gap-2', 'children': c_9}, with_context = false) }}
      {%- set c_10 -%}
        {{ og_text(v_value) }}
      {%- endset -%}
      {{ include('compose/Text.html.twig', {'size': '2xl', 'weight': 'bold', 'class': 'm-0 leading-8', 'children': c_10}, with_context = false) }}
      {%- if og_t(v_hint) %}
        {%- set c_11 -%}
          {{ og_text(v_hint) }}
        {%- endset -%}
        {{ include('compose/Text.html.twig', {'class': 'm-0 text-xs font-medium text-muted-foreground', 'children': c_11}, with_context = false) }}
      {%- endif %}
    {%- endset -%}
    {{ include('compose/Box.html.twig', {'class': 'flex min-w-0 flex-col gap-4 rounded bg-card p-6 text-foreground inset-ring inset-ring-border', 'children': c_12}, with_context = false) }}
  {%- endif %}
{%- endset -%}
{{ include('compose/Box.html.twig', {'class': 'min-w-0', 'attrs': og_attrs(['data-slot', 'stat-tile']), 'children': c_13}, 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 stat-tile
blocks/stat-tile.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/parts/stat-tile.json
    A dashboard counter: an icon, a big number, a caption. With `href` the whole tile is a link, without it the tile is a plain figure.
    Props (p): label, value, icon, href, hint. *}
{var $v_label = ($p['label'] ?? null)}
{var $v_value = ($p['value'] ?? null)}
{var $v_icon = ($p['icon'] ?? null)}
{var $v_href = ($p['href'] ?? null)}
{var $v_hint = ($p['hint'] ?? null)}
{capture $c_13}
  {if og_t($v_href)}
    {capture $c_6}
      {capture $c_3}
        {capture $c_1}
          {=og_text($v_label)}
        {/capture}
        {=og_include('compose/Text.latte', ['class' => 'm-0 text-xs font-bold text-muted-foreground', 'children' => (string) $c_1])|noescape}
        {capture $c_2}
          {=og_include('icons/LucideIcon.latte', ['name' => og_s($v_icon), 'size' => 16])|noescape}
        {/capture}
        {=og_include('compose/IconBadge.latte', ['size' => 'sm', 'children' => (string) $c_2])|noescape}
      {/capture}
      {=og_include('compose/Box.latte', ['class' => 'flex items-center justify-between gap-2', 'children' => (string) $c_3])|noescape}
      {capture $c_4}
        {=og_text($v_value)}
      {/capture}
      {=og_include('compose/Text.latte', ['size' => '2xl', 'weight' => 'bold', 'class' => 'm-0 leading-8', 'children' => (string) $c_4])|noescape}
      {if og_t($v_hint)}
        {capture $c_5}
          {=og_text($v_hint)}
        {/capture}
        {=og_include('compose/Text.latte', ['class' => 'm-0 text-xs font-medium text-muted-foreground', 'children' => (string) $c_5])|noescape}
      {/if}
    {/capture}
    {=og_include('compose/Link.latte', ['href' => og_url(og_s($v_href)), 'variant' => 'block', 'class' => 'flex min-w-0 flex-col gap-4 rounded bg-card p-6 text-foreground no-underline inset-ring inset-ring-border hover:bg-muted', 'children' => (string) $c_6])|noescape}
  {else}
    {capture $c_12}
      {capture $c_9}
        {capture $c_7}
          {=og_text($v_label)}
        {/capture}
        {=og_include('compose/Text.latte', ['class' => 'm-0 text-xs font-bold text-muted-foreground', 'children' => (string) $c_7])|noescape}
        {capture $c_8}
          {=og_include('icons/LucideIcon.latte', ['name' => og_s($v_icon), 'size' => 16])|noescape}
        {/capture}
        {=og_include('compose/IconBadge.latte', ['size' => 'sm', 'children' => (string) $c_8])|noescape}
      {/capture}
      {=og_include('compose/Box.latte', ['class' => 'flex items-center justify-between gap-2', 'children' => (string) $c_9])|noescape}
      {capture $c_10}
        {=og_text($v_value)}
      {/capture}
      {=og_include('compose/Text.latte', ['size' => '2xl', 'weight' => 'bold', 'class' => 'm-0 leading-8', 'children' => (string) $c_10])|noescape}
      {if og_t($v_hint)}
        {capture $c_11}
          {=og_text($v_hint)}
        {/capture}
        {=og_include('compose/Text.latte', ['class' => 'm-0 text-xs font-medium text-muted-foreground', 'children' => (string) $c_11])|noescape}
      {/if}
    {/capture}
    {=og_include('compose/Box.latte', ['class' => 'flex min-w-0 flex-col gap-4 rounded bg-card p-6 text-foreground inset-ring inset-ring-border', 'children' => (string) $c_12])|noescape}
  {/if}
{/capture}
{=og_include('compose/Box.latte', ['class' => 'min-w-0', 'attrs' => og_attrs(['data-slot', 'stat-tile']), 'children' => (string) $c_13])|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 stat-tile
blocks/stat-tile.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/parts/stat-tile.json
    A dashboard counter: an icon, a big number, a caption. With `href` the whole tile is a link, without it the tile is a plain figure.
    Props (p): label, value, icon, href, hint. -#}
{%- set v_label = og_def(p['label'], none) -%}
{%- set v_value = og_def(p['value'], none) -%}
{%- set v_icon = og_def(p['icon'], none) -%}
{%- set v_href = og_def(p['href'], none) -%}
{%- set v_hint = og_def(p['hint'], none) -%}
{%- set c_13 -%}
  {%- if og_t(v_href) %}
    {%- set c_6 -%}
      {%- set c_3 -%}
        {%- set c_1 -%}
          {{ og_text(v_label) }}
        {%- endset -%}
        {{ og_include('compose/text.html.j2', {'p': {'Class': 'm-0 text-xs font-bold text-muted-foreground'}, 'children': c_1}) }}
        {%- set c_2 -%}
          {{ og_include('icons/lucide-icon.html.j2', {'p': {'Name': og_s(v_icon), 'Size': 16}}) }}
        {%- endset -%}
        {{ og_include('compose/icon-badge.html.j2', {'p': {'Size': 'sm'}, 'children': c_2}) }}
      {%- endset -%}
      {{ og_include('compose/box.html.j2', {'p': {'Class': 'flex items-center justify-between gap-2'}, 'children': c_3}) }}
      {%- set c_4 -%}
        {{ og_text(v_value) }}
      {%- endset -%}
      {{ og_include('compose/text.html.j2', {'p': {'Size': '2xl', 'Weight': 'bold', 'Class': 'm-0 leading-8'}, 'children': c_4}) }}
      {%- if og_t(v_hint) %}
        {%- set c_5 -%}
          {{ og_text(v_hint) }}
        {%- endset -%}
        {{ og_include('compose/text.html.j2', {'p': {'Class': 'm-0 text-xs font-medium text-muted-foreground'}, 'children': c_5}) }}
      {%- endif %}
    {%- endset -%}
    {{ og_include('compose/link.html.j2', {'p': {'Href': og_url(og_s(v_href)), 'Variant': 'block', 'Class': 'flex min-w-0 flex-col gap-4 rounded bg-card p-6 text-foreground no-underline inset-ring inset-ring-border hover:bg-muted'}, 'children': c_6}) }}
  {%- else %}
    {%- set c_12 -%}
      {%- set c_9 -%}
        {%- set c_7 -%}
          {{ og_text(v_label) }}
        {%- endset -%}
        {{ og_include('compose/text.html.j2', {'p': {'Class': 'm-0 text-xs font-bold text-muted-foreground'}, 'children': c_7}) }}
        {%- set c_8 -%}
          {{ og_include('icons/lucide-icon.html.j2', {'p': {'Name': og_s(v_icon), 'Size': 16}}) }}
        {%- endset -%}
        {{ og_include('compose/icon-badge.html.j2', {'p': {'Size': 'sm'}, 'children': c_8}) }}
      {%- endset -%}
      {{ og_include('compose/box.html.j2', {'p': {'Class': 'flex items-center justify-between gap-2'}, 'children': c_9}) }}
      {%- set c_10 -%}
        {{ og_text(v_value) }}
      {%- endset -%}
      {{ og_include('compose/text.html.j2', {'p': {'Size': '2xl', 'Weight': 'bold', 'Class': 'm-0 leading-8'}, 'children': c_10}) }}
      {%- if og_t(v_hint) %}
        {%- set c_11 -%}
          {{ og_text(v_hint) }}
        {%- endset -%}
        {{ og_include('compose/text.html.j2', {'p': {'Class': 'm-0 text-xs font-medium text-muted-foreground'}, 'children': c_11}) }}
      {%- endif %}
    {%- endset -%}
    {{ og_include('compose/box.html.j2', {'p': {'Class': 'flex min-w-0 flex-col gap-4 rounded bg-card p-6 text-foreground inset-ring inset-ring-border'}, 'children': c_12}) }}
  {%- endif %}
{%- endset -%}
{{ og_include('compose/box.html.j2', {'p': {'Class': 'min-w-0', 'Attrs': og_attrs(['data-slot', 'stat-tile'])}, 'children': c_13}) }}

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.

A dashboard counter: an icon, a big number, a caption. With `href` the whole tile is a link, without it the tile is a plain figure.

Props of StatTile
PropTypeDefault Description
label (required)string-
value (required)string | number-
icon (required)string-Lucide name
href string-
hint string-

Used in