1.1.9 • Published 3 years ago

react-native-url-preview-tgp v1.1.9

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

react-native-url-preview-tgp - fork of react-native-url-preview

Parses text and wraps URLs , transform the url to a beautiful link preview

Getting started

$ npm install react-native-url-preview --save

Usage

import RNUrlPreview from 'react-native-url-preview';

<RNUrlPreview text={"any text to be parsed , https://www.youtube.com/watch?v=Kmiw4FYTg2U"}/>

Examples

Please refer to the react-native-url-preview example provided to see how react-native-url-preview can be used .

Demo

Customization

ParameterRequired?DefaultTypeDescription
textYESNullstringThe text that is parsed and where the URL is retrieved
titleNOTrueBooleandetermine whether the URL title is displyed or not
descriptionNOTrueBooleandetermine whether the URL description is displyed or not
titleStyleNOdefaultStylestyleself explanatory i believe
containerStyleNOdefaultStylestyleyou can pass a custom container style
imageStyleNOdefaultStylestyleyou can pass a custom image style
faviconStyleNOdefaultStylestyleyou can pass a custom favicon style
textContainerStyleNOdefaultStylestyleyou can pass a custom style for the text container
descriptionStyleNOdefaultStylestyleself explanatory i believe
titleNumberOfLinesNO2numberself explanatory i believe
descriptionNumberOfLinesNOIpad?4:3numberself explanatory i believe
imagePropsNO{ resizeMode: "contain"}objectyou can pass a custom props to image
requestOptionsNO{}objectpass additional options to url preview request
onLoadNO() => {}functioncallback called when url preview data is loaded
onErrorNO() => {}functioncallback called if url preview fails to load

Credits