# Footer

Site footer with six layouts: link columns, centered glow, newsletter pill card, giant cropped wordmark, dark glowing call to action, and a floating pill.

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

## When to use

The bottom of a marketing site, landing page, docs site, or app shell, to group secondary navigation, legal links, and social profiles.

- Use columns for sites with many pages, centered or compact when there are only a few links
- Use cta only on landing pages, with at most two buttons in actions
- Keep column titles short nouns and limit each column to about six links
- The built-in newsletter form does not send data; pass the newsletter slot with your own form to actually subscribe people
- Pass a 24px stroke icon path for each social link and a clear label such as LinkedIn

## Code

### Blade

Save at `resources/views/components/markas/footer.blade.php`. Dependencies: alpinejs.

```blade
@props([
    'variant' => 'columns',
    'description' => null,
    'columns' => [],
    'socials' => [],
    'legal' => [],
    'copyright' => null,
    'heading' => null,
    'newsletterDescription' => null,
    'wordmark' => '',
    'backToTop' => false,
    'navLabel' => 'Footer',
    'legalLabel' => 'Legal',
    'socialLabel' => 'Social media',
    'newsletterLabel' => 'Subscribe to our newsletter',
    'emailLabel' => 'Email address',
    'subscribeLabel' => 'Subscribe',
    'successLabel' => 'Thanks for subscribing',
    'backToTopLabel' => 'Back to top',
])

@php
    $root = '@container w-full border-t border-line bg-canvas text-sm text-muted **:focus-visible:outline-2 **:focus-visible:outline-offset-2 **:focus-visible:outline-primary motion-reduce:**:transition-none';
    $wrap = 'grid gap-12 px-4 py-14 @2xl:px-8';
    $main = 'grid gap-10 @3xl:grid-cols-[minmax(0,2fr)_minmax(0,3fr)]';
    $brandArea = 'grid max-w-sm content-start gap-4';
    $bottom = 'flex flex-col gap-4 border-t border-line pt-6 @2xl:flex-row @2xl:items-center';
    $row = 'flex flex-wrap items-center justify-between gap-6';
    $stack = 'grid justify-items-center gap-4';
    $contents = 'contents';
    // Tata letak tiap varian: [footer, baris utama, area brand, baris bawah].
    $layouts = [
        'columns' => [$wrap, $main, $brandArea, $bottom],
        'newsletter' => [$wrap, $main, $brandArea, $bottom],
        'big-brand' => ['grid gap-12 overflow-hidden bg-linear-to-b to-primary-soft px-4 pt-14 @2xl:px-8', $main, $brandArea, $bottom],
        'centered' => ['grid justify-items-center gap-8 bg-radial-[at_top] from-primary-soft to-70% px-4 py-14 text-center', 'grid justify-items-center gap-6', 'grid max-w-md justify-items-center gap-3', $stack],
        'cta' => [$wrap, $row, $contents, $bottom],
        'compact' => ['flex flex-wrap items-center gap-x-5 gap-y-2 rounded-3xl border px-5 py-3 shadow-overlay @xl:rounded-full', $contents, $contents, $contents],
    ];
    $brandClass = 'flex items-center gap-2 text-base font-semibold text-ink';
    $descriptionClass = 'leading-relaxed';
    $actionsClass = 'flex flex-wrap items-center gap-2';
    $columnsNav = 'grid grid-cols-2 gap-x-6 gap-y-8 @xl:grid-cols-[repeat(auto-fit,minmax(7rem,1fr))]';
    $columnTitle = 'font-medium text-ink';
    $columnList = 'mt-4 grid gap-2.5';
    $flatList = 'flex flex-wrap justify-center gap-x-6 gap-y-2';
    $link = 'rounded-sm transition-colors duration-150 ease-out hover:text-ink';
    $copyrightClass = '@2xl:mr-auto';
    $legalList = 'flex flex-wrap gap-x-4 gap-y-2';
    $socialList = 'flex items-center gap-1';
    $socialLink = 'inline-flex size-9 items-center justify-center rounded-full border border-line bg-surface transition-colors duration-150 ease-out hover:border-primary-line hover:text-ink';
    $icon = 'size-4';
    $topLink = 'inline-flex h-8 items-center gap-1.5 rounded-full border border-line px-3 font-medium text-ink transition-colors duration-150 ease-out hover:bg-subtle';
    $card = 'grid gap-6 rounded-3xl border border-line bg-linear-to-br from-surface to-primary-soft p-6 @3xl:grid-cols-2 @3xl:items-center @3xl:p-10';
    $cardTitle = 'text-xl font-semibold tracking-tight text-balance text-ink';
    $cardText = 'mt-1.5 leading-relaxed';
    $form = 'grid gap-3';
    $field = 'flex items-center gap-1 rounded-full border border-line bg-canvas p-1 shadow-xs';
    $input = 'h-10 w-0 flex-1 rounded-full bg-transparent px-4 text-ink placeholder:text-faint';
    $button = 'h-10 shrink-0 cursor-pointer rounded-full bg-primary px-5 font-medium text-on-primary transition-colors duration-150 ease-out hover:bg-primary-strong';
    $status = 'flex items-center gap-2 px-4 font-medium text-ink before:size-1.5 before:rounded-full before:bg-success empty:sr-only';
    $cta = 'dark grid justify-items-start gap-6 rounded-3xl border border-line bg-surface bg-radial-[at_top_right] from-success/30 to-60% p-6 text-muted @2xl:p-12';
    $ctaTitle = 'max-w-xl text-2xl font-semibold tracking-tight text-balance text-ink @2xl:text-4xl';
    $ctaText = 'mt-3 max-w-lg text-base leading-relaxed';
    $wordmarkBox = '-mx-4 h-[0.6em] overflow-hidden text-[calc(200cqw/var(--chars))] leading-none select-none @2xl:-mx-8';
    $wordmarkText = '-mt-[0.08em] bg-linear-to-b from-ink via-ink/50 bg-clip-text text-center font-semibold tracking-tighter whitespace-nowrap text-transparent';
    $svg = 'viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"';

    [$footerClass, $mainClass, $brandAreaClass, $bottomClass] = $layouts[$variant] ?? $layouts['columns'];
    $hasColumns = $mainClass === $main;
    $isCta = $variant === 'cta';
    $isCentered = $variant === 'centered';
    $links = array_merge(...array_map(fn ($column) => $column['links'] ?? [], array_values($columns ?: [[]])));

    // Href berskema selain http, https, mailto, dan tel (misalnya javascript:) diganti "#".
    $safeHref = function (?string $href): string {
        $href ??= '#';
        $value = preg_replace('/[\x00-\x20]/', '', $href);

        return preg_match('/^(?!https?:|mailto:|tel:)[a-z][\w+.\-]*:/i', $value) === 1 ? '#' : $href;
    };
@endphp

@php
    ob_start();
@endphp
@if (count($socials) > 0)
    <ul aria-label="{{ $socialLabel }}" class="{{ $socialList }}">
        @foreach ($socials as $social)
            <li>
                <a href="{{ $safeHref($social['href'] ?? null) }}" aria-label="{{ $social['label'] }}" class="{{ $socialLink }}">
                    <svg class="{{ $icon }}" {!! $svg !!}><path d="{{ $social['icon'] }}" /></svg>
                </a>
            </li>
        @endforeach
    </ul>
@endif
@php
    $socialsList = ob_get_clean();
@endphp

<footer {{ $attributes->class([$root, $footerClass]) }}>
    @if ($variant === 'newsletter')
        <div class="{{ $card }}">
            <div>
                <h2 class="{{ $cardTitle }}">{{ $newsletterLabel }}</h2>
                @if ($newsletterDescription)
                    <p class="{{ $cardText }}">{{ $newsletterDescription }}</p>
                @endif
            </div>
            @isset($newsletter)
                {{ $newsletter }}
            @else
                <form class="{{ $form }}" x-data="{ subscribed: false }" x-on:submit.prevent="$el.reset(); subscribed = true">
                    <div class="{{ $field }}">
                        <input type="email" name="email" required autocomplete="email" aria-label="{{ $emailLabel }}" placeholder="{{ $emailLabel }}" class="{{ $input }}" />
                        <button type="submit" class="{{ $button }}">{{ $subscribeLabel }}</button>
                    </div>
                    <p role="status" class="{{ $status }}" data-message="{{ $successLabel }}" x-text="subscribed ? $el.dataset.message : ''"></p>
                </form>
            @endisset
        </div>
    @endif
    @if ($isCta)
        <div class="{{ $cta }}">
            <div>
                @if ($heading)
                    <h2 class="{{ $ctaTitle }}">{{ $heading }}</h2>
                @endif
                @if ($description)
                    <p class="{{ $ctaText }}">{{ $description }}</p>
                @endif
            </div>
            @isset($actions)
                <div class="{{ $actionsClass }}">{{ $actions }}</div>
            @endisset
        </div>
    @endif
    <div class="{{ $mainClass }}">
        <div class="{{ $brandAreaClass }}">
            @isset($brand)
                <div class="{{ $brandClass }}">{{ $brand }}</div>
            @endisset
            @if ($description && ! $isCta && $variant !== 'compact')
                <p class="{{ $descriptionClass }}">{{ $description }}</p>
            @endif
            @if (isset($actions) && ! $isCta)
                <div class="{{ $actionsClass }}">{{ $actions }}</div>
            @endif
        </div>
        @if (count($links) > 0)
            <nav aria-label="{{ $navLabel }}" @if ($hasColumns) class="{{ $columnsNav }}" @endif>
                @if ($hasColumns)
                    @foreach ($columns as $column)
                        <div>
                            @if (! empty($column['title']))
                                <h2 class="{{ $columnTitle }}">{{ $column['title'] }}</h2>
                            @endif
                            <ul class="{{ $columnList }}">
                                @foreach ($column['links'] as $item)
                                    <li><a href="{{ $safeHref($item['href'] ?? null) }}" class="{{ $link }}">{{ $item['label'] }}</a></li>
                                @endforeach
                            </ul>
                        </div>
                    @endforeach
                @else
                    <ul class="{{ $flatList }}">
                        @foreach ($links as $item)
                            <li><a href="{{ $safeHref($item['href'] ?? null) }}" class="{{ $link }}">{{ $item['label'] }}</a></li>
                        @endforeach
                    </ul>
                @endif
            </nav>
        @endif
    </div>
    <div class="{{ $bottomClass }}">
        @if ($isCentered)
            {!! $socialsList !!}
        @endif
        @if ($copyright)
            <p class="{{ $copyrightClass }}">{{ $copyright }}</p>
        @endif
        @if (count($legal) > 0)
            <nav aria-label="{{ $legalLabel }}">
                <ul class="{{ $legalList }}">
                    @foreach ($legal as $item)
                        <li><a href="{{ $safeHref($item['href'] ?? null) }}" class="{{ $link }}">{{ $item['label'] }}</a></li>
                    @endforeach
                </ul>
            </nav>
        @endif
        @unless ($isCentered)
            {!! $socialsList !!}
        @endunless
        @if ($backToTop)
            <a href="#top" class="{{ $topLink }}">{{ $backToTopLabel }}<svg class="{{ $icon }}" {!! $svg !!}><path d="M12 19V5M5 12l7-7 7 7" /></svg></a>
        @endif
    </div>
    @if ($variant === 'big-brand' && $wordmark !== '')
        <div aria-hidden="true" class="{{ $wordmarkBox }}" style="--chars: {{ mb_strlen($wordmark) }}">
            <p class="{{ $wordmarkText }}">{{ $wordmark }}</p>
        </div>
    @endif
</footer>
```

