Git Product home page Git Product logo

squatto / react-native-custom-webview Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fahadhaq/react-native-webbrowser

0.0 1.0 4.0 737 KB

This is forked from fahadhaq/react-native-webbrowser (which was forked from magrinj/react-native-webbrowser) -- A cross-platform (iOS / Android), full-featured, highly customizable web browser module for React Native apps.

License: MIT License

JavaScript 77.15% Java 3.87% Objective-C 18.98%

react-native-custom-webview's Introduction

react-native-custom-webview

I am just using the https://github.com/d-a-n/react-native-webbrowser to create a back button. Credit goes to https://github.com/d-a-n/react-native-webbrowser https://github.com/magrinj/react-native-webbrowser

A cross-platform (iOS / Android), full-featured in-app web browser component for React Native that is highly customizable. Currently you can hide the address-, status- and toolbar. Additionally the foreground and background colors can be modified.

Install

npm i react-native-custom-webview --save

Usage

Here is an extensive overview of the component usage.

class SampleApp extends Component {
    render() {
        const goBack = () => 
        {
            this.props.navigation.goBack()
        }
        return (
            <View style={{paddingTop:20, flex:1}}>
                <Webbrowser
                    url="https://facebook.github.io/react-native/docs/"
                    hideHomeButton={false}
                    hideToolbar={false}
                    hideAddressBar={false}
                    hideStatusBar={true}
                    backButtonVisible={true}
                    onBackPress= {() => {goBack()}}
                    foregroundColor="#D61B5D"
                    backgroundColor="#F3848A"
                />
                
            </View>
        );
    }
}

Props

  • url - string required, web address
  • hideAddressBar - bool optional, hides the address bar / address input
  • hideStatusBar - bool optional, hides the status bar / site title
  • hideToolbar - bool optional, hides the toolbar (nav bar)
  • hideHomeButton - bool optional, hides just the home button from the toolbar
  • hideActivityIndicator - booloptional, hides the activity indicator (loading) overlay
  • foregroundColor - string optional, sets the forground color of text and icon elements
  • backgroundColor - string optional, sets the background color
  • onNavigationStateChange - function(navState) optional, url change callback
  • onShouldStartLoadWithRequest - function(event) optional, return false if the request should be stopped

Screenshots

With Back button

   

react-native-custom-webview's People

Contributors

d-a-n avatar squatto 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.