Site
Proof block
The site's proof section: a White lead line centered over the proof marquee of marks, 40px apart, with the section's padding under it; it follows a hero or a page head.
Install
React apps get the React files; every other stack gets the web component.
npx spyglass-ds add proof-block<script type="module" src="/spyglass-ds/elements/proof-block.js"></script>Usage
Under a hero or a page head, to show who uses the product, with marks you are allowed to show.
Never
- Third-party logos without permission: the default marks are Acme wordmarks
- A section head in place of the lead line
Adds with it: proof-strip
Props
The web component takes the same as attributes or properties (<spyglass-proof-block>); title is heading there.
<ProofBlock>
| Prop | Type | Default |
|---|---|---|
title | string The line over the marks. | 'Trusted by teams and agents at' |
logos | ProofLogo[] | proofPlaceholders |
id | string Names the heading (`<id>-title`). | 'proof' |
className | string |
Examples
The same example in React and as web components; both render identically.
import { ProofBlock } from '@/react/components/site/ProofBlock'
// The proof section with Acme placeholder marks.
export default function Default() {
return <ProofBlock className="w-full" />
}<!-- The proof section with Acme placeholder marks. -->
<spyglass-proof-block class="w-full"></spyglass-proof-block>Source
import { ProofStrip, proofPlaceholders, type ProofLogo } from '@/react/components/site/ProofStrip'
import { cn } from '@/react/lib/cn'
// The site's proof section (v3/V3Proof): a White lead line (20/28) centered over the proof marquee, 40px apart, with
// the section's padding under it only (it follows a hero). Marks come through `logos` (Acme placeholders by default);
// the strip runs them twice per loop, as the site's V3Proof does, so each 68s pass moves two sets.
export interface ProofBlockProps {
/** The line over the marks. */
title?: string
logos?: ProofLogo[]
/** Names the heading (`<id>-title`). */
id?: string
className?: string
}
export function ProofBlock({ title = 'Trusted by teams and agents at', logos = proofPlaceholders, id = 'proof', className }: ProofBlockProps) {
return (
<section data-ds="proof-block" aria-labelledby={`${id}-title`} className={cn('pb-(--ds-layout-section) text-fg', className)}>
<div className="mx-auto flex w-full max-w-[calc(var(--ds-layout-content)+2*var(--ds-layout-gutter))] flex-col items-center gap-10 px-(--ds-layout-gutter) text-center">
<h2 id={`${id}-title`} className="max-w-(--ds-layout-measure) type-body-lg text-pretty text-fg">{title}</h2>
<ProofStrip logos={[...logos, ...logos]} />
</div>
</section>
)
}
export default ProofBlock// 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(' ')
}import { html } from 'lit'
import { DsElement, define, HostLayoutController } from '@/elements/lib/element'
import { proofPlaceholders, type ProofLogo } from '@/elements/components/site/proof-strip'
import '@/elements/components/site/proof-strip'
import styles from 'virtual:tw'
// ProofBlock.tsx as <spyglass-proof-block>: the White lead line centered over the proof marquee, the section's padding
// under it only. `heading` (React's `title`), `logos` (JSON: { name, src?, ratio?, height? }), `head-id`.
/** @summary The proof section: a lead line over the marquee of marks. */
export class ProofBlock extends DsElement {
static styles = [DsElement.styles, styles]
protected readonly layout = new HostLayoutController(this, () => this.renderRoot.querySelector<HTMLElement>('[data-ds="proof-block"]'))
static properties = { heading: {}, logos: { type: Array }, headId: { attribute: 'head-id' } }
/** The line over the marks (React's `title`). */
heading = 'Trusted by teams and agents at'
logos: ProofLogo[] = proofPlaceholders
/** Names the heading (React's `id`). */
headId = 'proof'
render() {
return html`<section data-ds="proof-block" aria-labelledby=${`${this.headId}-title`} class="pb-(--ds-layout-section) text-fg"><div class="mx-auto flex w-full max-w-[calc(var(--ds-layout-content)+2*var(--ds-layout-gutter))] flex-col items-center gap-10 px-(--ds-layout-gutter) text-center"><h2 id=${`${this.headId}-title`} class="max-w-(--ds-layout-measure) type-body-lg text-pretty text-fg">${this.heading}</h2><spyglass-proof-strip .logos=${[...(this.logos ?? proofPlaceholders), ...(this.logos ?? proofPlaceholders)]}></spyglass-proof-strip></div></section>`
}
}
define('proof-block', ProofBlock)Reference: Site v3/V3Proof (V3Proof.tsx, V3Proof.module.css): .section with no top padding, a 40px gap, .t-lead at the regular weight in --text, the ProofStrip under it with the logos twice per copy (stripLogos), .t-lead's measure and pretty wrap.