Documentation Index
Fetch the complete documentation index at: https://docs.adrop.io/llms.txt
Use this file to discover all available pages before exploring further.
Available in Adrop Web SDK 1.2.3 or later.
TL;DR
- The default mode is
responsive. Most publishers can leave it as-is. - Use
fixedonly when the ad slot must be pinned to a fixed height by your card/grid design. - Express the container’s size intent (height / aspect-ratio) as an inline style — using a CSS class or Tailwind alone is not recommended.
Mode Comparison
| Mode | Behavior | Recommended for |
|---|---|---|
responsive (default) | Picks the ad size that fits the container width. If the container has no explicit size intent, the SDK reserves a sensible min-height to prevent content shifting (CLS). | General slots that allow dynamic height. Best for both revenue and UX. |
fixed | Stretches the ad to the container height (width:100%; height:100%). Width-based auto-sizing is disabled. | Slots whose height is pinned by a card/grid design and would break under responsive. |
What is CLS?
Cumulative Layout Shift is the phenomenon where content gets pushed down as an ad loads late in the page lifecycle. A button users were about to tap suddenly moves, causing misclicks. It also affects search ranking and ad revenue. Theresponsive mode reserves space ahead of time to reduce this shift.
Which Mode Should I Use?
Keep the defaultresponsive. Opt into fixed only when:
- Your ad area height is pinned to the pixel by a card/grid design and must not be altered.
- The slot needs pixel-perfect alignment with adjacent content (e.g. header, sidebar).
How to Set the Mode
Narrower scope wins. The resolution order is:1. Per-slot, programmatic (renderAd)
2. Per-slot, HTML attribute (declarative)
3. Publisher-wide default
'responsive' is applied.
Recommended Container Pattern
Always express your size intent (height / aspect-ratio) as an inline style. When inline intent is present, the SDK skips auto-reservation and preserves your design. The four inline properties the SDK recognizes as size intent are:heightmin-heightmax-heightaspect-ratio
All other styles — width, padding, margin, color, border, shadow, transition, etc. — can use CSS classes or Tailwind freely. Only those four size-intent properties need to be inline.
Recommended
Not Recommended
-
Move size intent to inline style (recommended)
-
Disable auto-reservation
Auto-Reservation Behavior (responsive mode)
Inresponsive mode, the SDK reserves a safe minimum height based on the container width.
- If the actual ad is larger than the reserved value, the container expands naturally (the jump is just smaller).
- If the actual ad is smaller, the empty space remains (no jump occurs).
- Only
min-heightis set — nevermax-height— so there is no overflow risk.
Upgrading to 1.2.3
| Container state | Impact |
|---|---|
| inline height / aspect-ratio present | No change (existing behavior preserved) |
| No size intent | Empty-space jump is reduced via auto-reservation. Ad behavior is unchanged. |
| Size intent pinned only via CSS class / Tailwind | Auto-reservation may extend container height — see Not Recommended and fix. |
responsive, most upgrades are safe with no code changes. To freeze design at the 1.2.1 behavior, restore with a single line of fixed opt-in (global or per-slot).
Related Guides
Banner Ads (React)
Implement banner ads in React
Banner Ads (CDN)
Implement banner ads via CDN
Reference
BackfillMode type definition