/react-native-twitter-preview

React Native library for previewing embedded Twitter tweets using their URL. The library provides a customizable preview of a tweet's author, text, and media content, allowing developers to match the preview's appearance to their app's design.

Primary LanguageJavaMIT LicenseMIT

npm version npm downloads npm license

react-native-twitter-preview

React Native library for previewing embedded Twitter tweets using their URL. The library provides a customizable preview of a tweet's author, text, and media content, allowing developers to match the preview's appearance to their app's design.

Installation

npm install react-native-twitter-preview

or

yarn add react-native-twitter-preview

You need react-native-webview in your project

npm install react-native-webview

or

yarn add react-native-webview

Usage

import { TwitterPreviewView } from 'react-native-twitter-preview';

// ...

<TwitterPreview
  url={'https://twitter.com/elonmusk/status/1636162726140493825'}
  backgroundColor={'#272A35'}
/>


Props

Name Description Type Required? Default
url Tweet url string V
style Tweet container style object (style)
backgroundColor Background color behind the tweet string '#FFF'
onPressTweet Called when a tweet is pressed Function Opens the tweet in the browser

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT


Author

Made by Idanlevi1