```blade
<x-markas.footer
    description="UI components for Blade, React, and Vue."
    copyright="© 2026 MarkasUI"
    :back-to-top="true"
    :columns="[
        ['title' => 'Product', 'links' => [
            ['label' => 'Components', 'href' => '/components'],
            ['label' => 'Templates', 'href' => '/templates'],
        ]],
        ['title' => 'Company', 'links' => [
            ['label' => 'About', 'href' => '/about'],
            ['label' => 'Careers', 'href' => '/careers'],
        ]],
    ]"
    :socials="[
        ['label' => 'X', 'href' => 'https://x.com/markasui', 'icon' => 'M4 4l11.7 16H20L8.3 4H4zM4 20l6.8-6.8M13.2 10.8 20 4'],
    ]"
    :legal="[
        ['label' => 'Privacy', 'href' => '/privacy'],
        ['label' => 'Terms', 'href' => '/terms'],
    ]"
>
    <x-slot:brand>MarkasUI</x-slot:brand>
</x-markas.footer>

{{-- Landing page closer --}}
<x-markas.footer variant="cta" heading="Ship your next interface this week" copyright="© 2026 MarkasUI">
    <x-slot:brand>MarkasUI</x-slot:brand>
    <x-slot:actions>
        <x-markas.button>Browse components</x-markas.button>
        <x-markas.button variant="secondary">Read the docs</x-markas.button>
    </x-slot:actions>
</x-markas.footer>
```

Only the built-in newsletter form needs Alpine.js. Every other variant is plain HTML.

### React

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

```tsx
"use client";

import {
  useState,
  type ComponentProps,
  type CSSProperties,
  type FormEvent,
  type ReactNode,
} from "react";

const root =
  "@container w-full border-t border-line bg-canvas text-sm text-muted **:focus-visible:outline-2 **:focus-visible:outline-offset-2 **:focus-visible:outline-primary motion-reduce:**:transition-none";
const wrap = "grid gap-12 px-4 py-14 @2xl:px-8";
const main = "grid gap-10 @3xl:grid-cols-[minmax(0,2fr)_minmax(0,3fr)]";
const brandArea = "grid max-w-sm content-start gap-4";
const bottom =
  "flex flex-col gap-4 border-t border-line pt-6 @2xl:flex-row @2xl:items-center";
const row = "flex flex-wrap items-center justify-between gap-6";
const stack = "grid justify-items-center gap-4";
const contents = "contents";
/** Tata letak tiap varian: [footer, baris utama, area brand, baris bawah]. */
const layouts = {
  columns: [wrap, main, brandArea, bottom],
  newsletter: [wrap, main, brandArea, bottom],
  "big-brand": [
    "grid gap-12 overflow-hidden bg-linear-to-b to-primary-soft px-4 pt-14 @2xl:px-8",
    main,
    brandArea,
    bottom,
  ],
  centered: [
    "grid justify-items-center gap-8 bg-radial-[at_top] from-primary-soft to-70% px-4 py-14 text-center",
    "grid justify-items-center gap-6",
    "grid max-w-md justify-items-center gap-3",
    stack,
  ],
  cta: [wrap, row, contents, bottom],
  compact: [
    "flex flex-wrap items-center gap-x-5 gap-y-2 rounded-3xl border px-5 py-3 shadow-overlay @xl:rounded-full",
    contents,
    contents,
    contents,
  ],
};
const brandClass = "flex items-center gap-2 text-base font-semibold text-ink";
const descriptionClass = "leading-relaxed";
const actionsClass = "flex flex-wrap items-center gap-2";
const columnsNav =
  "grid grid-cols-2 gap-x-6 gap-y-8 @xl:grid-cols-[repeat(auto-fit,minmax(7rem,1fr))]";
const columnTitle = "font-medium text-ink";
const columnList = "mt-4 grid gap-2.5";
const flatList = "flex flex-wrap justify-center gap-x-6 gap-y-2";
const link =
  "rounded-sm transition-colors duration-150 ease-out hover:text-ink";
const copyrightClass = "@2xl:mr-auto";
const legalList = "flex flex-wrap gap-x-4 gap-y-2";
const socialList = "flex items-center gap-1";
const socialLink =
  "inline-flex size-9 items-center justify-center rounded-full border border-line bg-surface transition-colors duration-150 ease-out hover:border-primary-line hover:text-ink";
const icon = "size-4";
const topLink =
  "inline-flex h-8 items-center gap-1.5 rounded-full border border-line px-3 font-medium text-ink transition-colors duration-150 ease-out hover:bg-subtle";
const card =
  "grid gap-6 rounded-3xl border border-line bg-linear-to-br from-surface to-primary-soft p-6 @3xl:grid-cols-2 @3xl:items-center @3xl:p-10";
const cardTitle = "text-xl font-semibold tracking-tight text-balance text-ink";
const cardText = "mt-1.5 leading-relaxed";
const form = "grid gap-3";
const field =
  "flex items-center gap-1 rounded-full border border-line bg-canvas p-1 shadow-xs";
const input =
  "h-10 w-0 flex-1 rounded-full bg-transparent px-4 text-ink placeholder:text-faint";
const button =
  "h-10 shrink-0 cursor-pointer rounded-full bg-primary px-5 font-medium text-on-primary transition-colors duration-150 ease-out hover:bg-primary-strong";
const status =
  "flex items-center gap-2 px-4 font-medium text-ink before:size-1.5 before:rounded-full before:bg-success empty:sr-only";
const cta =
  "dark grid justify-items-start gap-6 rounded-3xl border border-line bg-surface bg-radial-[at_top_right] from-success/30 to-60% p-6 text-muted @2xl:p-12";
const ctaTitle =
  "max-w-xl text-2xl font-semibold tracking-tight text-balance text-ink @2xl:text-4xl";
const ctaText = "mt-3 max-w-lg text-base leading-relaxed";
const wordmarkBox =
  "-mx-4 h-[0.6em] overflow-hidden text-[calc(200cqw/var(--chars))] leading-none select-none @2xl:-mx-8";
const wordmarkText =
  "-mt-[0.08em] bg-linear-to-b from-ink via-ink/50 bg-clip-text text-center font-semibold tracking-tighter whitespace-nowrap text-transparent";

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

const svg = {
  viewBox: "0 0 24 24",
  fill: "none",
  stroke: "currentColor",
  strokeWidth: 1.5,
  strokeLinecap: "round",
  strokeLinejoin: "round",
  "aria-hidden": true,
} as const;

export type FooterLink = { label: string; href: string };
export type FooterColumn = { title?: string; links: FooterLink[] };
/** icon: data path SVG (atribut d) untuk ikon 24x24 bergaris. */
export type FooterSocial = { label: string; href: string; icon: string };
export type FooterVariant = keyof typeof layouts;

export type FooterProps = Omit<ComponentProps<"footer">, "children"> & {
  variant?: FooterVariant;
  brand?: ReactNode;
  description?: ReactNode;
  columns?: FooterColumn[];
  socials?: FooterSocial[];
  legal?: FooterLink[];
  copyright?: ReactNode;
  /** Judul blok ajakan (varian cta). */
  heading?: ReactNode;
  /** Teks di bawah judul kartu langganan (varian newsletter). */
  newsletterDescription?: ReactNode;
  /** Wordmark raksasa (varian big-brand). */
  wordmark?: string;
  backToTop?: boolean;
  /** Tombol atau konten tambahan. Varian cta: tombol di blok ajakan. */
  actions?: ReactNode;
  /** Pengganti form langganan bawaan (varian newsletter). */
  newsletter?: ReactNode;
  navLabel?: string;
  legalLabel?: string;
  socialLabel?: string;
  newsletterLabel?: string;
  emailLabel?: string;
  subscribeLabel?: string;
  successLabel?: string;
  backToTopLabel?: string;
};

const linkList = (links: FooterLink[], className: string) => (
  <ul className={className}>
    {links.map((item, index) => (
      <li key={index}>
        <a href={safeHref(item.href)} className={link}>
          {item.label}
        </a>
      </li>
    ))}
  </ul>
);

export function Footer({
  variant = "columns",
  brand,
  description,
  columns = [],
  socials = [],
  legal = [],
  copyright,
  heading,
  newsletterDescription,
  wordmark = "",
  backToTop = false,
  actions,
  newsletter,
  navLabel = "Footer",
  legalLabel = "Legal",
  socialLabel = "Social media",
  newsletterLabel = "Subscribe to our newsletter",
  emailLabel = "Email address",
  subscribeLabel = "Subscribe",
  successLabel = "Thanks for subscribing",
  backToTopLabel = "Back to top",
  className,
  ...props
}: FooterProps) {
  const [footerClass, mainClass, brandAreaClass, bottomClass] =
    layouts[variant];
  const [subscribed, setSubscribed] = useState(false);
  const isCta = variant === "cta";
  const hasColumns = mainClass === main;
  const links = columns.flatMap((column) => column.links);

  const subscribe = (event: FormEvent<HTMLFormElement>) => {
    event.preventDefault();
    event.currentTarget.reset();
    setSubscribed(true);
  };

  const socialsList = socials.length > 0 && (
    <ul aria-label={socialLabel} className={socialList}>
      {socials.map((social, index) => (
        <li key={index}>
          <a
            href={safeHref(social.href)}
            aria-label={social.label}
            className={socialLink}
          >
            <svg className={icon} {...svg}>
              <path d={social.icon} />
            </svg>
          </a>
        </li>
      ))}
    </ul>
  );

  return (
    <footer
      className={`${root} ${footerClass} ${className ?? ""}`.trim()}
      {...props}
    >
      {variant === "newsletter" && (
        <div className={card}>
          <div>
            <h2 className={cardTitle}>{newsletterLabel}</h2>
            {newsletterDescription && (
              <p className={cardText}>{newsletterDescription}</p>
            )}
          </div>
          {newsletter ?? (
            <form className={form} onSubmit={subscribe}>
              <div className={field}>
                <input
                  type="email"
                  name="email"
                  required
                  autoComplete="email"
                  aria-label={emailLabel}
                  placeholder={emailLabel}
                  className={input}
                />
                <button type="submit" className={button}>
                  {subscribeLabel}
                </button>
              </div>
              <p role="status" className={status}>
                {subscribed ? successLabel : ""}
              </p>
            </form>
          )}
        </div>
      )}
      {isCta && (
        <div className={cta}>
          <div>
            {heading && <h2 className={ctaTitle}>{heading}</h2>}
            {description && <p className={ctaText}>{description}</p>}
          </div>
          {actions && <div className={actionsClass}>{actions}</div>}
        </div>
      )}
      <div className={mainClass}>
        <div className={brandAreaClass}>
          {brand && <div className={brandClass}>{brand}</div>}
          {description && !isCta && variant !== "compact" && (
            <p className={descriptionClass}>{description}</p>
          )}
          {actions && !isCta && <div className={actionsClass}>{actions}</div>}
        </div>
        {links.length > 0 && (
          <nav
            aria-label={navLabel}
            className={hasColumns ? columnsNav : undefined}
          >
            {hasColumns
              ? columns.map((column, index) => (
                  <div key={index}>
                    {column.title && (
                      <h2 className={columnTitle}>{column.title}</h2>
                    )}
                    {linkList(column.links, columnList)}
                  </div>
                ))
              : linkList(links, flatList)}
          </nav>
        )}
      </div>
      <div className={bottomClass}>
        {variant === "centered" && socialsList}
        {copyright && <p className={copyrightClass}>{copyright}</p>}
        {legal.length > 0 && (
          <nav aria-label={legalLabel}>{linkList(legal, legalList)}</nav>
        )}
        {variant !== "centered" && socialsList}
        {backToTop && (
          <a href="#top" className={topLink}>
            {backToTopLabel}
            <svg className={icon} {...svg}>
              <path d="M12 19V5M5 12l7-7 7 7" />
            </svg>
          </a>
        )}
      </div>
      {variant === "big-brand" && wordmark && (
        <div
          aria-hidden="true"
          className={wordmarkBox}
          style={{ "--chars": wordmark.length } as CSSProperties}
        >
          <p className={wordmarkText}>{wordmark}</p>
        </div>
      )}
    </footer>
  );
}
```

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

