Installation
Install the package and render your first preview.
Install the package
npm install react-native-preview-urlpnpm add react-native-preview-urlyarn add react-native-preview-urlbun add react-native-preview-urlConfirm peer deps
react-native-preview-url declares react and react-native as peer
dependencies — your app provides them. No native code, no autolinking step,
no Metro config changes.
Works on React Native (iOS + Android), Expo (managed and bare), and React Native Web. Same component, no platform branches.
Render your first card
Drop it anywhere a View would go:
import { SafeAreaView } from 'react-native';
import { LinkPreview } from 'react-native-preview-url';
export default function App() {
return (
<SafeAreaView style={{ flex: 1, padding: 16 }}>
<LinkPreview url="https://github.com" />
</SafeAreaView>
);
}The first render fires a network request, shows the built-in skeleton loader, then swaps in the card. Tap the card and the URL opens in the user's browser.
Live preview
The same component, running in this page via react-native-web:
Live · same component, every platform
iOSAndroidWeb
URL
Hit Enter or tap Preview to fetch.
Quick picks
Props
titleLines2
Last event
callback log
Waiting for input. Tap the preview card to fire onPress.