Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Jun 5, 2023. It is now read-only.

startwithlucy/react-native-link-preview

 
 

Repository files navigation

React Native Link Preview

npm build Maintainability Test Coverage type-coverage

Fully customizable preview of the link extracted from the provided text.

Getting Started

yarn add @flyerhq/react-native-link-preview

Usage

import { LinkPreview } from '@flyerhq/react-native-link-preview'
// ...
return (
  <LinkPreview text='This link https://github.com/flyerhq can be extracted from the text' />
)

Props

Required

Name Type Description
text string Text to extract the link from

Optional

Name Type Description
containerStyle ViewStyle Top level container style
metadataContainerStyle ViewStyle Title, description and minimized image container style
metadataTextContainerStyle ViewStyle Title and description container style
onPreviewDataFetched (PreviewData) => void Callback to get the fetched preview data
previewData PreviewData Data to render instead of parsing the provided text
renderDescription (string) => ReactNode Custom description render prop
renderImage (PreviewDataImage) => ReactNode Custom image render prop
renderLinkPreview ({ aspectRatio?: number, containerWidth: number, previewData?: PreviewData }) => ReactNode Custom render prop
renderMinimizedImage (PreviewDataImage) => ReactNode Custom minimised image render prop
renderText (string) => ReactNode Custom provided text render prop
renderTitle (string) => ReactNode Custom title render prop
textContainerStyle ViewStyle Text, title, description and minimized image container style
touchableWithoutFeedbackProps TouchableWithoutFeedbackProps Top level touchable props

License

MIT

About

Fully customizable preview of the link extracted from the provided text.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 68.0%
  • Kotlin 15.4%
  • JavaScript 6.5%
  • Swift 5.6%
  • Starlark 2.0%
  • Ruby 1.8%
  • Objective-C 0.7%