# Logo cloud

"Trusted by" section with customer logos in five layouts: row, grid, CSS marquee, quote cards, and stats.

- Category: Sections
- Status: stable
- Registry: https://markas.jenderalcorp.com/r/logo-cloud.json
- CLI: `npx markasui@latest add logo-cloud`

## When to use

Social proof under a hero or pricing table: brands, partners, or press that use the product.

- Only show logos you have permission to use
- Prefer monochrome SVG paths so logos follow the theme
- Use marquee for long lists and grid or row for six logos or fewer

## Code

### Blade

Save at `resources/views/components/markas/logo-cloud.blade.php`. No extra dependencies.

```blade
@props([
    'logos' => [],
    'title' => '',
    'variant' => 'row',
    'grayscale' => true,
    'stats' => [],
    'logosLabel' => 'Customer logos',
])

@php
    $root = '@container w-full';
    $layouts = [
        'row' => ['root' => 'grid gap-8', 'title' => 'text-center text-sm font-medium text-muted', 'list' => 'flex flex-wrap items-center justify-center gap-x-10 gap-y-6', 'item' => 'flex'],
        'grid' => ['root' => 'grid gap-8', 'title' => 'text-center text-sm font-medium text-muted', 'list' => 'grid grid-cols-2 gap-px overflow-hidden rounded-xl border border-line bg-line @lg:grid-cols-3 @3xl:grid-cols-4', 'item' => 'flex h-24 items-center justify-center bg-surface px-4'],
        'marquee' => ['root' => 'grid gap-8', 'title' => 'text-center text-sm font-medium text-muted', 'list' => 'flex shrink-0 items-center gap-12 pr-12 motion-reduce:w-full motion-reduce:flex-wrap motion-reduce:justify-center motion-reduce:gap-y-6 motion-reduce:pr-0', 'item' => 'flex'],
        'cards' => ['root' => 'grid gap-8', 'title' => 'text-center text-sm font-medium text-muted', 'list' => 'grid gap-4 @xl:grid-cols-2 @3xl:grid-cols-3', 'item' => 'flex flex-col items-start gap-4 rounded-xl border border-line bg-surface p-5'],
        'stats' => ['root' => 'grid items-center gap-8 @2xl:grid-cols-[2fr_3fr] @2xl:gap-12', 'title' => 'text-2xl font-semibold tracking-tight text-balance text-ink', 'list' => 'grid grid-cols-2 items-center gap-x-8 gap-y-6 @lg:grid-cols-3', 'item' => 'flex'],
    ];
    $viewport = 'group overflow-hidden mask-x-from-80% motion-reduce:mask-none';
    $track = 'flex w-max animate-[markas-logo-cloud_30s_linear_infinite] group-focus-within:[animation-play-state:paused] group-hover:[animation-play-state:paused] motion-reduce:w-full motion-reduce:animate-none';
    $copy = 'motion-reduce:hidden';
    $keyframes = '@keyframes markas-logo-cloud{to{translate:-50% 0}}';
    $header = 'grid gap-6';
    $statList = 'grid grid-cols-2 gap-6';
    $stat = 'flex flex-col-reverse gap-1';
    $statValue = 'text-3xl font-semibold tracking-tight text-ink';
    $statLabel = 'text-sm text-muted';
    $logoBase = 'inline-flex items-center gap-2 rounded-md text-lg font-semibold tracking-tight whitespace-nowrap focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary';
    $tones = ['gray' => 'text-muted grayscale transition-[color,filter] duration-200 ease-out hover:text-ink hover:grayscale-0 motion-reduce:transition-none', 'color' => 'text-ink'];
    $mark = 'h-7 w-auto shrink-0';
    $quote = 'text-sm text-pretty text-ink';
    $author = 'mt-auto text-xs text-muted';

    $layout = $layouts[$variant] ?? $layouts['row'];
    $tone = $grayscale ? $tones['gray'] : $tones['color'];
    // Same id on every render, so Livewire's morph (which matches elements by id) keeps the element. Pass `id` to set it.
    $idKey = 'markas-logo-cloud|'.(isset($this) && $this instanceof \Livewire\Component ? $this->getId() : '').'|'.($attributes->get('wire:key') ?? $attributes->whereStartsWith('wire:model')->first() ?? $attributes->get('name')).'|';
    for ($idIndex = 0; $__env->hasRenderedOnce($idKey.$idIndex); $idIndex++);
    $__env->markAsRenderedOnce($idKey.$idIndex);
    $id = $attributes->get('id') ?? 'markas-logo-cloud-'.hash('xxh32', $idKey.$idIndex);
    $copies = $variant === 'marquee' ? [0, 1] : [0];
    // Href berskema selain http, https, mailto, dan tel (misalnya javascript:) diganti "#". Spasi dan karakter kontrol diabaikan seperti di browser.
    $safeHref = fn (?string $href): string => preg_match('/^(?!https?:|mailto:|tel:)[a-z][\w+.\-]*:/i', preg_replace('/[\x00-\x20]/', '', (string) $href)) === 1 ? '#' : (string) ($href ?? '#');
@endphp

<section
    @if (filled($title)) aria-labelledby="{{ $id }}-title" @else aria-label="{{ $logosLabel }}" @endif
    {{ $attributes->merge(['id' => $id])->class([$root]) }}
>
    <div class="{{ $layout['root'] }}">
        @if ($variant === 'stats')
            <div class="{{ $header }}">
                @if (filled($title))
                    <h2 id="{{ $id }}-title" class="{{ $layout['title'] }}">{{ $title }}</h2>
                @endif
                @if ($stats)
                    <dl class="{{ $statList }}">
                        @foreach ($stats as $entry)
                            <div class="{{ $stat }}">
                                <dt class="{{ $statLabel }}">{{ $entry['label'] }}</dt>
                                <dd class="{{ $statValue }}">{{ $entry['value'] }}</dd>
                            </div>
                        @endforeach
                    </dl>
                @endif
            </div>
        @elseif (filled($title))
            <h2 id="{{ $id }}-title" class="{{ $layout['title'] }}">{{ $title }}</h2>
        @endif
        @if ($variant === 'marquee')
            <div class="{{ $viewport }}">
                <style>{!! $keyframes !!}</style>
                <div class="{{ $track }}">
        @endif
        @foreach ($copies as $copyIndex)
            <ul role="list" @if ($copyIndex > 0) aria-hidden="true" inert @endif class="{{ $layout['list'] }}{{ $copyIndex > 0 ? ' '.$copy : '' }}">
                @foreach ($logos as $key => $logo)
                    @php
                        $wordmark = ($logo['wordmark'] ?? true) !== false || empty($logo['path']);
                        $tag = filled($logo['href'] ?? null) ? 'a' : 'span';
                        $custom = is_string($key) ? ($__laravel_slots[$key] ?? null) : null;
                    @endphp
                    <li class="{{ $layout['item'] }}">
                        <{{ $tag }} @if ($tag === 'a') href="{{ $safeHref($logo['href']) }}" @endif class="{{ $logoBase }} {{ $tone }}">
                            @if ($custom)
                                {{ $custom }}
                            @else
                                @if (! empty($logo['path']))
                                    <svg class="{{ $mark }}" viewBox="{{ $logo['viewBox'] ?? '0 0 24 24' }}" fill="currentColor" @if ($wordmark) aria-hidden="true" @else role="img" aria-label="{{ $logo['name'] }}" @endif><path d="{{ $logo['path'] }}" /></svg>
                                @endif
                                @if ($wordmark)
                                    <span>{{ $logo['name'] }}</span>
                                @endif
                            @endif
                        </{{ $tag }}>
                        @if ($variant === 'cards' && filled($logo['quote'] ?? null))
                            <blockquote class="{{ $quote }}">{{ $logo['quote'] }}</blockquote>
                        @endif
                        @if ($variant === 'cards' && filled($logo['author'] ?? null))
                            <p class="{{ $author }}">{{ $logo['author'] }}</p>
                        @endif
                    </li>
                @endforeach
            </ul>
        @endforeach
        @if ($variant === 'marquee')
                </div>
            </div>
        @endif
    </div>
</section>
```

