Blocks

Footer block

A website's footer band: a hairline above, the footer row (the lockup, links and the domain) inside the page width, and an optional legal line in the muted gray.

Install

React apps get the React files; every other stack gets the web component.

npx spyglass-ds add footer-block
<script type="module" src="/spyglass-ds/elements/footer-block.js"></script>
With links and a legal line

Usage

The foot of every website page.

Never

  • A second logo, social icons in color or a newsletter box inside it
  • Links that move on hover
  • The lockup recolored or resized below its minimum

Adds with it: footer-row

Props

The web component takes the same as attributes or properties (<spyglass-footer-block>); title is heading there.

<FooterBlock>

PropTypeDefault
domainstring

The domain on the right.

linksFooterLink[][]
homeHrefstring

Where the lockup links.

'/'
noteReactNode

A line under the row: "© 2026 Acme Inc."

classNamestring

Examples

The same example in React and as web components; both render identically.

react/examples/footer-block/Site.tsx
import { FooterBlock } from '@/react/components/blocks/FooterBlock'
// A website's footer band with its links and a legal line, for Acme.

const links = [{label: 'Product', href: '/product'}, {label: 'Pricing', href: '/pricing'}, {label: 'About', href: '/about'}, {label: 'Contact', href: '/contact'}, {label: 'Terms', href: '/legal'}]

export default function Site() {
  return <FooterBlock domain="acme.com" note="© 2026 Acme Inc." links={links} />
}
elements/examples/footer-block/Site.html
<!-- A website's footer band with its links and a legal line, for Acme. -->
<spyglass-footer-block domain="acme.com" note="© 2026 Acme Inc." links='[{"label":"Product","href":"/product"},{"label":"Pricing","href":"/pricing"},{"label":"About","href":"/about"},{"label":"Contact","href":"/contact"},{"label":"Terms","href":"/legal"}]'></spyglass-footer-block>

Source

react/components/blocks/FooterBlock.tsx
import type { ReactNode } from 'react'
import { FooterRow, type FooterLink } from '@/react/components/site/FooterRow'
import { cn } from '@/react/lib/cn'

// A website's footer band, as every page template ends: a hairline above, the footer row (the lockup, the links, the
// domain) inside the page width, and an optional line under it in the muted gray (the legal line). Links change color
// on hover; nothing moves.
export interface FooterBlockProps {
  /** The domain on the right. */
  domain: string
  links?: FooterLink[]
  /** Where the lockup links. */
  homeHref?: string
  /** A line under the row: "© 2026 Acme Inc." */
  note?: ReactNode
  className?: string
}

export function FooterBlock({ domain, links = [], homeHref = '/', note, className }: FooterBlockProps) {
  return (
    <footer data-ds="footer-block" className={cn('border-t border-edge bg-surface text-fg', className)}>
      <div className="mx-auto grid w-full max-w-page-wide gap-8 px-12 py-10 max-sm:px-4">
        <FooterRow domain={domain} homeHref={homeHref} links={links} />
        {note && <p className="type-caption text-fg-muted">{note}</p>}
      </div>
    </footer>
  )
}

export default FooterBlock
react/lib/cn.ts
// Joins class names, skipping falsy ones: cn('a', on && 'b', ['c', undefined]). It does not merge conflicting
// utilities (no tailwind-merge), as Vue's class binding does not: the library's classes are written not to compete,
// and a className from the caller is appended after them, as Vue appends a fallthrough class.
export type ClassValue = string | false | null | undefined | 0 | ClassValue[]

export function cn(...values: ClassValue[]): string {
	const out: string[] = []
	for (const v of values) {
		if (!v) continue
		if (Array.isArray(v)) {
			const s = cn(...v)
			if (s) out.push(s)
		}
		else out.push(v)
	}
	return out.join(' ')
}
elements/components/blocks/footer-block.ts
import { html, nothing } from 'lit'
import { DsElement, define, HostLayoutController } from '@/elements/lib/element'
import '@/elements/components/site/footer-row'
import styles from 'virtual:tw'

// FooterBlock.tsx as <spyglass-footer-block>: the hairline, the footer row (`domain`, `links`, `home-href`) inside the
// page width and an optional `note` under it.
export interface FooterLink { label: string; href: string }

/**
 * @summary A website's footer band.
 */
export class FooterBlock extends DsElement {
	static styles = [DsElement.styles, styles]
	protected readonly layout = new HostLayoutController(this, () => this.renderRoot.querySelector<HTMLElement>('[data-ds="footer-block"]'))
	static properties = { domain: {}, links: { type: Array }, homeHref: { attribute: 'home-href' }, note: {} }
	/** The domain on the right. */
	domain = ''
	links: FooterLink[] = []
	/** Where the lockup links. */
	homeHref = '/'
	/** A line under the row. */
	note?: string

	render() {
		return html`<footer data-ds="footer-block" class="border-t border-edge bg-surface text-fg"><div class="mx-auto grid w-full max-w-page-wide gap-8 px-12 py-10 max-sm:px-4"><spyglass-footer-row domain=${this.domain} home-href=${this.homeHref} .links=${this.links ?? []}></spyglass-footer-row>${this.note ? html`<p class="type-caption text-fg-muted">${this.note}</p>` : nothing}</div></footer>`
	}
}

define('footer-block', FooterBlock)

Reference: Built from the library (footer row); the posts' and ads' footer row (lockup left, domain right) and the page templates' footer band.