ComponentsSite blocks
A labelled advertising slot (“Advertisement” / “Reklam”). The box is reserved at its final ratio before anything loads, so the page never jumps (no CLS), and it scales down with its column. The ad markup renders — and onReady, the hook point for an ad server, fires — only after the visitor grants the consent category (marketing by default, read from the kit ConsentBanner cookie and updated live). House ads that track nothing pass consent={false}. An aside landmark named by its label.
blocks/site/ad-slot.tsx, blocks/site/shared/news.tsx, blocks/site/shared/consent.ts, styles/blocks.csstheme · material · accent · density · font
Installation
$ pnpm add @vamos-ui/react
The whole kit as one package — get updates by bumping the version. Add the styles to globals.css: @import "@vamos-ui/react/styles.css";
Usage
import { AdSlot } from "@vamos-ui/react/blocks";
<AdSlot size="leaderboard" mobileSize="mobile-banner" slotId="div-gpt-home-top"
onReady={(el) => googletag.cmd.push(() => googletag.display(el.id))} />
<AdSlot size="rectangle" consent={false}><HouseAd /></AdSlot>Examples
Reserved sizes
IAB names (AD_SIZES) or { width, height }. Empty slots show their size in a quiet hatched box.
API
AdSlot
| Prop | Type | Default |
|---|---|---|
sizeleaderboard 728×90 · billboard 970×250 · large-leaderboard 970×90 · rectangle 300×250 · half-page 300×600 · skyscraper 160×600 · mobile-banner 320×50 · large-mobile-banner 320×100 · { width, height }. | AdSize | "rectangle" |
mobileSizeBox below a 40rem container. | AdSize | — |
childrenThe creative; rendered only with consent. | ReactNode | — |
consentCategory that must be granted. false: house ads. | ConsentCategory | false | "marketing" |
consentVersionOlder stored answers don't count. | number | — |
onReadyRuns once consent is granted, with the inner element (id = slotId). | (el) => void | cleanup | — |
slotIdId of the inner element ad servers target. | string | — |
placeholderShown in the empty box. | ReactNode | — |
labelVisible label above the box (keep it; ads must be recognisable). | ReactNode | false | "Advertisement" |
centerCentre in the column. | boolean | true |