Skip to content

Repository files navigation

React PDF Kit Starter Toolkit in Expo React Native and TypeScript

Welcome to the React PDF Kit Starter Toolkit for Expo React Native. This repository demonstrates a simple URL domain method by loading https://www.react-pdf-kit.dev/ inside a React Native WebView.

Table of Contents

Usage

Project Setup

  1. Clone the Repository: If you haven't already, clone the repository and navigate into the project directory.

    git clone https://github.com/react-pdf-kit/starter-rp-react-native-ts.git
    cd starter-rp-react-native-ts
  2. Install Dependencies: Install the necessary dependencies using npm, yarn, pnpm or bun.

    npm install
    # or
    yarn install
    # or
    pnpm install
    # or
    bun install

Running the Example Project

This repository includes an Expo example project to demonstrate the URL domain method in action.

  1. Start the Development Server: Use the following command to start the Expo dev server.

    npm run start
    # or
    yarn start
    # or
    pnpm start
    # or
    bun run start
  2. Open a Platform Build: Launch the sample on the platform you want to test.

    npm run ios
    npm run android
    npm run web
  3. Check the Sample URL: The app renders https://www.react-pdf-kit.dev/ inside a WebView. Update src/constants/urls.ts if you want to point the sample at a different URL.

Using The URL Domain Method

This example uses react-native-webview to load the React PDF Kit site inside the app. The reusable wrapper lives in src/components/AppWebView.tsx and the shared URL constant lives in src/constants/urls.ts.

import { WebView } from "react-native-webview";

export default function AppWebView() {
  return <WebView source={{ uri: "https://www.react-pdf-kit.dev/" }} />;
}

The main app screen follows the same simple teaching pattern as the Next.js starter: one entry screen and multiple sample variants in a single app.

Examples

For more examples, please refer to the App.tsx file in this repository:

  • Default WebView
  • Compact Mobile View
  • Browser Handoff

Meta


Thank you for using React PDF Kit! We hope this starter helps you build mobile experiences quickly with Expo and React Native.