npm package: @itartist/react-native-opengraph-parser
Description: React Native OpenGraph parser with binary data support
Author: Joshua Kim
Latest version: 0.0.1

# React Native OpenGraph Parser

## Getting Started

```sh
yarn add @itartist/react-native-opengraph-parser
```

## Usage

```ts
import { LinkPreview } from '@itartist/react-native-opengraph-parser'
// ...
return (
  <LinkPreview text='This link https://github.com/itartist 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](https://reactnative.dev/docs/view-style-props)                                 | Top level container style                                    |
| enableAnimation               | boolean                                                                                    | Enables `LayoutAnimation`                                    |
| header                        | string                                                                                     | Text above the link                                          |
| metadataContainerStyle        | [ViewStyle](https://reactnative.dev/docs/view-style-props)                                 | Title, description and minimized image container style       |
| metadataTextContainerStyle    | [ViewStyle](https://reactnative.dev/docs/view-style-props)                                 | 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](https://reactnative.dev/docs/view-style-props)                                 | Text, title, description and minimized image container style |
| touchableWithoutFeedbackProps | TouchableWithoutFeedbackProps                                                              | Top level touchable props                                    |

## License

[MIT](LICENSE)