```blade
<x-markas.logo-cloud
    title="Trusted by teams across Indonesia"
    :logos="[
        ['name' => 'Nusantara Labs', 'path' => 'M12 2 21 7v10l-9 5-9-5V7Z', 'href' => 'https://example.com'],
        ['name' => 'Kopi Kita'],
    ]"
/>

<x-markas.logo-cloud variant="stats" title="The UI kit behind 2,000+ teams" :logos="$logos" :stats="[['value' => '2,000+', 'label' => 'Teams']]" />

{{-- Custom markup: a slot named after the array key --}}
<x-markas.logo-cloud variant="marquee" :logos="['sagara' => ['name' => 'Sagara']]">
    <x-slot:sagara><img src="/logos/sagara.svg" alt="Sagara" class="h-7" /></x-slot:sagara>
</x-markas.logo-cloud>
```

### React

Save at `src/components/markas/LogoCloud.tsx`. No extra dependencies.

```tsx
import { Fragment, useId, type ComponentProps, type ReactNode } from "react";

const root = "@container w-full";
const layouts = {
  row: {
    root: "grid gap-8",
    title: "text-center text-sm font-medium text-muted",
    list: "flex flex-wrap items-center justify-center gap-x-10 gap-y-6",
    item: "flex",
  },
  grid: {
    root: "grid gap-8",
    title: "text-center text-sm font-medium text-muted",
    list: "grid grid-cols-2 gap-px overflow-hidden rounded-xl border border-line bg-line @lg:grid-cols-3 @3xl:grid-cols-4",
    item: "flex h-24 items-center justify-center bg-surface px-4",
  },
  marquee: {
    root: "grid gap-8",
    title: "text-center text-sm font-medium text-muted",
    list: "flex shrink-0 items-center gap-12 pr-12 motion-reduce:w-full motion-reduce:flex-wrap motion-reduce:justify-center motion-reduce:gap-y-6 motion-reduce:pr-0",
    item: "flex",
  },
  cards: {
    root: "grid gap-8",
    title: "text-center text-sm font-medium text-muted",
    list: "grid gap-4 @xl:grid-cols-2 @3xl:grid-cols-3",
    item: "flex flex-col items-start gap-4 rounded-xl border border-line bg-surface p-5",
  },
  stats: {
    root: "grid items-center gap-8 @2xl:grid-cols-[2fr_3fr] @2xl:gap-12",
    title: "text-2xl font-semibold tracking-tight text-balance text-ink",
    list: "grid grid-cols-2 items-center gap-x-8 gap-y-6 @lg:grid-cols-3",
    item: "flex",
  },
};
const viewport =
  "group overflow-hidden mask-x-from-80% motion-reduce:mask-none";
const track =
  "flex w-max animate-[markas-logo-cloud_30s_linear_infinite] group-focus-within:[animation-play-state:paused] group-hover:[animation-play-state:paused] motion-reduce:w-full motion-reduce:animate-none";
const copy = "motion-reduce:hidden";
const keyframes = "@keyframes markas-logo-cloud{to{translate:-50% 0}}";
const header = "grid gap-6";
const statList = "grid grid-cols-2 gap-6";
const stat = "flex flex-col-reverse gap-1";
const statValue = "text-3xl font-semibold tracking-tight text-ink";
const statLabel = "text-sm text-muted";
const logoBase =
  "inline-flex items-center gap-2 rounded-md text-lg font-semibold tracking-tight whitespace-nowrap focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary";
const tones = {
  gray: "text-muted grayscale transition-[color,filter] duration-200 ease-out hover:text-ink hover:grayscale-0 motion-reduce:transition-none",
  color: "text-ink",
};
const mark = "h-7 w-auto shrink-0";
const quote = "text-sm text-pretty text-ink";
const author = "mt-auto text-xs text-muted";
const COPIES = [0, 1];

const cx = (...c: (string | false | null | undefined)[]) =>
  c.filter(Boolean).join(" ");

/** Href berskema selain http, https, mailto, dan tel (misalnya javascript:) diganti "#". Spasi dan karakter kontrol diabaikan seperti di browser. */
const safeHref = (href: string) =>
  /^(?!https?:|mailto:|tel:)[a-z][\w+.-]*:/i.test(href.replace(/[\0- ]/g, ""))
    ? "#"
    : href;

export type LogoCloudLogo = {
  name: string;
  href?: string;
  /** Path SVG (atribut d) yang diisi currentColor. */
  path?: string;
  viewBox?: string;
  /** Tampilkan nama sebagai teks di samping path. false: hanya SVG, nama jadi aria-label. */
  wordmark?: boolean;
  /** Ganti seluruh isi logo, mis. elemen img. */
  logo?: ReactNode;
  quote?: string;
  author?: string;
};
export type LogoCloudStat = { value: string; label: string };
export type LogoCloudVariant = keyof typeof layouts;

export type LogoCloudProps = Omit<ComponentProps<"section">, "title"> & {
  logos: LogoCloudLogo[];
  title?: string;
  variant?: LogoCloudVariant;
  grayscale?: boolean;
  stats?: LogoCloudStat[];
  logosLabel?: string;
};

function Logo({ logo, tone }: { logo: LogoCloudLogo; tone: string }) {
  const wordmark = logo.wordmark !== false || !logo.path;
  const content = logo.logo ?? (
    <>
      {logo.path ? (
        <svg
          className={mark}
          viewBox={logo.viewBox ?? "0 0 24 24"}
          fill="currentColor"
          role={wordmark ? undefined : "img"}
          aria-label={wordmark ? undefined : logo.name}
          aria-hidden={wordmark ? true : undefined}
        >
          <path d={logo.path} />
        </svg>
      ) : null}
      {wordmark ? <span>{logo.name}</span> : null}
    </>
  );
  return logo.href ? (
    <a href={safeHref(logo.href)} className={cx(logoBase, tone)}>
      {content}
    </a>
  ) : (
    <span className={cx(logoBase, tone)}>{content}</span>
  );
}

export function LogoCloud({
  logos,
  title = "",
  variant = "row",
  grayscale = true,
  stats = [],
  logosLabel = "Customer logos",
  id,
  className,
  ...props
}: LogoCloudProps) {
  const generatedId = useId();
  const baseId = id ?? generatedId;
  const layout = layouts[variant];
  const tone = grayscale ? tones.gray : tones.color;

  const list = (index = 0) => (
    <ul
      role="list"
      aria-hidden={index > 0 ? true : undefined}
      inert={index > 0}
      className={cx(layout.list, index > 0 && copy)}
    >
      {logos.map((logo) => (
        <li key={logo.name} className={layout.item}>
          <Logo logo={logo} tone={tone} />
          {variant === "cards" && logo.quote ? (
            <blockquote className={quote}>{logo.quote}</blockquote>
          ) : null}
          {variant === "cards" && logo.author ? (
            <p className={author}>{logo.author}</p>
          ) : null}
        </li>
      ))}
    </ul>
  );
  const titleElement = title ? (
    <h2 id={`${baseId}-title`} className={layout.title}>
      {title}
    </h2>
  ) : null;

  return (
    <section
      id={baseId}
      aria-labelledby={title ? `${baseId}-title` : undefined}
      aria-label={title ? undefined : logosLabel}
      className={cx(root, className)}
      {...props}
    >
      <div className={layout.root}>
        {variant === "stats" ? (
          <div className={header}>
            {titleElement}
            {stats.length ? (
              <dl className={statList}>
                {stats.map((entry) => (
                  <div key={entry.label} className={stat}>
                    <dt className={statLabel}>{entry.label}</dt>
                    <dd className={statValue}>{entry.value}</dd>
                  </div>
                ))}
              </dl>
            ) : null}
          </div>
        ) : (
          titleElement
        )}
        {variant === "marquee" ? (
          <div className={viewport}>
            <style>{keyframes}</style>
            <div className={track}>
              {COPIES.map((index) => (
                <Fragment key={index}>{list(index)}</Fragment>
              ))}
            </div>
          </div>
        ) : (
          list()
        )}
      </div>
    </section>
  );
}
```