<Footer
  brand="MarkasUI"
  description="UI components for Blade, React, and Vue."
  copyright="© 2026 MarkasUI"
  backToTop
  columns={[
    {
      title: "Product",
      links: [
        { label: "Components", href: "/components" },
        { label: "Templates", href: "/templates" },
      ],
    },
    {
      title: "Company",
      links: [
        { label: "About", href: "/about" },
        { label: "Careers", href: "/careers" },
      ],
    },
  ]}
  socials={[
    {
      label: "X",
      href: "https://x.com/markasui",
      icon: "M4 4l11.7 16H20L8.3 4H4zM4 20l6.8-6.8M13.2 10.8 20 4",
    },
  ]}
  legal={[
    { label: "Privacy", href: "/privacy" },
    { label: "Terms", href: "/terms" },
  ]}
/>;

<Footer
  variant="big-brand"
  brand="MarkasUI"
  wordmark="MarkasUI"
  copyright="© 2026 MarkasUI"
/>;
```

### Vue

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

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

export type FooterLink = { label: string; href: string };
export type FooterColumn = { title?: string; links: FooterLink[] };
/** icon: data path SVG (atribut d) untuk ikon 24x24 bergaris. */
export type FooterSocial = { label: string; href: string; icon: string };
export type FooterVariant =
  "columns" | "newsletter" | "big-brand" | "centered" | "cta" | "compact";

const props = withDefaults(
  defineProps<{
    variant?: FooterVariant;
    description?: string;
    columns?: FooterColumn[];
    socials?: FooterSocial[];
    legal?: FooterLink[];
    copyright?: string;
    /** Judul blok ajakan (varian cta). */
    heading?: string;
    /** Teks di bawah judul kartu langganan (varian newsletter). */
    newsletterDescription?: string;
    /** Wordmark raksasa (varian big-brand). */
    wordmark?: string;
    backToTop?: boolean;
    navLabel?: string;
    legalLabel?: string;
    socialLabel?: string;
    newsletterLabel?: string;
    emailLabel?: string;
    subscribeLabel?: string;
    successLabel?: string;
    backToTopLabel?: string;
  }>(),
  {
    variant: "columns",
    description: "",
    columns: () => [],
    socials: () => [],
    legal: () => [],
    copyright: "",
    heading: "",
    newsletterDescription: "",
    wordmark: "",
    backToTop: false,
    navLabel: "Footer",
    legalLabel: "Legal",
    socialLabel: "Social media",
    newsletterLabel: "Subscribe to our newsletter",
    emailLabel: "Email address",
    subscribeLabel: "Subscribe",
    successLabel: "Thanks for subscribing",
    backToTopLabel: "Back to top",
  },
);

defineSlots<{
  brand?: () => unknown;
  actions?: () => unknown;
  newsletter?: () => unknown;
}>();

const root =
  "@container w-full border-t border-line bg-canvas text-sm text-muted **:focus-visible:outline-2 **:focus-visible:outline-offset-2 **:focus-visible:outline-primary motion-reduce:**:transition-none";
const wrap = "grid gap-12 px-4 py-14 @2xl:px-8";
const main = "grid gap-10 @3xl:grid-cols-[minmax(0,2fr)_minmax(0,3fr)]";
const brandArea = "grid max-w-sm content-start gap-4";
const bottom =
  "flex flex-col gap-4 border-t border-line pt-6 @2xl:flex-row @2xl:items-center";
const row = "flex flex-wrap items-center justify-between gap-6";
const stack = "grid justify-items-center gap-4";
const contents = "contents";
/** Tata letak tiap varian: [footer, baris utama, area brand, baris bawah]. */
const layouts = {
  columns: [wrap, main, brandArea, bottom],
  newsletter: [wrap, main, brandArea, bottom],
  "big-brand": [
    "grid gap-12 overflow-hidden bg-linear-to-b to-primary-soft px-4 pt-14 @2xl:px-8",
    main,
    brandArea,
    bottom,
  ],
  centered: [
    "grid justify-items-center gap-8 bg-radial-[at_top] from-primary-soft to-70% px-4 py-14 text-center",
    "grid justify-items-center gap-6",
    "grid max-w-md justify-items-center gap-3",
    stack,
  ],
  cta: [wrap, row, contents, bottom],
  compact: [
    "flex flex-wrap items-center gap-x-5 gap-y-2 rounded-3xl border px-5 py-3 shadow-overlay @xl:rounded-full",
    contents,
    contents,
    contents,
  ],
};
const brandClass = "flex items-center gap-2 text-base font-semibold text-ink";
const descriptionClass = "leading-relaxed";
const actionsClass = "flex flex-wrap items-center gap-2";
const columnsNav =
  "grid grid-cols-2 gap-x-6 gap-y-8 @xl:grid-cols-[repeat(auto-fit,minmax(7rem,1fr))]";
const columnTitle = "font-medium text-ink";
const columnList = "mt-4 grid gap-2.5";
const flatList = "flex flex-wrap justify-center gap-x-6 gap-y-2";
const link =
  "rounded-sm transition-colors duration-150 ease-out hover:text-ink";
const copyrightClass = "@2xl:mr-auto";
const legalList = "flex flex-wrap gap-x-4 gap-y-2";
const socialList = "flex items-center gap-1";
const socialLink =
  "inline-flex size-9 items-center justify-center rounded-full border border-line bg-surface transition-colors duration-150 ease-out hover:border-primary-line hover:text-ink";
const icon = "size-4";
const topLink =
  "inline-flex h-8 items-center gap-1.5 rounded-full border border-line px-3 font-medium text-ink transition-colors duration-150 ease-out hover:bg-subtle";
const card =
  "grid gap-6 rounded-3xl border border-line bg-linear-to-br from-surface to-primary-soft p-6 @3xl:grid-cols-2 @3xl:items-center @3xl:p-10";
const cardTitle = "text-xl font-semibold tracking-tight text-balance text-ink";
const cardText = "mt-1.5 leading-relaxed";
const form = "grid gap-3";
const field =
  "flex items-center gap-1 rounded-full border border-line bg-canvas p-1 shadow-xs";
const input =
  "h-10 w-0 flex-1 rounded-full bg-transparent px-4 text-ink placeholder:text-faint";
const button =
  "h-10 shrink-0 cursor-pointer rounded-full bg-primary px-5 font-medium text-on-primary transition-colors duration-150 ease-out hover:bg-primary-strong";
const status =
  "flex items-center gap-2 px-4 font-medium text-ink before:size-1.5 before:rounded-full before:bg-success empty:sr-only";
const cta =
  "dark grid justify-items-start gap-6 rounded-3xl border border-line bg-surface bg-radial-[at_top_right] from-success/30 to-60% p-6 text-muted @2xl:p-12";
const ctaTitle =
  "max-w-xl text-2xl font-semibold tracking-tight text-balance text-ink @2xl:text-4xl";
const ctaText = "mt-3 max-w-lg text-base leading-relaxed";
const wordmarkBox =
  "-mx-4 h-[0.6em] overflow-hidden text-[calc(200cqw/var(--chars))] leading-none select-none @2xl:-mx-8";
const wordmarkText =
  "-mt-[0.08em] bg-linear-to-b from-ink via-ink/50 bg-clip-text text-center font-semibold tracking-tighter whitespace-nowrap text-transparent";

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

const layout = computed(() => layouts[props.variant] ?? layouts.columns);
const hasColumns = computed(() => layout.value[1] === main);
const links = computed(() => props.columns.flatMap((column) => column.links));
const isCta = computed(() => props.variant === "cta");
const subscribed = ref(false);

function subscribe(event: Event) {
  (event.currentTarget as HTMLFormElement).reset();
  subscribed.value = true;
}
</script>

<template>
  <footer :class="[root, layout[0]]">
    <div v-if="props.variant === 'newsletter'" :class="card">
      <div>
        <h2 :class="cardTitle">{{ props.newsletterLabel }}</h2>
        <p v-if="props.newsletterDescription" :class="cardText">
          {{ props.newsletterDescription }}
        </p>
      </div>
      <slot name="newsletter">
        <form :class="form" @submit.prevent="subscribe">
          <div :class="field">
            <input
              type="email"
              name="email"
              required
              autocomplete="email"
              :aria-label="props.emailLabel"
              :placeholder="props.emailLabel"
              :class="input"
            />
            <button type="submit" :class="button">
              {{ props.subscribeLabel }}
            </button>
          </div>
          <p
            role="status"
            :class="status"
            v-text="subscribed ? props.successLabel : ''"
          />
        </form>
      </slot>
    </div>
    <div v-if="isCta" :class="cta">
      <div>
        <h2 v-if="props.heading" :class="ctaTitle">{{ props.heading }}</h2>
        <p v-if="props.description" :class="ctaText">
          {{ props.description }}
        </p>
      </div>
      <div v-if="$slots.actions" :class="actionsClass">
        <slot name="actions" />
      </div>
    </div>
    <div :class="layout[1]">
      <div :class="layout[2]">
        <div v-if="$slots.brand" :class="brandClass">
          <slot name="brand" />
        </div>
        <p
          v-if="props.description && !isCta && props.variant !== 'compact'"
          :class="descriptionClass"
        >
          {{ props.description }}
        </p>
        <div v-if="$slots.actions && !isCta" :class="actionsClass">
          <slot name="actions" />
        </div>
      </div>
      <nav
        v-if="links.length > 0"
        :aria-label="props.navLabel"
        :class="hasColumns ? columnsNav : undefined"
      >
        <template v-if="hasColumns">
          <div v-for="(column, index) in props.columns" :key="index">
            <h2 v-if="column.title" :class="columnTitle">
              {{ column.title }}
            </h2>
            <ul :class="columnList">
              <li v-for="(item, i) in column.links" :key="i">
                <a :href="safeHref(item.href)" :class="link">{{
                  item.label
                }}</a>
              </li>
            </ul>
          </div>
        </template>
        <ul v-else :class="flatList">
          <li v-for="(item, i) in links" :key="i">
            <a :href="safeHref(item.href)" :class="link">{{ item.label }}</a>
          </li>
        </ul>
      </nav>
    </div>
    <div :class="layout[3]">
      <template v-for="place in ['before', 'after']" :key="place">
        <ul
          v-if="
            props.socials.length > 0 &&
            (place === 'before') === (props.variant === 'centered')
          "
          :aria-label="props.socialLabel"
          :class="socialList"
        >
          <li v-for="(social, i) in props.socials" :key="i">
            <a
              :href="safeHref(social.href)"
              :aria-label="social.label"
              :class="socialLink"
            >
              <svg
                :class="icon"
                viewBox="0 0 24 24"
                fill="none"
                stroke="currentColor"
                stroke-width="1.5"
                stroke-linecap="round"
                stroke-linejoin="round"
                aria-hidden="true"
              >
                <path :d="social.icon" />
              </svg>
            </a>
          </li>
        </ul>
        <template v-if="place === 'before'">
          <p v-if="props.copyright" :class="copyrightClass">
            {{ props.copyright }}
          </p>
          <nav v-if="props.legal.length > 0" :aria-label="props.legalLabel">
            <ul :class="legalList">
              <li v-for="(item, i) in props.legal" :key="i">
                <a :href="safeHref(item.href)" :class="link">{{
                  item.label
                }}</a>
              </li>
            </ul>
          </nav>
        </template>
      </template>
      <a v-if="props.backToTop" href="#top" :class="topLink"
        >{{ props.backToTopLabel
        }}<svg
          :class="icon"
          viewBox="0 0 24 24"
          fill="none"
          stroke="currentColor"
          stroke-width="1.5"
          stroke-linecap="round"
          stroke-linejoin="round"
          aria-hidden="true"
        >
          <path d="M12 19V5M5 12l7-7 7 7" /></svg
      ></a>
    </div>
    <div
      v-if="props.variant === 'big-brand' && props.wordmark"
      aria-hidden="true"
      :class="wordmarkBox"
      :style="{ '--chars': props.wordmark.length }"
    >
      <p :class="wordmarkText">{{ props.wordmark }}</p>
    </div>
  </footer>
</template>
```

