NativeAdSlot
Displays a contextually targeted native ad inline within your app's feed or UI.

Basic Usage
jsx
function CharacterFeed({ character }) {
return character.map((character, index) => (
<>
<Character key={index} name={name} img={img} />
{index % 10 === 9 && (
<NativeAdSlot adUnitId="character-feed" position={Math.floor(index / 10)} />
)}
</>
));
}Props
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
adUnitId | string | No | — | Ad unit ID provided by Simula. Used for measurement and improved targeting. |
position | number | Yes | — | Index position in feed |
context | NativeContext | No | — | Contextual signals for ad relevance |
width | number | string | No | Fills parent | < 1 = percentage, >= 1 = pixels, "80%" = percentage string. Min 320px. |
onImpression | (ad: AdData) => void | No | — | Fires when ad enters viewport |
onError | (error: Error) => void | No | — | Fires on load failure |
NativeContext (Optional, Highly Recommended)
The more context you provide, the better the ad relevance.
typescript
interface NativeContext {
searchTerm?: string;
tags?: string[];
category?: string;
title?: string;
description?: string;
userProfile?: string;
userEmail?: string;
nsfw?: boolean;
customContext?: Record<string, string | string[]>;
}Use customContext for any additional signals that help Simula understand user intent — top character interactions, user profile, etc:
jsx
customContext: {
recentCharactersViewed: [
"Frieren - An immortal elf mage who reflects on centuries of adventure after the hero's journey ends",
"Rudeus Greyrat - A reincarnated shut-in seeking redemption in a fantasy world",
],
}