```tsx
import { LogoCloud } from "@/components/markas/LogoCloud";

<LogoCloud title="Trusted by teams across Indonesia" logos={logos} />

<LogoCloud
  variant="marquee"
  logos={[{ name: "Sagara", logo: <img src="/logos/sagara.svg" alt="Sagara" className="h-7" /> }]}
/>
```

### Vue

Save at `src/components/markas/LogoCloud.vue`. No extra dependencies.

```vue
<script setup lang="ts">
import { computed, useId } from "vue";

export type LogoCloudLogo = {
  name: string;
  href?: string;
  /** Path SVG (atribut d) yang diisi currentColor. */
  path?: string;
  viewBox?: string;
  /** Tampilkan nama sebagai teks di samping path. false: hanya SVG, nama jadi aria-label. */
  wordmark?: boolean;
  quote?: string;
  author?: string;
};
export type LogoCloudStat = { value: string; label: string };
export type LogoCloudVariant = "row" | "grid" | "marquee" | "cards" | "stats";

const props = withDefaults(
  defineProps<{
    logos: LogoCloudLogo[];
    title?: string;
    variant?: LogoCloudVariant;
    grayscale?: boolean;
    stats?: LogoCloudStat[];
    id?: string;
    logosLabel?: string;
  }>(),
  {
    title: "",
    variant: "row",
    grayscale: true,
    stats: () => [],
    id: undefined,
    logosLabel: "Customer logos",
  },
);
defineSlots<{
  /** Ganti seluruh isi satu logo, mis. elemen img. */
  logo?(props: { logo: LogoCloudLogo; index: number }): unknown;
}>();

const root = "@container w-full";
const layouts = {
  row: {
    root: "grid gap-8",
    title: "text-center text-sm font-medium text-muted",
    list: "flex flex-wrap items-center justify-center gap-x-10 gap-y-6",
    item: "flex",
  },
  grid: {
    root: "grid gap-8",
    title: "text-center text-sm font-medium text-muted",
    list: "grid grid-cols-2 gap-px overflow-hidden rounded-xl border border-line bg-line @lg:grid-cols-3 @3xl:grid-cols-4",
    item: "flex h-24 items-center justify-center bg-surface px-4",
  },
  marquee: {
    root: "grid gap-8",
    title: "text-center text-sm font-medium text-muted",
    list: "flex shrink-0 items-center gap-12 pr-12 motion-reduce:w-full motion-reduce:flex-wrap motion-reduce:justify-center motion-reduce:gap-y-6 motion-reduce:pr-0",
    item: "flex",
  },
  cards: {
    root: "grid gap-8",
    title: "text-center text-sm font-medium text-muted",
    list: "grid gap-4 @xl:grid-cols-2 @3xl:grid-cols-3",
    item: "flex flex-col items-start gap-4 rounded-xl border border-line bg-surface p-5",
  },
  stats: {
    root: "grid items-center gap-8 @2xl:grid-cols-[2fr_3fr] @2xl:gap-12",
    title: "text-2xl font-semibold tracking-tight text-balance text-ink",
    list: "grid grid-cols-2 items-center gap-x-8 gap-y-6 @lg:grid-cols-3",
    item: "flex",
  },
};
const viewport =
  "group overflow-hidden mask-x-from-80% motion-reduce:mask-none";
const track =
  "flex w-max animate-[markas-logo-cloud_30s_linear_infinite] group-focus-within:[animation-play-state:paused] group-hover:[animation-play-state:paused] motion-reduce:w-full motion-reduce:animate-none";
const copy = "motion-reduce:hidden";
const keyframes = "@keyframes markas-logo-cloud{to{translate:-50% 0}}";
const header = "grid gap-6";
const statList = "grid grid-cols-2 gap-6";
const stat = "flex flex-col-reverse gap-1";
const statValue = "text-3xl font-semibold tracking-tight text-ink";
const statLabel = "text-sm text-muted";
const logoBase =
  "inline-flex items-center gap-2 rounded-md text-lg font-semibold tracking-tight whitespace-nowrap focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary";
const tones = {
  gray: "text-muted grayscale transition-[color,filter] duration-200 ease-out hover:text-ink hover:grayscale-0 motion-reduce:transition-none",
  color: "text-ink",
};
const mark = "h-7 w-auto shrink-0";
const quote = "text-sm text-pretty text-ink";
const author = "mt-auto text-xs text-muted";
const COPIES = [0, 1];

/** Href berskema selain http, https, mailto, dan tel (misalnya javascript:) diganti "#". Spasi dan karakter kontrol diabaikan seperti di browser. */
const safeHref = (href: string) =>
  /^(?!https?:|mailto:|tel:)[a-z][\w+.-]*:/i.test(href.replace(/[\0- ]/g, ""))
    ? "#"
    : href;

const generatedId = useId();
const baseId = computed(() => props.id ?? generatedId);
const layout = computed(() => layouts[props.variant]);
const tone = computed(() => (props.grayscale ? tones.gray : tones.color));
const showsWordmark = (logo: LogoCloudLogo) =>
  logo.wordmark !== false || !logo.path;
</script>

<template>
  <section
    :id="baseId"
    :aria-labelledby="props.title ? `${baseId}-title` : undefined"
    :aria-label="props.title ? undefined : props.logosLabel"
    :class="root"
  >
    <div :class="layout.root">
      <div v-if="props.variant === 'stats'" :class="header">
        <h2 v-if="props.title" :id="`${baseId}-title`" :class="layout.title">
          {{ props.title }}
        </h2>
        <dl v-if="props.stats.length" :class="statList">
          <div v-for="entry in props.stats" :key="entry.label" :class="stat">
            <dt :class="statLabel">{{ entry.label }}</dt>
            <dd :class="statValue">{{ entry.value }}</dd>
          </div>
        </dl>
      </div>
      <h2 v-else-if="props.title" :id="`${baseId}-title`" :class="layout.title">
        {{ props.title }}
      </h2>
      <div v-if="props.variant === 'marquee'" :class="viewport">
        <component :is="'style'">{{ keyframes }}</component>
        <div :class="track">
          <ul
            v-for="copyIndex in COPIES"
            :key="copyIndex"
            role="list"
            :aria-hidden="copyIndex > 0 ? 'true' : undefined"
            :inert="copyIndex > 0 ? true : undefined"
            :class="[layout.list, copyIndex > 0 && copy]"
          >
            <li
              v-for="(logo, index) in props.logos"
              :key="logo.name"
              :class="layout.item"
            >
              <component
                :is="logo.href ? 'a' : 'span'"
                :href="logo.href ? safeHref(logo.href) : undefined"
                :class="[logoBase, tone]"
              >
                <slot name="logo" :logo="logo" :index="index">
                  <svg
                    v-if="logo.path"
                    :class="mark"
                    :viewBox="logo.viewBox ?? '0 0 24 24'"
                    fill="currentColor"
                    :role="showsWordmark(logo) ? undefined : 'img'"
                    :aria-label="showsWordmark(logo) ? undefined : logo.name"
                    :aria-hidden="showsWordmark(logo) ? 'true' : undefined"
                  >
                    <path :d="logo.path" />
                  </svg>
                  <span v-if="showsWordmark(logo)">{{ logo.name }}</span>
                </slot>
              </component>
            </li>
          </ul>
        </div>
      </div>
      <ul v-else role="list" :class="layout.list">
        <li
          v-for="(logo, index) in props.logos"
          :key="logo.name"
          :class="layout.item"
        >
          <component
            :is="logo.href ? 'a' : 'span'"
            :href="logo.href ? safeHref(logo.href) : undefined"
            :class="[logoBase, tone]"
          >
            <slot name="logo" :logo="logo" :index="index">
              <svg
                v-if="logo.path"
                :class="mark"
                :viewBox="logo.viewBox ?? '0 0 24 24'"
                fill="currentColor"
                :role="showsWordmark(logo) ? undefined : 'img'"
                :aria-label="showsWordmark(logo) ? undefined : logo.name"
                :aria-hidden="showsWordmark(logo) ? 'true' : undefined"
              >
                <path :d="logo.path" />
              </svg>
              <span v-if="showsWordmark(logo)">{{ logo.name }}</span>
            </slot>
          </component>
          <blockquote
            v-if="props.variant === 'cards' && logo.quote"
            :class="quote"
          >
            {{ logo.quote }}
          </blockquote>
          <p v-if="props.variant === 'cards' && logo.author" :class="author">
            {{ logo.author }}
          </p>
        </li>
      </ul>
    </div>
  </section>
</template>
```