```vue
<script setup lang="ts">
import Footer from "@/components/markas/Footer.vue";

const columns = [
  {
    title: "Product",
    links: [
      { label: "Components", href: "/components" },
      { label: "Templates", href: "/templates" },
    ],
  },
];
</script>

<template>
  <Footer
    variant="newsletter"
    newsletter-description="One email a month. No spam."
    copyright="© 2026 MarkasUI"
    :columns="columns"
  >
    <template #brand>MarkasUI</template>
  </Footer>
</template>
```

### Svelte

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

```svelte
<script lang="ts" module>
  export type FooterLink = { label: string; href: string };
  export type FooterColumn = { title?: string; links: FooterLink[] };
  /** icon: SVG path data (the d attribute) for a 24x24 stroke icon. */
  export type FooterSocial = { label: string; href: string; icon: string };
  export type FooterVariant =
    "columns" | "newsletter" | "big-brand" | "centered" | "cta" | "compact";
</script>

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

  const root =
    "@container w-full border-t border-line bg-canvas text-sm text-muted **:focus-visible:outline-2 **:focus-visible:outline-offset-2 **:focus-visible:outline-primary motion-reduce:**:transition-none";
  const wrap = "grid gap-12 px-4 py-14 @2xl:px-8";
  const main = "grid gap-10 @3xl:grid-cols-[minmax(0,2fr)_minmax(0,3fr)]";
  const brandArea = "grid max-w-sm content-start gap-4";
  const bottom =
    "flex flex-col gap-4 border-t border-line pt-6 @2xl:flex-row @2xl:items-center";
  const row = "flex flex-wrap items-center justify-between gap-6";
  const stack = "grid justify-items-center gap-4";
  const contents = "contents";
  /** Layout of each variant: [footer, main row, brand area, bottom row]. */
  const layouts = {
    columns: [wrap, main, brandArea, bottom],
    newsletter: [wrap, main, brandArea, bottom],
    "big-brand": [
      "grid gap-12 overflow-hidden bg-linear-to-b to-primary-soft px-4 pt-14 @2xl:px-8",
      main,
      brandArea,
      bottom,
    ],
    centered: [
      "grid justify-items-center gap-8 bg-radial-[at_top] from-primary-soft to-70% px-4 py-14 text-center",
      "grid justify-items-center gap-6",
      "grid max-w-md justify-items-center gap-3",
      stack,
    ],
    cta: [wrap, row, contents, bottom],
    compact: [
      "flex flex-wrap items-center gap-x-5 gap-y-2 rounded-3xl border px-5 py-3 shadow-overlay @xl:rounded-full",
      contents,
      contents,
      contents,
    ],
  };
  const brandClass = "flex items-center gap-2 text-base font-semibold text-ink";
  const descriptionClass = "leading-relaxed";
  const actionsClass = "flex flex-wrap items-center gap-2";
  const columnsNav =
    "grid grid-cols-2 gap-x-6 gap-y-8 @xl:grid-cols-[repeat(auto-fit,minmax(7rem,1fr))]";
  const columnTitle = "font-medium text-ink";
  const columnList = "mt-4 grid gap-2.5";
  const flatList = "flex flex-wrap justify-center gap-x-6 gap-y-2";
  const link =
    "rounded-sm transition-colors duration-150 ease-out hover:text-ink";
  const copyrightClass = "@2xl:mr-auto";
  const legalList = "flex flex-wrap gap-x-4 gap-y-2";
  const socialList = "flex items-center gap-1";
  const socialLink =
    "inline-flex size-9 items-center justify-center rounded-full border border-line bg-surface transition-colors duration-150 ease-out hover:border-primary-line hover:text-ink";
  const icon = "size-4";
  const topLink =
    "inline-flex h-8 items-center gap-1.5 rounded-full border border-line px-3 font-medium text-ink transition-colors duration-150 ease-out hover:bg-subtle";
  const card =
    "grid gap-6 rounded-3xl border border-line bg-linear-to-br from-surface to-primary-soft p-6 @3xl:grid-cols-2 @3xl:items-center @3xl:p-10";
  const cardTitle =
    "text-xl font-semibold tracking-tight text-balance text-ink";
  const cardText = "mt-1.5 leading-relaxed";
  const form = "grid gap-3";
  const field =
    "flex items-center gap-1 rounded-full border border-line bg-canvas p-1 shadow-xs";
  const input =
    "h-10 w-0 flex-1 rounded-full bg-transparent px-4 text-ink placeholder:text-faint";
  const button =
    "h-10 shrink-0 cursor-pointer rounded-full bg-primary px-5 font-medium text-on-primary transition-colors duration-150 ease-out hover:bg-primary-strong";
  const status =
    "flex items-center gap-2 px-4 font-medium text-ink before:size-1.5 before:rounded-full before:bg-success empty:sr-only";
  const cta =
    "dark grid justify-items-start gap-6 rounded-3xl border border-line bg-surface bg-radial-[at_top_right] from-success/30 to-60% p-6 text-muted @2xl:p-12";
  const ctaTitle =
    "max-w-xl text-2xl font-semibold tracking-tight text-balance text-ink @2xl:text-4xl";
  const ctaText = "mt-3 max-w-lg text-base leading-relaxed";
  const wordmarkBox =
    "-mx-4 h-[0.6em] overflow-hidden text-[calc(200cqw/var(--chars))] leading-none select-none @2xl:-mx-8";
  const wordmarkText =
    "-mt-[0.08em] bg-linear-to-b from-ink via-ink/50 bg-clip-text text-center font-semibold tracking-tighter whitespace-nowrap text-transparent";

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

  type Props = Omit<HTMLAttributes<HTMLElement>, "children"> & {
    variant?: FooterVariant;
    description?: string;
    columns?: FooterColumn[];
    socials?: FooterSocial[];
    legal?: FooterLink[];
    copyright?: string;
    /** Heading of the call to action block (cta variant). */
    heading?: string;
    /** Text under the newsletter card heading (newsletter variant). */
    newsletterDescription?: string;
    /** Giant wordmark (big-brand variant). */
    wordmark?: string;
    backToTop?: boolean;
    navLabel?: string;
    legalLabel?: string;
    socialLabel?: string;
    newsletterLabel?: string;
    emailLabel?: string;
    subscribeLabel?: string;
    successLabel?: string;
    backToTopLabel?: string;
    brand?: Snippet;
    /** Buttons or extra content. cta variant: the buttons of the call to action block. */
    actions?: Snippet;
    /** Replaces the built-in subscribe form (newsletter variant). */
    newsletter?: Snippet;
  };

  let {
    variant = "columns",
    description,
    columns = [],
    socials = [],
    legal = [],
    copyright,
    heading,
    newsletterDescription,
    wordmark = "",
    backToTop = false,
    navLabel = "Footer",
    legalLabel = "Legal",
    socialLabel = "Social media",
    newsletterLabel = "Subscribe to our newsletter",
    emailLabel = "Email address",
    subscribeLabel = "Subscribe",
    successLabel = "Thanks for subscribing",
    backToTopLabel = "Back to top",
    brand,
    actions,
    newsletter,
    class: className,
    ...rest
  }: Props = $props();

  const layout = $derived(layouts[variant] ?? layouts.columns);
  const hasColumns = $derived(layout[1] === main);
  const isCta = $derived(variant === "cta");
  const links = $derived(columns.flatMap((column) => column.links));
  let subscribed = $state(false);

  function subscribe(event: SubmitEvent & { currentTarget: HTMLFormElement }) {
    event.preventDefault();
    event.currentTarget.reset();
    subscribed = true;
  }
</script>

{#snippet text(tag: string, textClass: string, value?: string)}
  {#if value}<svelte:element this={tag} class={textClass}
      >{value}</svelte:element
    >{/if}
{/snippet}

{#snippet box(boxClass: string, content?: Snippet)}
  {#if content}<div class={boxClass}>{@render content()}</div>{/if}
{/snippet}

{#snippet iconSvg(d: string)}
  <svg
    class={icon}
    viewBox="0 0 24 24"
    fill="none"
    stroke="currentColor"
    stroke-width="1.5"
    stroke-linecap="round"
    stroke-linejoin="round"
    aria-hidden="true"
  >
    <path {d} />
  </svg>
{/snippet}

{#snippet linkList(items: FooterLink[], listClass: string)}
  <ul class={listClass}>
    {#each items as item}
      <li><a href={safeHref(item.href)} class={link}>{item.label}</a></li>
    {/each}
  </ul>
{/snippet}

{#snippet socialsList()}
  {#if socials.length > 0}
    <ul aria-label={socialLabel} class={socialList}>
      {#each socials as social}
        <li>
          <a
            href={safeHref(social.href)}
            aria-label={social.label}
            class={socialLink}>{@render iconSvg(social.icon)}</a
          >
        </li>
      {/each}
    </ul>
  {/if}
{/snippet}

<footer class={[root, layout[0], className]} {...rest}>
  {#if variant === "newsletter"}
    <div class={card}>
      <div>
        <h2 class={cardTitle}>{newsletterLabel}</h2>
        {@render text("p", cardText, newsletterDescription)}
      </div>
      {#if newsletter}
        {@render newsletter()}
      {:else}
        <form class={form} onsubmit={subscribe}>
          <div class={field}>
            <input
              type="email"
              name="email"
              required
              autocomplete="email"
              aria-label={emailLabel}
              placeholder={emailLabel}
              class={input}
            />
            <button type="submit" class={button}>{subscribeLabel}</button>
          </div>
          <p role="status" class={status}>
            {#if subscribed}{successLabel}{/if}
          </p>
        </form>
      {/if}
    </div>
  {/if}
  {#if isCta}
    <div class={cta}>
      <div>
        {@render text("h2", ctaTitle, heading)}
        {@render text("p", ctaText, description)}
      </div>
      {@render box(actionsClass, actions)}
    </div>
  {/if}
  <div class={layout[1]}>
    <div class={layout[2]}>
      {@render box(brandClass, brand)}
      {@render text(
        "p",
        descriptionClass,
        isCta || variant === "compact" ? "" : description,
      )}
      {@render box(actionsClass, isCta ? undefined : actions)}
    </div>
    {#if links.length > 0}
      <nav aria-label={navLabel} class={hasColumns ? columnsNav : undefined}>
        {#if hasColumns}
          {#each columns as column}
            <div>
              {@render text("h2", columnTitle, column.title)}
              {@render linkList(column.links, columnList)}
            </div>
          {/each}
        {:else}
          {@render linkList(links, flatList)}
        {/if}
      </nav>
    {/if}
  </div>
  <div class={layout[3]}>
    {#if variant === "centered"}{@render socialsList()}{/if}
    {@render text("p", copyrightClass, copyright)}
    {#if legal.length > 0}
      <nav aria-label={legalLabel}>{@render linkList(legal, legalList)}</nav>
    {/if}
    {#if variant !== "centered"}{@render socialsList()}{/if}
    {#if backToTop}
      <a href="#top" class={topLink}
        >{backToTopLabel}{@render iconSvg("M12 19V5M5 12l7-7 7 7")}</a
      >
    {/if}
  </div>
  {#if variant === "big-brand" && wordmark}
    <div aria-hidden="true" class={wordmarkBox} style:--chars={wordmark.length}>
      <p class={wordmarkText}>{wordmark}</p>
    </div>
  {/if}
</footer>
```

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

  const columns = [
    {
      title: "Product",
      links: [
        { label: "Components", href: "/components" },
        { label: "Templates", href: "/templates" },
      ],
    },
  ];
