Render URL links for Web & Twitter previews

Overview

expo-link-preview

Render URL links for Web & Twitter previews

render twitter preview

Built with react-native using expo.

Installation

# yarn
yarn add expo-link-preview

# npm
npm install expo-link-preview --save

Then import with

import LinkPreview from "expo-link-preview";

Note: You may also need to install dependencies react-native-opengraph-kit and javascript-time-ago.

Usage

Example:

import { View, StyleSheet } from "react-native";
import LinkPreview from "expo-link-preview";

export default function App() {
  return (
    <View style={styles.container}>
      <LinkPreview
        link="http://github.com"
      />
    </View>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
  },
});

Web

Web previews will automatically use OpenGraph information to populate the preview. If an image is present, LinkPreview will default to that, otherwise show a non-interactive web view of the page.

render web preview

Twitter

Twitter previews will automatically be used if the OpenGraph response returns site_name=Twitter. The Twitter preview automatically adjusts to handle basic tweets and up to four images.

render twitter preview

Props

Prop Required? Type Description
link true string The link to render the preview. Links are automatically validated, but should be passed as a string value that begins with "https://".
onPress false function The onPress function is called whenever a user taps the preview.
containerColor false string The background color of the preview container. Defaults to iOS themed component.
borderColor false string The border color of the preview container. Defaults to iOS themed component.
titleColor false string The text color of the Header – typically the website title or the Twitter user name. Defaults to iOS themed component.
textColor false string The text color of the Text – typically the website description or the Twitter user handle and tweet. Defaults to iOS themed component.

Twitter-specific props

Prop Required? Type Description
twitterLogoColor false string The tint color of the Twitter logo. Defaults to Twitter Blue.
showLikes false bool Enable/disable the Likes counter. Defaults to true.
showRetweets false bool Enable/disable the Retweets counter. Defaults to true.
showReplies false bool Enable/disable the Replies counter. Defaults to true.

Color example

Example:

import { View, StyleSheet } from "react-native";
import LinkPreview from "expo-link-preview";

export default function App() {
  return (
    <View style={styles.container}>
      <LinkPreview
        link="http://github.com"
        containerColor={"pink"}
        titleColor={"blue"}
        textColor={"yellow"}
        borderColor={"red"}
      />
    </View>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
  },
});

web color render

Built by Tyler J. ✌️

You might also like...

An easily internationalizable, mobile-friendly datepicker library for the web

An easily internationalizable, mobile-friendly datepicker library for the web

react-dates An easily internationalizable, accessible, mobile-friendly datepicker library for the web. Live Playground For examples of the datepicker

Dec 30, 2022

Mobile app development framework and SDK using HTML5 and JavaScript. Create beautiful and performant cross-platform mobile apps. Based on Web Components, and provides bindings for Angular 1, 2, React and Vue.js.

Mobile app development framework and SDK using HTML5 and JavaScript. Create beautiful and performant cross-platform mobile apps. Based on Web Components, and provides bindings for Angular 1, 2, React and Vue.js.

Onsen UI - Cross-Platform Hybrid App and PWA Framework Onsen UI is an open source framework that makes it easy to create native-feeling Progressive We

Jan 8, 2023

stateful roving index for web ui

Roving UX Turns tedious tab UX into a controlled and stateful experience Learn more in this article by Rob Dodson on web.dev Try it at this GUI Challe

Dec 9, 2022

Aplicação web desenvolvida durante a Imersão React #3 da Alura

Aplicação web desenvolvida durante a Imersão React #3 da Alura

Sobre o projeto 💬 O Alurakut é uma aplicação web clone do nosso queridíssimo e já falecido Orkut, porém trazendo uma interface mais moderna e utiliza

May 2, 2022

Web Audio API based Pitch Tuner application made with ReactJS.

Pitch Tuner Pitch Tuner is a ReactJS application based on WebAudio API. You can tune your guitar/ukelele from online without any application! The algo

Jul 11, 2022