```vue
<template>
  <LogoCloud title="Trusted by teams across Indonesia" :logos="logos" />

  <LogoCloud variant="marquee" :logos="logos">
    <template #logo="{ logo }">
      <img :src="logo.src" :alt="logo.name" class="h-7" />
    </template>
  </LogoCloud>
</template>
```

### Svelte

Save at `src/lib/components/markas/LogoCloud.svelte`. No extra dependencies.

```svelte
<script module lang="ts">
  export type LogoCloudLogo = {
    name: string;
    href?: string;
    /** SVG path (d attribute) filled with currentColor. */
    path?: string;
    viewBox?: string;
    /** Show the name as text next to the path. false: SVG only, the name becomes aria-label. */
    wordmark?: boolean;
    quote?: string;
    author?: string;
  };
  export type LogoCloudStat = { value: string; label: string };
  export type LogoCloudVariant = "row" | "grid" | "marquee" | "cards" | "stats";
</script>

<script lang="ts">
  import type { Snippet } from "svelte";
  import type { HTMLAttributes } from "svelte/elements";

  const root = "@container w-full";
  const layouts = {
    row: {
      root: "grid gap-8",
      title: "text-center text-sm font-medium text-muted",
      list: "flex flex-wrap items-center justify-center gap-x-10 gap-y-6",
      item: "flex",
    },
    grid: {
      root: "grid gap-8",
      title: "text-center text-sm font-medium text-muted",
      list: "grid grid-cols-2 gap-px overflow-hidden rounded-xl border border-line bg-line @lg:grid-cols-3 @3xl:grid-cols-4",
      item: "flex h-24 items-center justify-center bg-surface px-4",
    },
    marquee: {
      root: "grid gap-8",
      title: "text-center text-sm font-medium text-muted",
      list: "flex shrink-0 items-center gap-12 pr-12 motion-reduce:w-full motion-reduce:flex-wrap motion-reduce:justify-center motion-reduce:gap-y-6 motion-reduce:pr-0",
      item: "flex",
    },
    cards: {
      root: "grid gap-8",
      title: "text-center text-sm font-medium text-muted",
      list: "grid gap-4 @xl:grid-cols-2 @3xl:grid-cols-3",
      item: "flex flex-col items-start gap-4 rounded-xl border border-line bg-surface p-5",
    },
    stats: {
      root: "grid items-center gap-8 @2xl:grid-cols-[2fr_3fr] @2xl:gap-12",
      title: "text-2xl font-semibold tracking-tight text-balance text-ink",
      list: "grid grid-cols-2 items-center gap-x-8 gap-y-6 @lg:grid-cols-3",
      item: "flex",
    },
  };
  const viewport =
    "group overflow-hidden mask-x-from-80% motion-reduce:mask-none";
  const track =
    "flex w-max animate-[markas-logo-cloud_30s_linear_infinite] group-focus-within:[animation-play-state:paused] group-hover:[animation-play-state:paused] motion-reduce:w-full motion-reduce:animate-none";
  const copy = "motion-reduce:hidden";
  const keyframes = "@keyframes markas-logo-cloud{to{translate:-50% 0}}";
  const header = "grid gap-6";
  const statList = "grid grid-cols-2 gap-6";
  const stat = "flex flex-col-reverse gap-1";
  const statValue = "text-3xl font-semibold tracking-tight text-ink";
  const statLabel = "text-sm text-muted";
  const logoBase =
    "inline-flex items-center gap-2 rounded-md text-lg font-semibold tracking-tight whitespace-nowrap focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary";
  const tones = {
    gray: "text-muted grayscale transition-[color,filter] duration-200 ease-out hover:text-ink hover:grayscale-0 motion-reduce:transition-none",
    color: "text-ink",
  };
  const mark = "h-7 w-auto shrink-0";
  const quote = "text-sm text-pretty text-ink";
  const author = "mt-auto text-xs text-muted";
  const COPIES = [0, 1];

  /** Hrefs with a scheme other than http, https, mailto, and tel (javascript: for one) become "#". Spaces and control characters are ignored, as browsers do. */
  const safeHref = (href: string) =>
    /^(?!https?:|mailto:|tel:)[a-z][\w+.-]*:/i.test(href.replace(/[\0- ]/g, ""))
      ? "#"
      : href;
  const showsWordmark = (logo: LogoCloudLogo) =>
    logo.wordmark !== false || !logo.path;

  type Props = Omit<HTMLAttributes<HTMLElement>, "title"> & {
    logos: LogoCloudLogo[];
    title?: string;
    variant?: LogoCloudVariant;
    grayscale?: boolean;
    stats?: LogoCloudStat[];
    logosLabel?: string;
    /** Replaces the content of one logo, for example with an img element. */
    logo?: Snippet<[LogoCloudLogo, number]>;
  };

  let {
    logos,
    title = "",
    variant = "row",
    grayscale = true,
    stats = [],
    logosLabel = "Customer logos",
    logo: logoSnippet,
    id,
    class: className,
    ...rest
  }: Props = $props();

  const generatedId = $props.id();
  const baseId = $derived(id ?? generatedId);
  const layout = $derived(layouts[variant]);
  const tone = $derived(grayscale ? tones.gray : tones.color);
</script>

{#snippet logoContent(logo: LogoCloudLogo, index: number)}
  {#if logoSnippet}
    {@render logoSnippet(logo, index)}
  {:else}
    {@const wordmark = showsWordmark(logo)}
    {#if logo.path}
      <svg
        class={mark}
        viewBox={logo.viewBox ?? "0 0 24 24"}
        fill="currentColor"
        role={wordmark ? undefined : "img"}
        aria-label={wordmark ? undefined : logo.name}
        aria-hidden={wordmark ? "true" : undefined}
      >
        <path d={logo.path} />
      </svg>
    {/if}
    {#if wordmark}<span>{logo.name}</span>{/if}
  {/if}
{/snippet}

{#snippet list(copyIndex: number)}
  <ul
    role="list"
    aria-hidden={copyIndex > 0 ? "true" : undefined}
    inert={copyIndex > 0}
    class={[layout.list, copyIndex > 0 && copy]}
  >
    {#each logos as logo, index (logo.name)}
      <li class={layout.item}>
        {#if logo.href}
          <a href={safeHref(logo.href)} class={[logoBase, tone]}
            >{@render logoContent(logo, index)}</a
          >
        {:else}
          <span class={[logoBase, tone]}
            >{@render logoContent(logo, index)}</span
          >
        {/if}
        {#if variant === "cards" && logo.quote}
          <blockquote class={quote}>{logo.quote}</blockquote>
        {/if}
        {#if variant === "cards" && logo.author}
          <p class={author}>{logo.author}</p>
        {/if}
      </li>
    {/each}
  </ul>
{/snippet}

{#snippet titleElement()}
  {#if title}
    <h2 id={`${baseId}-title`} class={layout.title}>{title}</h2>
  {/if}
{/snippet}

<section
  id={baseId}
  aria-labelledby={title ? `${baseId}-title` : undefined}
  aria-label={title ? undefined : logosLabel}
  class={[root, className]}
  {...rest}
>
  <div class={layout.root}>
    {#if variant === "stats"}
      <div class={header}>
        {@render titleElement()}
        {#if stats.length}
          <dl class={statList}>
            {#each stats as entry (entry.label)}
              <div class={stat}>
                <dt class={statLabel}>{entry.label}</dt>
                <dd class={statValue}>{entry.value}</dd>
              </div>
            {/each}
          </dl>
        {/if}
      </div>
    {:else}
      {@render titleElement()}
    {/if}
    {#if variant === "marquee"}
      <div class={viewport}>
        {@html `<style>${keyframes}</style>`}
        <div class={track}>
          {#each COPIES as copyIndex (copyIndex)}
            {@render list(copyIndex)}
          {/each}
        </div>
      </div>
    {:else}
      {@render list(0)}
    {/if}
  </div>
</section>
```

