react-native-text-demo
v0.1.0
Published
test demo npm
Readme
react-native-text-demo
React Native ad demo package with built-in ad URLs.
Installation
npm install react-native-text-demoUsage
import React, { useState } from 'react';
import { View, Button } from 'react-native';
import { BannerAd, FullscreenAd } from 'react-native-text-demo';
export default function Screen() {
const [open, setOpen] = useState(false);
return (
<View style={{ flex: 1, justifyContent: 'space-between' }}>
<Button title="Show Fullscreen Ad" onPress={() => setOpen(true)} />
<BannerAd
bannerType="medium"
accessibilityLabel="home-banner"
/>
<FullscreenAd visible={open} onClose={() => setOpen(false)} />
</View>
);
}API
BannerAd
- Built-in banner image URL is selected internally by the library.
- App can pass banner type and normal
Imageprops.
Props:
bannerType?: 'small' | 'medium' | 'large'containerStyle?containerProps?- All standard
ImageProps(exceptsource)
FullscreenAd
- Built-in fullscreen ad image URL is internal.
- App controls visibility and close behavior.
Props:
visible: booleanonClose: () => voidcloseText?: string- All standard
ImageProps(exceptsource)
adsDemo(config)
Returns resolved internal ad config:
adsDemo({ type: 'fullscreen' })adsDemo({ type: 'banner', bannerType: 'small' | 'medium' | 'large' })
Useful when app needs metadata (for logging/debug).
Contributing
License
MIT