Aplikasi web serderhana untuk mencari resep masakan khas indonesia yang dibuat menggunakan ReactJS.

Aplikasi web serderhana untuk mencari resep masakan khas indonesia yang dibuat menggunakan ReactJS.

Gorecipe Aplikasi web serderhana untuk mencari resep masakan khas indonesia yang dibuat menggunakan ReactJS. Setup Download ZIP / Clone repo gorecipe

Dec 13, 2021

A web application which has leetcode questions listed on the basis of different companies.

URL A web application which has leetcode questions listed on the basis of different companies. This project was made using React.js and Flask to help

May 24, 2022

Work from is a web app created by Josh Cawthorne for the Supabase Hackathon.

Work from is a web app created by Josh Cawthorne for the Supabase Hackathon.

Work From What is Work From? Work from is a web app created by Josh Cawthorne for the Supabase Hackathon. The concept of the app is for companies to b

Jan 3, 2023

A Workspace Web App powered by React and Node Js.

zc_main This is the Zuri Chat frontend built with ExpressJS (Backend) and React (Frontend) Getting Started. Make sure you have nodejs installed by run

Dec 14, 2022
Comments
Releases(react-native-link-render)
  • react-native-link-render(Feb 27, 2022)

Owner
null
Twitter-client - client for twitter-clone

Twitter (Client-Side Rendering) Please star this repo if you like ⭐ It's motivates me a lot! Getting Started This project was bootstrapped with Create

Ruslan Shvetsov 3 Jul 29, 2022
A URL shortener that has zero limits for all your needs

?? GunRecoil A URL shortener that has zero limits for all your needs Demo Link GunRecoil Screenshots Features FREE Unlimited url shortening Roadmap De

null 9 Oct 1, 2022
:art: Color Pickers from Sketch, Photoshop, Chrome, Github, Twitter & more

React Color 13 Different Pickers - Sketch, Photoshop, Chrome and many more Make Your Own - Use the building block components to make your own Demo Liv

case 11.2k Jan 6, 2023
Take back your twitter feed, by instantly muting all engagement farmers.

Take back your Twitter feed Obliterate all ?? ?? 's from your feed with one-click, and go back to enjoying the content you actually care about. mute.g

Miguel Piedrafita 18 Oct 15, 2022
트친소 짤 생성기 / website about self introduce for twitter-friend

Twitter Friend Introduction 트친소란 트위터에서 SNS 친구를 구할 때, 스스로를 소개하는 것이다. 사진 형태의 자기소개서와 올리는 경우가 많으며, 계정의 주제에 맞는 자기소개서 형식의 이미지를 다운 받아 직접 작성하는 방식이 널리 쓰인다. 이미지

Shin Hyun 16 Dec 9, 2022
Set up a modern web app by running one command.

Create React App Create React apps with no build configuration. Creating an App – How to create a new app. User Guide – How to develop apps bootstrapp

Facebook 98.4k Jan 1, 2023
📓 The UI component explorer. Develop, document, & test React, Vue, Angular, Web Components, Ember, Svelte & more!

Build bulletproof UI components faster Storybook is a development environment for UI components. It allows you to browse a component library, view the

Storybook 75.8k Jan 4, 2023
React Starter Kit — isomorphic web app boilerplate (Node.js, Express, GraphQL, React.js, Babel, PostCSS, Webpack, Browsersync)

React Starter Kit — "isomorphic" web app boilerplate React Starter Kit is an opinionated boilerplate for web development built on top of Node.js, Expr

Kriasoft 21.7k Dec 30, 2022
📋 React Hooks for forms validation (Web + React Native)

English | 繁中 | 简中 | 日本語 | 한국어 | Français | Italiano | Português | Español | Русский | Deutsch | Türkçe Features Built with performance and DX in mind

React Hook Form 32.4k Dec 29, 2022
A React-based UI toolkit for the web

Blueprint Blueprint is a React-based UI toolkit for the web. It is optimized for building complex, data-dense web interfaces for desktop applications

Palantir Technologies 19.5k Jan 3, 2023