1.0.1 • Published 4 years ago

react-mobile-banner v1.0.1

Weekly downloads
352
License
MIT
Repository
github
Last release
4 years ago

react-mobile-banner

React Js smart Mobile Browser banner for android ,ios and windows

NPM JavaScript Style Guide

Install

npm install --save react-mobile-banner

Usage

import React from 'react'
import MobileBanner from 'react-mobile-banner';

export default class App extends React.Component{
   constructor(props) {
     super(props)
     this.state = {
        bannerShow:true
     };
   };
  render(){
    const { bannerShow } = this.state;
    return (
      <div>
        <MobileBanner 
            showBanner={bannerShow} 
            position="top"
            topStickyBanner={true}
            appTitle='Linked In'
            appDescription='Job Search and Networking'
            appId={{android:'com.linkedin.android',ios:'id288429040'}}
            starRatingCount={4}
            backgroundColor=""
            appIcon={require('./appIcon.png')}
            onClose={()=>this.setState({bannerShow:false})}
            onInstall={()=>alert('install Clicked')}
        />
        <p>
        ....paragraphs
        </p>
             
      </div>
    );
}
}

Available Props

key propstypedefualtsavailableexampledescriptions
showBannerbooltruetrue, false{true}to show or hide the Banner
positionstring'top''top', 'bottom'{'bottom'}Postion of the banner
topStickyBannerbooltruetrue, false{true}stay top of the page
backgroundColorstring'white''black', '#ccc' ...etc{'#ccc'}Change the Background Color of the Banner
appIdObject{}android,ios and Windows{ios: '', android: '', windows: '', }Add Appliction Id of the Stores
closeButtonStyleObject{}{all type of css styles}{color:'#fff', ...},Add style to Close Icon
onClosefunction{}{}{()=>alert('Close clicked")},Event on Close button Click
appIconstring''png,svg,jpeg,jpg etc.."url" or {require('..path.png')}App Icon Source
appIconStyleObject{}{all type of css styles}{color:'#fff', ...},Add style to App Icon
appTitlestring'App Title'all type of strings{'Linked In'}App title
appTitleStylesObject{}{all type of css styles}{color:'#fff', ...},Add style to App Title
appDescriptionstring'App Descriptions'all type of strings{'App Developer Company'}App Descriptions
appDescriptionStyleObject{}{all type of css styles}{color:'#fff', ...},Add style to App Descriptions
starRatingbooltruetrue, false{true}to show or hide the Rating Stars
starRatingCountnumber51 - 5{4}Ratings of Applications out of 5 star
priceObject{}android,ios and Windows{ios: '$ 10', android: 'FREE', windows: '$ 23', }Add Price to Apps
buttonTextstring'View'all type of strings{'Insall Now'}App Download Button title
buttonStyleObject{}{all type of css styles}{color:'#fff', ...},Add style to Download Button
onInstallfunction{}{}{()=>alert('Install Button clicked")},Event on Install button Click

Donate

Example

BottomTop
npm.ionpm.io

License

MIT © Ajith A B