```svelte
<script lang="ts">
  import LogoCloud from "$lib/components/markas/LogoCloud.svelte";
</script>

<LogoCloud title="Trusted by teams across Indonesia" {logos} />

<LogoCloud variant="marquee" {logos}>
  {#snippet logo(item)}
    <img src={`/logos/${item.name}.svg`} alt={item.name} class="h-7" />
  {/snippet}
</LogoCloud>
```

### Astro

Save at `src/components/markas/LogoCloud.astro`. No extra dependencies.

```astro
---
import type { HTMLAttributes } from "astro/types";

const root = "@container w-full";
const layouts = {
  row: {
    root: "grid gap-8",
    title: "text-center text-sm font-medium text-muted",
    list: "flex flex-wrap items-center justify-center gap-x-10 gap-y-6",
    item: "flex",
  },
  grid: {
    root: "grid gap-8",
    title: "text-center text-sm font-medium text-muted",
    list: "grid grid-cols-2 gap-px overflow-hidden rounded-xl border border-line bg-line @lg:grid-cols-3 @3xl:grid-cols-4",
    item: "flex h-24 items-center justify-center bg-surface px-4",
  },
  marquee: {
    root: "grid gap-8",
    title: "text-center text-sm font-medium text-muted",
    list: "flex shrink-0 items-center gap-12 pr-12 motion-reduce:w-full motion-reduce:flex-wrap motion-reduce:justify-center motion-reduce:gap-y-6 motion-reduce:pr-0",
    item: "flex",
  },
  cards: {
    root: "grid gap-8",
    title: "text-center text-sm font-medium text-muted",
    list: "grid gap-4 @xl:grid-cols-2 @3xl:grid-cols-3",
    item: "flex flex-col items-start gap-4 rounded-xl border border-line bg-surface p-5",
  },
  stats: {
    root: "grid items-center gap-8 @2xl:grid-cols-[2fr_3fr] @2xl:gap-12",
    title: "text-2xl font-semibold tracking-tight text-balance text-ink",
    list: "grid grid-cols-2 items-center gap-x-8 gap-y-6 @lg:grid-cols-3",
    item: "flex",
  },
};
const viewport =
  "group overflow-hidden mask-x-from-80% motion-reduce:mask-none";
const track =
  "flex w-max animate-[markas-logo-cloud_30s_linear_infinite] group-focus-within:[animation-play-state:paused] group-hover:[animation-play-state:paused] motion-reduce:w-full motion-reduce:animate-none";
const copy = "motion-reduce:hidden";
const keyframes = "@keyframes markas-logo-cloud{to{translate:-50% 0}}";
const header = "grid gap-6";
const statList = "grid grid-cols-2 gap-6";
const stat = "flex flex-col-reverse gap-1";
const statValue = "text-3xl font-semibold tracking-tight text-ink";
const statLabel = "text-sm text-muted";
const logoBase =
  "inline-flex items-center gap-2 rounded-md text-lg font-semibold tracking-tight whitespace-nowrap focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary";
const tones = {
  gray: "text-muted grayscale transition-[color,filter] duration-200 ease-out hover:text-ink hover:grayscale-0 motion-reduce:transition-none",
  color: "text-ink",
};
const mark = "h-7 w-auto shrink-0";
const quote = "text-sm text-pretty text-ink";
const author = "mt-auto text-xs text-muted";
const COPIES = [0, 1];

/** Hrefs with a scheme other than http, https, mailto, and tel (javascript: for one) become "#". Spaces and control characters are ignored, as browsers do. */
const safeHref = (href: string) =>
  /^(?!https?:|mailto:|tel:)[a-z][\w+.-]*:/i.test(href.replace(/[\0- ]/g, ""))
    ? "#"
    : href;

export type LogoCloudLogo = {
  name: string;
  href?: string;
  /** SVG path (d attribute) filled with currentColor. */
  path?: string;
  viewBox?: string;
  /** Show the name as text next to the path. false: SVG only, the name becomes aria-label. */
  wordmark?: boolean;
  quote?: string;
  author?: string;
};
export type LogoCloudStat = { value: string; label: string };
export type LogoCloudVariant = keyof typeof layouts;

type Props = Omit<HTMLAttributes<"section">, "title"> & {
  logos: LogoCloudLogo[];
  title?: string;
  variant?: LogoCloudVariant;
  grayscale?: boolean;
  stats?: LogoCloudStat[];
  logosLabel?: string;
};

const {
  logos,
  title = "",
  variant = "row",
  grayscale = true,
  stats = [],
  logosLabel = "Customer logos",
  id,
  class: className,
  ...rest
} = Astro.props;
const baseId = id ?? `markas-logo-cloud-${crypto.randomUUID().slice(0, 8)}`;
const layout = layouts[variant];
const tone = grayscale ? tones.gray : tones.color;
// A function as the child, (logo, index) => markup, replaces the content of each logo.
const custom = Astro.slots.has("default")
  ? await Promise.all(
      logos.map((logo, index) => Astro.slots.render("default", [logo, index])),
    )
  : [];
const lists = variant === "marquee" ? COPIES : [0];
const items = logos.map((logo, index) => ({
  logo,
  html: custom[index] ?? "",
  wordmark: logo.wordmark !== false || !logo.path,
}));
---

<section
  id={baseId}
  aria-labelledby={title ? `${baseId}-title` : undefined}
  aria-label={title ? undefined : logosLabel}
  class:list={[root, className]}
  {...rest}
>
  <div class={layout.root}>
    {
      variant === "stats" ? (
        <div class={header}>
          {title && (
            <h2 id={`${baseId}-title`} class={layout.title}>
              {title}
            </h2>
          )}
          {stats.length > 0 && (
            <dl class={statList}>
              {stats.map((entry) => (
                <div class={stat}>
                  <dt class={statLabel}>{entry.label}</dt>
                  <dd class={statValue}>{entry.value}</dd>
                </div>
              ))}
            </dl>
          )}
        </div>
      ) : (
        title && (
          <h2 id={`${baseId}-title`} class={layout.title}>
            {title}
          </h2>
        )
      )
    }
    {
      (() => {
        const rendered = lists.map((copyIndex) => (
          <ul
            role="list"
            aria-hidden={copyIndex > 0 ? "true" : undefined}
            inert={copyIndex > 0}
            class:list={[layout.list, copyIndex > 0 && copy]}
          >
            {items.map(({ logo, html, wordmark }) => {
              const Tag = logo.href ? "a" : "span";
              return (
                <li class={layout.item}>
                  <Tag
                    href={logo.href ? safeHref(logo.href) : undefined}
                    class:list={[logoBase, tone]}
                  >
                    {html ? (
                      <Fragment set:html={html} />
                    ) : (
                      <>
                        {logo.path && (
                          <svg
                            class={mark}
                            viewBox={logo.viewBox ?? "0 0 24 24"}
                            fill="currentColor"
                            role={wordmark ? undefined : "img"}
                            aria-label={wordmark ? undefined : logo.name}
                            aria-hidden={wordmark ? "true" : undefined}
                          >
                            <path d={logo.path} />
                          </svg>
                        )}
                        {wordmark && <span>{logo.name}</span>}
                      </>
                    )}
                  </Tag>
                  {variant === "cards" && logo.quote && (
                    <blockquote class={quote}>{logo.quote}</blockquote>
                  )}
                  {variant === "cards" && logo.author && (
                    <p class={author}>{logo.author}</p>
                  )}
                </li>
              );
            })}
          </ul>
        ));
        return variant === "marquee" ? (
          <div class={viewport}>
            <style is:inline set:html={keyframes} />
            <div class={track}>{rendered}</div>
          </div>
        ) : (
          rendered
        );
      })()
    }
  </div>
</section>
```

