Code Monkey home page Code Monkey logo

react-native-link-preview's Introduction

React Native Link Preview

npm build Maintainability Test Coverage type-coverage

Fully customizable preview of the URL 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
enableAnimation boolean Enables LayoutAnimation
header string Text above the link
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
renderHeader (string) => ReactNode Custom header 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

react-native-link-preview's People

Contributors

anton-cleo avatar demchenkoalex avatar vdanylov avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.