</script>

<Footer
  variant="newsletter"
  newsletterDescription="One email a month. No spam."
  copyright="© 2026 MarkasUI"
  {columns}
>
  {#snippet brand()}MarkasUI{/snippet}
</Footer>
```

### Astro

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

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

export type FooterLink = { label: string; href: string };
export type FooterColumn = { title?: string; links: FooterLink[] };
/** icon: SVG path data (the d attribute) for a 24x24 stroke icon. */
export type FooterSocial = { label: string; href: string; icon: string };

const root =
  "@container w-full border-t border-line bg-canvas text-sm text-muted **:focus-visible:outline-2 **:focus-visible:outline-offset-2 **:focus-visible:outline-primary motion-reduce:**:transition-none";
const wrap = "grid gap-12 px-4 py-14 @2xl:px-8";
const main = "grid gap-10 @3xl:grid-cols-[minmax(0,2fr)_minmax(0,3fr)]";
const brandArea = "grid max-w-sm content-start gap-4";
const bottom =
  "flex flex-col gap-4 border-t border-line pt-6 @2xl:flex-row @2xl:items-center";
const row = "flex flex-wrap items-center justify-between gap-6";
const stack = "grid justify-items-center gap-4";
const contents = "contents";
/** Layout of each variant: [footer, main row, brand area, bottom row]. */
const layouts = {
  columns: [wrap, main, brandArea, bottom],
  newsletter: [wrap, main, brandArea, bottom],
  "big-brand": [
    "grid gap-12 overflow-hidden bg-linear-to-b to-primary-soft px-4 pt-14 @2xl:px-8",
    main,
    brandArea,
    bottom,
  ],
  centered: [
    "grid justify-items-center gap-8 bg-radial-[at_top] from-primary-soft to-70% px-4 py-14 text-center",
    "grid justify-items-center gap-6",
    "grid max-w-md justify-items-center gap-3",
    stack,
  ],
  cta: [wrap, row, contents, bottom],
  compact: [
    "flex flex-wrap items-center gap-x-5 gap-y-2 rounded-3xl border px-5 py-3 shadow-overlay @xl:rounded-full",
    contents,
    contents,
    contents,
  ],
};
const brandClass = "flex items-center gap-2 text-base font-semibold text-ink";
const descriptionClass = "leading-relaxed";
const actionsClass = "flex flex-wrap items-center gap-2";
const columnsNav =
  "grid grid-cols-2 gap-x-6 gap-y-8 @xl:grid-cols-[repeat(auto-fit,minmax(7rem,1fr))]";
const columnTitle = "font-medium text-ink";
const columnList = "mt-4 grid gap-2.5";
const flatList = "flex flex-wrap justify-center gap-x-6 gap-y-2";
const link =
  "rounded-sm transition-colors duration-150 ease-out hover:text-ink";
const copyrightClass = "@2xl:mr-auto";
const legalList = "flex flex-wrap gap-x-4 gap-y-2";
const socialList = "flex items-center gap-1";
const socialLink =
  "inline-flex size-9 items-center justify-center rounded-full border border-line bg-surface transition-colors duration-150 ease-out hover:border-primary-line hover:text-ink";
const icon = "size-4";
const topLink =
  "inline-flex h-8 items-center gap-1.5 rounded-full border border-line px-3 font-medium text-ink transition-colors duration-150 ease-out hover:bg-subtle";
const card =
  "grid gap-6 rounded-3xl border border-line bg-linear-to-br from-surface to-primary-soft p-6 @3xl:grid-cols-2 @3xl:items-center @3xl:p-10";
const cardTitle = "text-xl font-semibold tracking-tight text-balance text-ink";
const cardText = "mt-1.5 leading-relaxed";
const form = "grid gap-3";
const field =
  "flex items-center gap-1 rounded-full border border-line bg-canvas p-1 shadow-xs";
const input =
  "h-10 w-0 flex-1 rounded-full bg-transparent px-4 text-ink placeholder:text-faint";
const button =
  "h-10 shrink-0 cursor-pointer rounded-full bg-primary px-5 font-medium text-on-primary transition-colors duration-150 ease-out hover:bg-primary-strong";
const status =
  "flex items-center gap-2 px-4 font-medium text-ink before:size-1.5 before:rounded-full before:bg-success empty:sr-only";
const cta =
  "dark grid justify-items-start gap-6 rounded-3xl border border-line bg-surface bg-radial-[at_top_right] from-success/30 to-60% p-6 text-muted @2xl:p-12";
const ctaTitle =
  "max-w-xl text-2xl font-semibold tracking-tight text-balance text-ink @2xl:text-4xl";
const ctaText = "mt-3 max-w-lg text-base leading-relaxed";
const wordmarkBox =
  "-mx-4 h-[0.6em] overflow-hidden text-[calc(200cqw/var(--chars))] leading-none select-none @2xl:-mx-8";
const wordmarkText =
  "-mt-[0.08em] bg-linear-to-b from-ink via-ink/50 bg-clip-text text-center font-semibold tracking-tighter whitespace-nowrap text-transparent";


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

export type FooterVariant = keyof typeof layouts;

type Props = HTMLAttributes<"footer"> & {
  variant?: FooterVariant;
  description?: string;
  columns?: FooterColumn[];
  socials?: FooterSocial[];
  legal?: FooterLink[];
  copyright?: string;
  /** Heading of the call to action block (cta variant). */
  heading?: string;
  /** Text under the newsletter card heading (newsletter variant). */
  newsletterDescription?: string;
  /** Giant wordmark (big-brand variant). */
  wordmark?: string;
  backToTop?: boolean;
  navLabel?: string;
  legalLabel?: string;
  socialLabel?: string;
  newsletterLabel?: string;
  emailLabel?: string;
  subscribeLabel?: string;
  successLabel?: string;
  backToTopLabel?: string;
};

const {
  variant = "columns",
  description,
  columns = [],
  socials = [],
  legal = [],
  copyright,
  heading,
  newsletterDescription,
  wordmark = "",
  backToTop = false,
  navLabel = "Footer",
  legalLabel = "Legal",
  socialLabel = "Social media",
  newsletterLabel = "Subscribe to our newsletter",
  emailLabel = "Email address",
  subscribeLabel = "Subscribe",
  successLabel = "Thanks for subscribing",
  backToTopLabel = "Back to top",
  class: className,
  ...rest
} = Astro.props;

const [footerClass, mainClass, brandAreaClass, bottomClass] =
  layouts[variant] ?? layouts.columns;
const hasColumns = mainClass === main;
const isCta = variant === "cta";
const isCentered = variant === "centered";
const links = columns.flatMap((column) => column.links);
const hasActions = Astro.slots.has("actions");
---

<footer class:list={[root, footerClass, className]} {...rest}>
  {
    variant === "newsletter" && (
      <div class={card}>
        <div>
          <h2 class={cardTitle}>{newsletterLabel}</h2>
          {newsletterDescription && <p class={cardText}>{newsletterDescription}</p>}
        </div>
        {
          Astro.slots.has("newsletter") ? (
            <slot name="newsletter" />
          ) : (
            <form class={form} data-markas-footer-form>
              <div class={field}>
                <input
                  type="email"
                  name="email"
                  required
                  autocomplete="email"
                  aria-label={emailLabel}
                  placeholder={emailLabel}
                  class={input}
                />
                <button type="submit" class={button}>{subscribeLabel}</button>
              </div>
              <p role="status" class={status} data-message={successLabel}></p>
            </form>
          )
        }
      </div>
    )
  }
  {
    isCta && (
      <div class={cta}>
        <div>
          {heading && <h2 class={ctaTitle}>{heading}</h2>}
          {description && <p class={ctaText}>{description}</p>}
        </div>
        {hasActions && <div class={actionsClass}><slot name="actions" /></div>}
      </div>
    )
  }
  <div class={mainClass}>
    <div class={brandAreaClass}>
      {Astro.slots.has("brand") && <div class={brandClass}><slot name="brand" /></div>}
      {
        description && !isCta && variant !== "compact" && (
          <p class={descriptionClass}>{description}</p>
        )
      }
      {hasActions && !isCta && <div class={actionsClass}><slot name="actions" /></div>}
    </div>
    {
      links.length > 0 && (
        <nav aria-label={navLabel} class={hasColumns ? columnsNav : undefined}>
          {
            hasColumns ? (
              columns.map((column) => (
                <div>
                  {column.title && <h2 class={columnTitle}>{column.title}</h2>}
                  <ul class={columnList}>
                    {column.links.map((item) => (
                      <li><a href={safeHref(item.href)} class={link}>{item.label}</a></li>
                    ))}
                  </ul>
                </div>
              ))
            ) : (
              <ul class={flatList}>
                {links.map((item) => (
                  <li><a href={safeHref(item.href)} class={link}>{item.label}</a></li>
                ))}
              </ul>
            )
          }
        </nav>
      )
    }
  </div>
  <div class={bottomClass}>
    {
      ["before", "after"].map((place) => (
        <>
          {socials.length > 0 && (place === "before") === isCentered && (
            <ul aria-label={socialLabel} class={socialList}>
              {socials.map((social) => (
                <li>
                  <a href={safeHref(social.href)} aria-label={social.label} class={socialLink}>
                    <svg
                      class={icon}
                      viewBox="0 0 24 24"
                      fill="none"
                      stroke="currentColor"
                      stroke-width="1.5"
                      stroke-linecap="round"
                      stroke-linejoin="round"
                      aria-hidden="true"
                    >
                      <path d={social.icon}></path>
                    </svg>
                  </a>
                </li>
              ))}
            </ul>
          )}
          {place === "before" && copyright && <p class={copyrightClass}>{copyright}</p>}
          {place === "before" && legal.length > 0 && (
            <nav aria-label={legalLabel}>
              <ul class={legalList}>
                {legal.map((item) => (
                  <li><a href={safeHref(item.href)} class={link}>{item.label}</a></li>
                ))}
              </ul>
            </nav>
          )}
        </>
      ))
    }
    {
      backToTop && (
        <a href="#top" class={topLink}>{backToTopLabel}<svg
            class={icon}
            viewBox="0 0 24 24"
            fill="none"
            stroke="currentColor"
            stroke-width="1.5"
            stroke-linecap="round"
            stroke-linejoin="round"
            aria-hidden="true"
          ><path d="M12 19V5M5 12l7-7 7 7"></path></svg></a>
      )
    }
  </div>
  {
    variant === "big-brand" && wordmark && (
      <div aria-hidden="true" class={wordmarkBox} style={`--chars: ${wordmark.length}`}>
        <p class={wordmarkText}>{wordmark}</p>
      </div>
    )
  }
</footer>

<script>
  // One listener per page serves every footer, including markup added later and pages
  // reached through view transitions. Native validation runs before submit fires.
  document.addEventListener("submit", (event) => {
    const form = event.target;
    if (!(form instanceof HTMLFormElement)) return;
    if (!form.hasAttribute("data-markas-footer-form")) return;
    event.preventDefault();
    form.reset();
    const status = form.querySelector<HTMLElement>("[role=status]");
    if (status) status.textContent = status.dataset.message ?? "";
  });
</script>
```

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

const columns = [
  {
    title: "Product",
    links: [
      { label: "Components", href: "/components" },
      { label: "Templates", href: "/templates" },
    ],
  },
];
---

<Footer
  variant="newsletter"
  newsletterDescription="One email a month. No spam."
  copyright="© 2026 MarkasUI"
  columns={columns}
  backToTop
>
  <Fragment slot="brand">MarkasUI</Fragment>
</Footer>
```

The footer renders on the server. Only the built-in newsletter form uses a small bundled script, shared by every footer on the page.

### Angular

Save at `src/app/markas/footer.component.ts`. No extra dependencies.

```ts
import {
  afterNextRender,
  ChangeDetectionStrategy,
  Component,
  computed,
  type ElementRef,
  input as signalInput,
  signal,
  viewChild,
  booleanAttribute,
} from "@angular/core";
import { NgTemplateOutlet } from "@angular/common";

export type FooterLink = { label: string; href: string };
export type FooterColumn = { title?: string; links: FooterLink[] };
/** icon: SVG path data (the d attribute) for a 24x24 stroke icon. */
export type FooterSocial = { label: string; href: string; icon: string };

const root =
  "@container w-full border-t border-line bg-canvas text-sm text-muted **:focus-visible:outline-2 **:focus-visible:outline-offset-2 **:focus-visible:outline-primary motion-reduce:**:transition-none";
const wrap = "grid gap-12 px-4 py-14 @2xl:px-8";
const main = "grid gap-10 @3xl:grid-cols-[minmax(0,2fr)_minmax(0,3fr)]";
const brandArea = "grid max-w-sm content-start gap-4";
const bottom =
  "flex flex-col gap-4 border-t border-line pt-6 @2xl:flex-row @2xl:items-center";
const row = "flex flex-wrap items-center justify-between gap-6";
const stack = "grid justify-items-center gap-4";
const contents = "contents";
/** Layout of each variant: [footer, main row, brand area, bottom row]. */
const layouts = {
  columns: [wrap, main, brandArea, bottom],
  newsletter: [wrap, main, brandArea, bottom],
  "big-brand": [
    "grid gap-12 overflow-hidden bg-linear-to-b to-primary-soft px-4 pt-14 @2xl:px-8",
    main,
    brandArea,
    bottom,
  ],
  centered: [
    "grid justify-items-center gap-8 bg-radial-[at_top] from-primary-soft to-70% px-4 py-14 text-center",
    "grid justify-items-center gap-6",
    "grid max-w-md justify-items-center gap-3",
    stack,
  ],
  cta: [wrap, row, contents, bottom],
  compact: [
    "flex flex-wrap items-center gap-x-5 gap-y-2 rounded-3xl border px-5 py-3 shadow-overlay @xl:rounded-full",
    contents,
    contents,
    contents,
  ],
};
const brandClass = "flex items-center gap-2 text-base font-semibold text-ink";
const descriptionClass = "leading-relaxed";
const actionsClass = "flex flex-wrap items-center gap-2";
const columnsNav =
  "grid grid-cols-2 gap-x-6 gap-y-8 @xl:grid-cols-[repeat(auto-fit,minmax(7rem,1fr))]";
const columnTitle = "font-medium text-ink";
const columnList = "mt-4 grid gap-2.5";
const flatList = "flex flex-wrap justify-center gap-x-6 gap-y-2";
const link =
  "rounded-sm transition-colors duration-150 ease-out hover:text-ink";
const copyrightClass = "@2xl:mr-auto";
const legalList = "flex flex-wrap gap-x-4 gap-y-2";
const socialList = "flex items-center gap-1";
const socialLink =
  "inline-flex size-9 items-center justify-center rounded-full border border-line bg-surface transition-colors duration-150 ease-out hover:border-primary-line hover:text-ink";
const icon = "size-4";
const topLink =
  "inline-flex h-8 items-center gap-1.5 rounded-full border border-line px-3 font-medium text-ink transition-colors duration-150 ease-out hover:bg-subtle";
const card =
  "grid gap-6 rounded-3xl border border-line bg-linear-to-br from-surface to-primary-soft p-6 @3xl:grid-cols-2 @3xl:items-center @3xl:p-10";
const cardTitle = "text-xl font-semibold tracking-tight text-balance text-ink";
const cardText = "mt-1.5 leading-relaxed";
const form = "grid gap-3";
const field =
  "flex items-center gap-1 rounded-full border border-line bg-canvas p-1 shadow-xs";
const input =
  "h-10 w-0 flex-1 rounded-full bg-transparent px-4 text-ink placeholder:text-faint";
const button =
  "h-10 shrink-0 cursor-pointer rounded-full bg-primary px-5 font-medium text-on-primary transition-colors duration-150 ease-out hover:bg-primary-strong";
const status =
  "flex items-center gap-2 px-4 font-medium text-ink before:size-1.5 before:rounded-full before:bg-success empty:sr-only";
const cta =
  "dark grid justify-items-start gap-6 rounded-3xl border border-line bg-surface bg-radial-[at_top_right] from-success/30 to-60% p-6 text-muted @2xl:p-12";
const ctaTitle =
  "max-w-xl text-2xl font-semibold tracking-tight text-balance text-ink @2xl:text-4xl";
const ctaText = "mt-3 max-w-lg text-base leading-relaxed";
const wordmarkBox =
  "-mx-4 h-[0.6em] overflow-hidden text-[calc(200cqw/var(--chars))] leading-none select-none @2xl:-mx-8";
const wordmarkText =
  "-mt-[0.08em] bg-linear-to-b from-ink via-ink/50 bg-clip-text text-center font-semibold tracking-tighter whitespace-nowrap text-transparent";

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

export type FooterVariant = keyof typeof layouts;

/** True when a slot wrapper received an element or text (comments from ng-container do not count). */
const hasContent = (el: HTMLElement) =>
  el.childElementCount > 0 || (el.textContent ?? "").trim() !== "";

/**
 * Attribute selector on the native footer: the user's class, id, and aria-* stay on it.
 * Slots: elements with the `brand`, `actions`, or `newsletter` attribute (an ng-container works).
 * Without a `newsletter` slot the built-in subscribe form is shown.
 */
@Component({
  selector: "footer[markas-footer]",
  changeDetection: ChangeDetectionStrategy.OnPush,
  imports: [NgTemplateOutlet],
  host: { "[class]": "classes()" },
  template: `
    <ng-template #actionsSlot><ng-content select="[actions]" /></ng-template>
    @if (variant() === "newsletter") {
      <div [class]="card">
        <div>
          <h2 [class]="cardTitle">{{ newsletterLabel() }}</h2>
          @if (newsletterDescription()) {
            <p [class]="cardText">{{ newsletterDescription() }}</p>
          }
        </div>
        <ng-content select="[newsletter]">
          <form [class]="form" (submit)="subscribe($event)">
            <div [class]="field">
              <input
                type="email"
                name="email"
                required
                autocomplete="email"
                [attr.aria-label]="emailLabel()"
                [placeholder]="emailLabel()"
                [class]="input"
              />
              <button type="submit" [class]="button">
                {{ subscribeLabel() }}
              </button>
            </div>
            <p
              role="status"
              [class]="status"
              [textContent]="subscribed() ? successLabel() : ''"
            ></p>
          </form>
        </ng-content>
      </div>
    }
    @if (isCta()) {
      <div [class]="cta">
        <div>
          @if (heading()) {
            <h2 [class]="ctaTitle">{{ heading() }}</h2>
          }
          @if (description()) {
            <p [class]="ctaText">{{ description() }}</p>
          }
        </div>
        <div #actionsBox [class]="actionsClass" [hidden]="!hasActions()">
          <ng-container [ngTemplateOutlet]="actionsSlot" />
        </div>
      </div>
    }
    <div [class]="layout()[1]">
      <div [class]="layout()[2]">
        <div #brandBox [class]="brandClass" [hidden]="!hasBrand()">
          <ng-content select="[brand]" />
        </div>
        @if (description() && !isCta() && variant() !== "compact") {
          <p [class]="descriptionClass">{{ description() }}</p>
        }
        @if (!isCta()) {
          <div #actionsBox [class]="actionsClass" [hidden]="!hasActions()">
            <ng-container [ngTemplateOutlet]="actionsSlot" />
          </div>
        }
      </div>
      @if (links().length > 0) {
        <nav
          [attr.aria-label]="navLabel()"
          [attr.class]="hasColumns() ? columnsNav : null"
        >
          @if (hasColumns()) {
            @for (column of columns(); track $index) {
              <div>
                @if (column.title) {
                  <h2 [class]="columnTitle">{{ column.title }}</h2>
                }
                <ng-container
                  [ngTemplateOutlet]="linkList"
                  [ngTemplateOutletContext]="{
                    items: column.links,
                    listClass: columnList,
                  }"
                />
              </div>
            }
          } @else {
            <ng-container
              [ngTemplateOutlet]="linkList"
              [ngTemplateOutletContext]="{
                items: links(),
                listClass: flatList,
              }"
            />
          }
        </nav>
      }
    </div>
    <div [class]="layout()[3]">
      @if (variant() === "centered") {
        <ng-container [ngTemplateOutlet]="socialsList" />
      }
      @if (copyright()) {
        <p [class]="copyrightClass">{{ copyright() }}</p>
      }
      @if (legal().length > 0) {
        <nav [attr.aria-label]="legalLabel()">
          <ng-container
            [ngTemplateOutlet]="linkList"
            [ngTemplateOutletContext]="{ items: legal(), listClass: legalList }"
          />
        </nav>
      }
      @if (variant() !== "centered") {
        <ng-container [ngTemplateOutlet]="socialsList" />
      }
      @if (backToTop()) {
        <a href="#top" [class]="topLink"
          >{{ backToTopLabel()
          }}<svg
            [class]="icon"
            viewBox="0 0 24 24"
            fill="none"
            stroke="currentColor"
            stroke-width="1.5"
            stroke-linecap="round"
            stroke-linejoin="round"
            aria-hidden="true"
          >
            <path d="M12 19V5M5 12l7-7 7 7" /></svg
        ></a>
      }
    </div>
    @if (variant() === "big-brand" && wordmark()) {
      <div
        aria-hidden="true"
        [class]="wordmarkBox"
        [style.--chars]="wordmark().length"
      >
        <p [class]="wordmarkText">{{ wordmark() }}</p>
      </div>
    }

    <ng-template #linkList let-items="items" let-listClass="listClass">
      <ul [class]="listClass">
        @for (item of items; track $index) {
          <li>
            <a [href]="safeHref(item.href)" [class]="link">{{ item.label }}</a>
          </li>
        }
      </ul>
    </ng-template>

    <ng-template #socialsList>
      @if (socials().length > 0) {
        <ul [attr.aria-label]="socialLabel()" [class]="socialList">
          @for (social of socials(); track $index) {
            <li>
              <a
                [href]="safeHref(social.href)"
                [attr.aria-label]="social.label"
                [class]="socialLink"
              >
                <svg
                  [class]="icon"
                  viewBox="0 0 24 24"
                  fill="none"
                  stroke="currentColor"
                  stroke-width="1.5"
                  stroke-linecap="round"
                  stroke-linejoin="round"
                  aria-hidden="true"
                >
                  <path [attr.d]="social.icon" />
                </svg>
              </a>
            </li>
          }
        </ul>
      }
    </ng-template>
  `,
})
export class Footer {
  readonly variant = signalInput<FooterVariant>("columns");
  readonly description = signalInput<string>();
  readonly columns = signalInput<FooterColumn[]>([]);
  readonly socials = signalInput<FooterSocial[]>([]);
  readonly legal = signalInput<FooterLink[]>([]);
  readonly copyright = signalInput<string>();
  /** Heading of the call to action block (cta variant). */
  readonly heading = signalInput<string>();
  /** Text under the newsletter card heading (newsletter variant). */
  readonly newsletterDescription = signalInput<string>();
  /** Giant wordmark (big-brand variant). */
  readonly wordmark = signalInput("");
  readonly backToTop = signalInput(false, { transform: booleanAttribute });
  readonly navLabel = signalInput("Footer");
  readonly legalLabel = signalInput("Legal");
  readonly socialLabel = signalInput("Social media");
  readonly newsletterLabel = signalInput("Subscribe to our newsletter");
  readonly emailLabel = signalInput("Email address");
  readonly subscribeLabel = signalInput("Subscribe");
  readonly successLabel = signalInput("Thanks for subscribing");
  readonly backToTopLabel = signalInput("Back to top");

  protected readonly brandClass = brandClass;
  protected readonly descriptionClass = descriptionClass;
  protected readonly actionsClass = actionsClass;
  protected readonly columnsNav = columnsNav;
  protected readonly columnTitle = columnTitle;
  protected readonly columnList = columnList;
  protected readonly flatList = flatList;
  protected readonly link = link;
  protected readonly copyrightClass = copyrightClass;
  protected readonly legalList = legalList;
  protected readonly socialList = socialList;
  protected readonly socialLink = socialLink;
  protected readonly icon = icon;
  protected readonly topLink = topLink;
  protected readonly card = card;
  protected readonly cardTitle = cardTitle;
  protected readonly cardText = cardText;
  protected readonly form = form;
  protected readonly field = field;
  protected readonly input = input;
  protected readonly button = button;
  protected readonly status = status;
  protected readonly cta = cta;
  protected readonly ctaTitle = ctaTitle;
  protected readonly ctaText = ctaText;
  protected readonly wordmarkBox = wordmarkBox;
  protected readonly wordmarkText = wordmarkText;
  protected readonly safeHref = safeHref;

  protected readonly layout = computed(
    () => layouts[this.variant()] ?? layouts.columns,
  );
  protected readonly classes = computed(() => `${root} ${this.layout()[0]}`);
  protected readonly hasColumns = computed(() => this.layout()[1] === main);
  protected readonly isCta = computed(() => this.variant() === "cta");
  protected readonly links = computed(() =>
    this.columns().flatMap((column) => column.links),
  );
  protected readonly subscribed = signal(false);
  protected readonly hasBrand = signal(true);
  protected readonly hasActions = signal(true);
  private readonly brandBox =
    viewChild.required<ElementRef<HTMLElement>>("brandBox");
  private readonly actionsBox =
    viewChild<ElementRef<HTMLElement>>("actionsBox");

  constructor() {
    // Projected content is only known after the first render.
    afterNextRender(() => {
      this.hasBrand.set(hasContent(this.brandBox().nativeElement));
      const actions = this.actionsBox()?.nativeElement;
      this.hasActions.set(actions ? hasContent(actions) : false);
    });
  }

  protected subscribe(event: SubmitEvent) {
    event.preventDefault();
    (event.target as HTMLFormElement).reset();
    this.subscribed.set(true);
  }
}
```

```ts
import { Component } from "@angular/core";
import { Footer, type FooterColumn } from "./markas/footer.component";

@Component({
  selector: "app-site-footer",
  imports: [Footer],
  template: `
    <footer
      markas-footer
      variant="newsletter"
      newsletterDescription="One email a month. No spam."
      copyright="© 2026 MarkasUI"
      [columns]="columns"
      backToTop
    >
      <ng-container brand>MarkasUI</ng-container>
    </footer>
  `,
})
export class SiteFooter {
  protected readonly columns: FooterColumn[] = [
    {
      title: "Product",
      links: [
        { label: "Components", href: "/components" },
        { label: "Templates", href: "/templates" },
      ],
    },
  ];
}
```

Footer is an attribute component on a native `footer`, so `class`, `id`, and `aria-*` stay on that element. Put slot content in an element (or `ng-container`) with the `brand`, `actions`, or `newsletter` attribute.

## Props

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `variant` | `"columns" \| "centered" \| "newsletter" \| "big-brand" \| "cta" \| "compact"` | "columns" | columns: brand left, link columns right. centered: minimal stack with a soft glow. newsletter: gradient card with a pill email field above the columns. big-brand: giant cropped wordmark over a soft gradient. cta: dark glowing call to action block above a small footer. compact: one line floating pill for apps. |
| `brand` | `slot / ReactNode` | - | Logo or site name. |
| `description` | `string / ReactNode` | - | Short line under the brand. In the cta variant it sits under the heading instead. Hidden in compact. |
| `columns` | `{ title?, links: { label, href }[] }[]` | [] | Link groups. columns, newsletter, and big-brand show them as titled columns; centered, cta, and compact show all links in one row. |
| `socials` | `{ label, href, icon }[]` | [] | Social links shown as icon buttons. icon is an SVG path (d) for a 24px stroke icon; label becomes the accessible name. |
| `legal` | `{ label, href }[]` | [] | Small links next to the copyright, such as Privacy and Terms. |
| `copyright` | `string / ReactNode` | - | Copyright line in the bottom row. |
| `heading` | `string / ReactNode` | - | Heading of the call to action block (cta variant). |
| `newsletterDescription` | `string / ReactNode` | - | Text under the newsletter card heading (newsletter variant). |
| `wordmark` | `string` | "" | Text of the giant wordmark (big-brand variant). It scales to the footer width and is cropped at the bottom. |
| `backToTop` | `boolean` | false | Adds a Back to top link to #top. Works without JavaScript. |
| `actions` | `slot / ReactNode` | - | Extra content under the description, such as app store badges. In the cta variant: the buttons of the call to action block. |
| `newsletter` | `slot / ReactNode` | - | Replaces the built-in subscribe form, for example with a form that posts to your email provider. |
| `navLabel` | `string` | Footer | Accessible label of the link navigation. |
| `legalLabel` | `string` | Legal | Accessible label of the legal links navigation. |
| `socialLabel` | `string` | Social media | Accessible label of the social links list. |
| `newsletterLabel` | `string` | Subscribe to our newsletter | Heading of the newsletter card. |
| `emailLabel` | `string` | Email address | Accessible name and placeholder of the email field. |
| `subscribeLabel` | `string` | Subscribe | Text of the subscribe button. |
| `successLabel` | `string` | Thanks for subscribing | Message announced in a status region after a valid email is submitted. |
| `backToTopLabel` | `string` | Back to top | Text of the Back to top link. |

## Accessibility

- Uses a footer element, a nav labelled by navLabel for the links, and a separate nav labelled by legalLabel for legal links.
- Column titles and card headings are h2 elements, and every group of links is a list.
- Social links are icon only, so each gets aria-label from its label and the icon is aria-hidden.
- The subscribe form uses native email validation; the success message is placed in a role=status region so screen readers announce it.
- The giant wordmark is decorative and aria-hidden; the brand slot stays the accessible name.
- User hrefs with unsafe schemes such as javascript: are replaced with #.

## Notes

- The layout responds to the footer's own width (container queries), so it stacks correctly inside a narrow column as well as on a phone.
- The built-in newsletter form validates the email natively and shows `successLabel` in a `role="status"` region without any network request. Pass the `newsletter` slot with your own form to send the address to a provider.
- In React the file is a Client Component only because of the newsletter form state. The bundle stays under 3 KB gzip.
- `backToTop` is a plain link to `#top`, which browsers scroll to the top of the page without JavaScript.
- The wordmark of `big-brand` is sized from its character count, so short brand names (3 to 8 letters) fill the width best.
- The `cta` block always uses the dark palette (it carries the `dark` class), so buttons in `actions` invert automatically in both themes.