```astro
---
import LogoCloud from "@/components/markas/LogoCloud.astro";
---

<LogoCloud title="Trusted by teams across Indonesia" logos={logos} />

<LogoCloud variant="marquee" logos={logos}>
  {(logo) => <img src={`/logos/${logo.name}.svg`} alt={logo.name} class="h-7" />}
</LogoCloud>
```

### Angular

Save at `src/app/markas/logo-cloud.component.ts`. No extra dependencies.

```ts
import { NgTemplateOutlet } from "@angular/common";
import {
  booleanAttribute,
  ChangeDetectionStrategy,
  Component,
  computed,
  contentChild,
  input,
  TemplateRef,
  ViewEncapsulation,
} from "@angular/core";

const root = "@container w-full";
const layouts = {
  row: {
    root: "grid gap-8",
    title: "text-center text-sm font-medium text-muted",
    list: "flex flex-wrap items-center justify-center gap-x-10 gap-y-6",
    item: "flex",
  },
  grid: {
    root: "grid gap-8",
    title: "text-center text-sm font-medium text-muted",
    list: "grid grid-cols-2 gap-px overflow-hidden rounded-xl border border-line bg-line @lg:grid-cols-3 @3xl:grid-cols-4",
    item: "flex h-24 items-center justify-center bg-surface px-4",
  },
  marquee: {
    root: "grid gap-8",
    title: "text-center text-sm font-medium text-muted",
    list: "flex shrink-0 items-center gap-12 pr-12 motion-reduce:w-full motion-reduce:flex-wrap motion-reduce:justify-center motion-reduce:gap-y-6 motion-reduce:pr-0",
    item: "flex",
  },
  cards: {
    root: "grid gap-8",
    title: "text-center text-sm font-medium text-muted",
    list: "grid gap-4 @xl:grid-cols-2 @3xl:grid-cols-3",
    item: "flex flex-col items-start gap-4 rounded-xl border border-line bg-surface p-5",
  },
  stats: {
    root: "grid items-center gap-8 @2xl:grid-cols-[2fr_3fr] @2xl:gap-12",
    title: "text-2xl font-semibold tracking-tight text-balance text-ink",
    list: "grid grid-cols-2 items-center gap-x-8 gap-y-6 @lg:grid-cols-3",
    item: "flex",
  },
};
const viewport =
  "group overflow-hidden mask-x-from-80% motion-reduce:mask-none";
const track =
  "flex w-max animate-[markas-logo-cloud_30s_linear_infinite] group-focus-within:[animation-play-state:paused] group-hover:[animation-play-state:paused] motion-reduce:w-full motion-reduce:animate-none";
const copy = "motion-reduce:hidden";
const keyframes = "@keyframes markas-logo-cloud{to{translate:-50% 0}}";
const header = "grid gap-6";
const statList = "grid grid-cols-2 gap-6";
const stat = "flex flex-col-reverse gap-1";
const statValue = "text-3xl font-semibold tracking-tight text-ink";
const statLabel = "text-sm text-muted";
const logoBase =
  "inline-flex items-center gap-2 rounded-md text-lg font-semibold tracking-tight whitespace-nowrap focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary";
const tones = {
  gray: "text-muted grayscale transition-[color,filter] duration-200 ease-out hover:text-ink hover:grayscale-0 motion-reduce:transition-none",
  color: "text-ink",
};
const mark = "h-7 w-auto shrink-0";
const quote = "text-sm text-pretty text-ink";
const author = "mt-auto text-xs text-muted";
const COPIES = [0, 1];

/** Hrefs with a scheme other than http, https, mailto, and tel (javascript: for one) become "#". Spaces and control characters are ignored, as browsers do. */
const safeHref = (href: string) =>
  /^(?!https?:|mailto:|tel:)[a-z][\w+.-]*:/i.test(href.replace(/[\0- ]/g, ""))
    ? "#"
    : href;

export type LogoCloudLogo = {
  name: string;
  href?: string;
  /** SVG path (d attribute) filled with currentColor. */
  path?: string;
  viewBox?: string;
  /** Show the name as text next to the path. false: SVG only, the name becomes aria-label. */
  wordmark?: boolean;
  quote?: string;
  author?: string;
};
export type LogoCloudStat = { value: string; label: string };
export type LogoCloudVariant = keyof typeof layouts;

let nextId = 0;

/**
 * An ng-template child replaces the content of each logo (context: the logo, plus `index`).
 * Host stays out of layout; id, title, and class move to the section. The marquee keyframes
 * are a global style, so encapsulation is off.
 */
@Component({
  selector: "markas-logo-cloud",
  changeDetection: ChangeDetectionStrategy.OnPush,
  encapsulation: ViewEncapsulation.None,
  imports: [NgTemplateOutlet],
  styles: [keyframes],
  host: { class: "contents", "[attr.id]": "null", "[attr.title]": "null" },
  template: `
    <ng-template #titleElement>
      @if (title()) {
        <h2 [id]="baseId() + '-title'" [class]="layout().title">
          {{ title() }}
        </h2>
      }
    </ng-template>
    <ng-template #list let-copyIndex>
      <ul
        role="list"
        [attr.aria-hidden]="copyIndex > 0 ? 'true' : null"
        [attr.inert]="copyIndex > 0 ? '' : null"
        [class]="copyIndex > 0 ? listCopyClasses() : layout().list"
      >
        @for (logo of logos(); track logo.name; let index = $index) {
          <li [class]="layout().item">
            @if (logo.href) {
              <a [href]="safeHref(logo.href)" [class]="logoClasses()"
                ><ng-container
                  [ngTemplateOutlet]="logoContent"
                  [ngTemplateOutletContext]="{ $implicit: logo, index }"
              /></a>
            } @else {
              <span [class]="logoClasses()"
                ><ng-container
                  [ngTemplateOutlet]="logoContent"
                  [ngTemplateOutletContext]="{ $implicit: logo, index }"
              /></span>
            }
            @if (variant() === "cards" && logo.quote) {
              <blockquote [class]="quote">{{ logo.quote }}</blockquote>
            }
            @if (variant() === "cards" && logo.author) {
              <p [class]="author">{{ logo.author }}</p>
            }
          </li>
        }
      </ul>
    </ng-template>
    <ng-template #logoContent let-logo let-index="index">
      @if (customLogo(); as custom) {
        <ng-container
          [ngTemplateOutlet]="custom"
          [ngTemplateOutletContext]="{ $implicit: logo, index }"
        />
      } @else {
        @if (logo.path) {
          <svg
            [class]="mark"
            [attr.viewBox]="logo.viewBox ?? '0 0 24 24'"
            fill="currentColor"
            [attr.role]="showsWordmark(logo) ? null : 'img'"
            [attr.aria-label]="showsWordmark(logo) ? null : logo.name"
            [attr.aria-hidden]="showsWordmark(logo) ? 'true' : null"
          >
            <path [attr.d]="logo.path" />
          </svg>
        }
        @if (showsWordmark(logo)) {
          <span>{{ logo.name }}</span>
        }
      }
    </ng-template>
    <section
      [id]="baseId()"
      [attr.aria-labelledby]="title() ? baseId() + '-title' : null"
      [attr.aria-label]="title() ? null : logosLabel()"
      [class]="rootClasses()"
    >
      <div [class]="layout().root">
        @if (variant() === "stats") {
          <div [class]="header">
            <ng-container [ngTemplateOutlet]="titleElement" />
            @if (stats().length) {
              <dl [class]="statList">
                @for (entry of stats(); track entry.label) {
                  <div [class]="stat">
                    <dt [class]="statLabel">{{ entry.label }}</dt>
                    <dd [class]="statValue">{{ entry.value }}</dd>
                  </div>
                }
              </dl>
            }
          </div>
        } @else {
          <ng-container [ngTemplateOutlet]="titleElement" />
        }
        @if (variant() === "marquee") {
          <div [class]="viewport">
            <div [class]="track">
              @for (copyIndex of copies; track copyIndex) {
                <ng-container
                  [ngTemplateOutlet]="list"
                  [ngTemplateOutletContext]="{ $implicit: copyIndex }"
                />
              }
            </div>
          </div>
        } @else {
          <ng-container
            [ngTemplateOutlet]="list"
            [ngTemplateOutletContext]="{ $implicit: 0 }"
          />
        }
      </div>
    </section>
  `,
})
export class LogoCloud {
  readonly logos = input.required<LogoCloudLogo[]>();
  readonly title = input("");
  readonly variant = input<LogoCloudVariant>("row");
  readonly grayscale = input(true, { transform: booleanAttribute });
  readonly stats = input<LogoCloudStat[]>([]);
  readonly logosLabel = input("Customer logos");
  readonly id = input<string>();
  readonly userClass = input("", { alias: "class" });

  protected readonly customLogo = contentChild(TemplateRef);
  protected readonly viewport = viewport;
  protected readonly track = track;
  protected readonly header = header;
  protected readonly statList = statList;
  protected readonly stat = stat;
  protected readonly statValue = statValue;
  protected readonly statLabel = statLabel;
  protected readonly mark = mark;
  protected readonly quote = quote;
  protected readonly author = author;
  protected readonly copies = COPIES;
  protected readonly safeHref = safeHref;

  private readonly generatedId = `markas-logo-cloud-${nextId++}`;
  protected readonly baseId = computed(() => this.id() ?? this.generatedId);
  protected readonly layout = computed(() => layouts[this.variant()]);
  protected readonly listCopyClasses = computed(
    () => `${this.layout().list} ${copy}`,
  );
  protected readonly logoClasses = computed(
    () => `${logoBase} ${this.grayscale() ? tones.gray : tones.color}`,
  );
  protected readonly rootClasses = computed(() =>
    [root, this.userClass()].filter(Boolean).join(" "),
  );

  protected showsWordmark(logo: LogoCloudLogo) {
    return logo.wordmark !== false || !logo.path;
  }
}
```

```ts
import { Component } from "@angular/core";
import { LogoCloud, type LogoCloudLogo } from "./markas/logo-cloud.component";

@Component({
  selector: "app-customers",
  imports: [LogoCloud],
  template: `
    <markas-logo-cloud
      title="Trusted by teams across Indonesia"
      [logos]="logos"
    />

    <markas-logo-cloud variant="marquee" [logos]="logos">
      <ng-template let-logo>
        <img
          [src]="'/logos/' + logo.name + '.svg'"
          [alt]="logo.name"
          class="h-7"
        />
      </ng-template>
    </markas-logo-cloud>
  `,
})
export class Customers {
  logos: LogoCloudLogo[] = [];
}
```

## Props

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `logos` | `{ name: string; href?: string; path?: string; viewBox?: string; wordmark?: boolean; quote?: string; author?: string }[]` | [] | Logos. path is an SVG path filled with currentColor; the name shows as a wordmark unless wordmark is false. Custom markup: React logo field, Vue logo slot, Blade slot named after the array key, Svelte logo snippet, Astro function child (logo, index), Angular ng-template child. |
| `title` | `string` | '' | Section heading (h2), for example "Trusted by 2,000+ teams". |
| `variant` | `'row' \| 'grid' \| 'marquee' \| 'cards' \| 'stats'` | 'row' | Layout: a wrapping row, a lined grid, an endless CSS marquee, cards with a short quote, or a heading with big numbers beside the logos. |
| `grayscale` | `boolean` | true | Muted grayscale logos that turn full colour on hover. |
| `stats` | `{ value: string; label: string }[]` | [] | Numbers shown beside the logos (stats). |
| `logosLabel` | `string` | 'Customer logos' | Accessible name of the section when there is no title. |

## Accessibility

- Every logo has a name: visible wordmark text, or role img with aria-label when only the SVG is shown.
- The second marquee copy is aria-hidden and inert, so screen readers and the keyboard meet each logo once.
- The marquee pauses on hover and on focus inside, and stops and wraps with reduced motion.
- Linked logos get a visible focus outline and unsafe href schemes are replaced with #.

## Notes

- No JavaScript in any variant. The marquee is a CSS animation that pauses on hover and focus, fades at the edges, and wraps in place with reduced motion.
- The marquee repeats the list once; the copy is `aria-hidden` and `inert`.
- Logos drawn with `path` use `currentColor`, so they follow light and dark themes. With `grayscale`, images in custom markup are desaturated until hover.
- Layouts react to the section width through container queries.
