UNPKG

@ticmakers-react-native/onboarding

Version:

TIC Makers - React Native Onboarding

409 lines (405 loc) 17.3 kB
<!doctype html> <html class="default no-js"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>@ticmakers-react-native/onboarding</title> <meta name="description" content=""> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="assets/css/main.css"> </head> <body> <header> <div class="tsd-page-toolbar"> <div class="container"> <div class="table-wrap"> <div class="table-cell" id="tsd-search" data-index="assets/js/search.js" data-base="."> <div class="field"> <label for="tsd-search-field" class="tsd-widget search no-caption">Search</label> <input id="tsd-search-field" type="text" /> </div> <ul class="results"> <li class="state loading">Preparing search index...</li> <li class="state failure">The search index is not available</li> </ul> <a href="index.html" class="title">@ticmakers-react-native/onboarding</a> </div> <div class="table-cell" id="tsd-widgets"> <div id="tsd-filter"> <a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a> <div class="tsd-filter-group"> <div class="tsd-select" id="tsd-filter-visibility"> <span class="tsd-select-label">All</span> <ul class="tsd-select-list"> <li data-value="public">Public</li> <li data-value="protected">Public/Protected</li> <li data-value="private" class="selected">All</li> </ul> </div> <input type="checkbox" id="tsd-filter-inherited" checked /> <label class="tsd-widget" for="tsd-filter-inherited">Inherited</label> <input type="checkbox" id="tsd-filter-only-exported" /> <label class="tsd-widget" for="tsd-filter-only-exported">Only exported</label> </div> </div> <a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a> </div> </div> </div> </div> <div class="tsd-page-title"> <div class="container"> <ul class="tsd-breadcrumb"> <li> <a href="globals.html">Globals</a> </li> </ul> <h1> @ticmakers-react-native/onboarding</h1> </div> </div> </header> <div class="container container-main"> <div class="row"> <div class="col-8 col-content"> <div class="tsd-panel tsd-typography"> <h1 id="tic-makers-react-native-onboarding">TIC Makers - React Native Onboarding</h1> <p>React native component for onboarding.</p> <p>Powered by <a href="https://ticmakers.com">TIC Makers</a></p> <h2 id="demo">Demo</h2> <p><a href="">Onboarding Expo&#39;s snack</a></p> <h2 id="install">Install</h2> <p>Install <code>@ticmakers-react-native/onboarding</code> package and save into <code>package.json</code>:</p> <p>NPM</p> <pre><code class="language-shell"><span class="hljs-meta">$</span><span class="bash"> npm install @ticmakers-react-native/onboarding --save</span></code></pre> <p>Yarn</p> <pre><code class="language-shell"><span class="hljs-meta">$</span><span class="bash"> yarn add @ticmakers-react-native/onboarding</span></code></pre> <h2 id="how-to-use-">How to use?</h2> <pre><code class="language-javascript"><span class="hljs-keyword">import</span> React <span class="hljs-keyword">from</span> <span class="hljs-string">'react'</span> <span class="hljs-keyword">import</span> Onboarding <span class="hljs-keyword">from</span> <span class="hljs-string">'@ticmakers-react-native/onboarding'</span> <span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">App</span> <span class="hljs-keyword">extends</span> <span class="hljs-title">React</span>.<span class="hljs-title">Component</span> </span>{ render() { <span class="hljs-comment">// Define the pages, it will be displayed in order</span> <span class="hljs-keyword">let</span> pages = [ { <span class="hljs-attr">backgroundColor</span>: <span class="hljs-string">'#fff'</span>, <span class="hljs-attr">image</span>: &lt;Image source={ require('assets/circle.png') } /&gt;, subtitle: 'Done with React Native Onboarding Swiper', title: 'Onboarding', }, { backgroundColor: '#fe6e58', image: &lt;Image source={ require('assets/square.png') } /&gt;, subtitle: 'This is the subtitle that sumplements the title.', title: 'The Title', }, { backgroundColor: '#999', image: &lt;Image source={ require('assets/triangle.png') } /&gt;, subtitle: 'Beautiful, isn\'t it?', title: 'Triangle', } ] return ( &lt;Onboarding pages={ pages } onDone={ () =&gt; this.props.navigation.navigate('RouteName') } /&gt; ) } }</code></pre> <h2 id="properties">Properties</h2> <table> <thead> <tr> <th>Name</th> <th>Type</th> <th>Default Value</th> <th>Definition</th> </tr> </thead> <tbody><tr> <td>bottomBarHeight <code>(optional)</code></td> <td>number</td> <td>60</td> <td>A number for the height of the bottom bar</td> </tr> <tr> <td>bottomBarHighlight <code>(optional)</code></td> <td>boolean</td> <td>true</td> <td>A bool flag indicating whether the bottom bar should be highlighted</td> </tr> <tr> <td>containerStyles <code>(optional)</code></td> <td>object { ...styles }</td> <td>-</td> <td>Override the default container styles</td> </tr> <tr> <td>controlStatusBar <code>(optional)</code></td> <td>boolean</td> <td>true</td> <td>A bool flag indicating whether the status bar should change with the background color</td> </tr> <tr> <td>defaultPages <code>(optional)</code></td> <td>boolean</td> <td>false</td> <td>Use 3 pages generated by default</td> </tr> <tr> <td>imageContainerStyles <code>(optional)</code></td> <td>object { ...styles }</td> <td>-</td> <td>Override the default image container styles</td> </tr> <tr> <td>nextLabel <code>(optional)</code></td> <td>string / Element</td> <td>Next</td> <td>A string or a React-Native component for the Next label</td> </tr> <tr> <td>onDone</td> <td>function</td> <td>-</td> <td>A callback that is fired after the OnBoarding is completed</td> </tr> <tr> <td>onSkip <code>(optional)</code></td> <td>function</td> <td>-</td> <td>A callback that is fired if the OnBoarding is skipped</td> </tr> <tr> <td>pages</td> <td>array of object { pagesProperties }</td> <td>-</td> <td>A array of pages to show in the component. <code>Show below pagesProperties</code></td> </tr> <tr> <td>pageIndexCallback <code>(optional)</code></td> <td>function(indexPage: number)</td> <td>-</td> <td>A function that receives the page index as a parameter on page change</td> </tr> <tr> <td>skipLabel <code>(optional)</code></td> <td>string / Element</td> <td>Skip</td> <td>A string OR a React-Native component for the Skip label</td> </tr> <tr> <td>skipToPage <code>(optional)</code></td> <td>number</td> <td>-</td> <td>When pressing skip, go to that page (ex. skipToPage={2}). <code>If this prop is provided, ignores onSkip</code></td> </tr> <tr> <td>subtitleStyles <code>(optional)</code></td> <td>object { ...styles }</td> <td>-</td> <td>Override the default subtitle styles</td> </tr> <tr> <td>titleStyles <code>(optional)</code></td> <td>object { ...styles }</td> <td>-</td> <td>Override the default title styles</td> </tr> <tr> <td>transitionAnimationDuration <code>(optional)</code></td> <td>number</td> <td>500</td> <td>The duration in milliseconds for the animation of the background color for the page transition</td> </tr> </tbody></table> <h2 id="pages-properties">Pages properties</h2> <table> <thead> <tr> <th>Name</th> <th>Type</th> <th>Default Value</th> <th>Definition</th> </tr> </thead> <tbody><tr> <td>backgroundColor</td> <td>string(hex,rgb,etc)</td> <td>-</td> <td>A background color. The color of the font and dots adapts to the background color</td> </tr> <tr> <td>image</td> <td>Element</td> <td>-</td> <td>A React-Native component to display at the top of the page</td> </tr> <tr> <td>title</td> <td>string / Element</td> <td>-</td> <td>A string OR a React-Native component</td> </tr> <tr> <td>titleStyles <code>(optional)</code></td> <td>object { ...styles }</td> <td>-</td> <td>Modify styles of a specific page&#39;s title</td> </tr> <tr> <td>subtitle</td> <td>string / Element</td> <td>-</td> <td>A string OR a React-Native component</td> </tr> <tr> <td>subtitleStyles <code>(optional)</code></td> <td>object { ...styles }</td> <td>-</td> <td>Modify styles of a specific page&#39;s subtitle</td> </tr> </tbody></table> <h2 id="todo">Todo</h2> <ul> <li>Test on Android &amp; iOS</li> <li>Improve and add new features</li> <li>Add more styles</li> <li>Create tests</li> <li>Add new props and components in readme</li> </ul> <h2 id="version-1-2-1-changelog-">Version 1.2.1 (<a href="https://bitbucket.org/ticmakers/rn-onboarding/src/master/CHANGELOG.md">Changelog</a>)</h2> </div> </div> <div class="col-4 col-menu menu-sticky-wrap menu-highlight"> <nav class="tsd-navigation primary"> <ul> <li class="globals "> <a href="globals.html"><em>Globals</em></a> </li> <li class=" tsd-kind-external-module"> <a href="modules/_dot_dot_.html">"<wbr>Dot/<wbr>Dot"</a> </li> <li class=" tsd-kind-external-module"> <a href="modules/_dot_index_d_.html">"<wbr>Dot/index.d"</a> </li> <li class=" tsd-kind-external-module"> <a href="modules/_dot_styles_.html">"<wbr>Dot/styles"</a> </li> <li class=" tsd-kind-external-module"> <a href="modules/_dots_dots_.html">"<wbr>Dots/<wbr>Dots"</a> </li> <li class=" tsd-kind-external-module"> <a href="modules/_dots_index_d_.html">"<wbr>Dots/index.d"</a> </li> <li class=" tsd-kind-external-module"> <a href="modules/_dots_styles_.html">"<wbr>Dots/styles"</a> </li> <li class=" tsd-kind-external-module"> <a href="modules/_onboarding_onboarding_.html">"<wbr>Onboarding/<wbr>Onboarding"</a> </li> <li class=" tsd-kind-external-module"> <a href="modules/_onboarding_index_d_.html">"<wbr>Onboarding/index.d"</a> </li> <li class=" tsd-kind-external-module"> <a href="modules/_onboarding_styles_.html">"<wbr>Onboarding/styles"</a> </li> <li class=" tsd-kind-external-module"> <a href="modules/_page_page_.html">"<wbr>Page/<wbr>Page"</a> </li> <li class=" tsd-kind-external-module"> <a href="modules/_page_index_d_.html">"<wbr>Page/index.d"</a> </li> <li class=" tsd-kind-external-module"> <a href="modules/_page_styles_.html">"<wbr>Page/styles"</a> </li> <li class=" tsd-kind-external-module"> <a href="modules/_pagination_donebutton_.html">"<wbr>Pagination/<wbr>Done<wbr>Button"</a> </li> <li class=" tsd-kind-external-module"> <a href="modules/_pagination_pagination_.html">"<wbr>Pagination/<wbr>Pagination"</a> </li> <li class=" tsd-kind-external-module"> <a href="modules/_pagination_index_d_.html">"<wbr>Pagination/index.d"</a> </li> <li class=" tsd-kind-external-module"> <a href="modules/_pagination_styles_.html">"<wbr>Pagination/styles"</a> </li> <li class=" tsd-kind-external-module"> <a href="modules/_index_.html">"index"</a> </li> </ul> </nav> <nav class="tsd-navigation secondary menu-sticky"> <ul class="before-current"> </ul> </nav> </div> </div> </div> <footer class="with-border-bottom"> <div class="container"> <h2>Legend</h2> <div class="tsd-legend-group"> <ul class="tsd-legend"> <li class="tsd-kind-module"><span class="tsd-kind-icon">Module</span></li> <li class="tsd-kind-object-literal"><span class="tsd-kind-icon">Object literal</span></li> <li class="tsd-kind-variable"><span class="tsd-kind-icon">Variable</span></li> <li class="tsd-kind-function"><span class="tsd-kind-icon">Function</span></li> <li class="tsd-kind-function tsd-has-type-parameter"><span class="tsd-kind-icon">Function with type parameter</span></li> <li class="tsd-kind-index-signature"><span class="tsd-kind-icon">Index signature</span></li> <li class="tsd-kind-type-alias"><span class="tsd-kind-icon">Type alias</span></li> </ul> <ul class="tsd-legend"> <li class="tsd-kind-enum"><span class="tsd-kind-icon">Enumeration</span></li> <li class="tsd-kind-enum-member"><span class="tsd-kind-icon">Enumeration member</span></li> <li class="tsd-kind-property tsd-parent-kind-enum"><span class="tsd-kind-icon">Property</span></li> <li class="tsd-kind-method tsd-parent-kind-enum"><span class="tsd-kind-icon">Method</span></li> </ul> <ul class="tsd-legend"> <li class="tsd-kind-interface"><span class="tsd-kind-icon">Interface</span></li> <li class="tsd-kind-interface tsd-has-type-parameter"><span class="tsd-kind-icon">Interface with type parameter</span></li> <li class="tsd-kind-constructor tsd-parent-kind-interface"><span class="tsd-kind-icon">Constructor</span></li> <li class="tsd-kind-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li> <li class="tsd-kind-method tsd-parent-kind-interface"><span class="tsd-kind-icon">Method</span></li> <li class="tsd-kind-index-signature tsd-parent-kind-interface"><span class="tsd-kind-icon">Index signature</span></li> </ul> <ul class="tsd-legend"> <li class="tsd-kind-class"><span class="tsd-kind-icon">Class</span></li> <li class="tsd-kind-class tsd-has-type-parameter"><span class="tsd-kind-icon">Class with type parameter</span></li> <li class="tsd-kind-constructor tsd-parent-kind-class"><span class="tsd-kind-icon">Constructor</span></li> <li class="tsd-kind-property tsd-parent-kind-class"><span class="tsd-kind-icon">Property</span></li> <li class="tsd-kind-method tsd-parent-kind-class"><span class="tsd-kind-icon">Method</span></li> <li class="tsd-kind-accessor tsd-parent-kind-class"><span class="tsd-kind-icon">Accessor</span></li> <li class="tsd-kind-index-signature tsd-parent-kind-class"><span class="tsd-kind-icon">Index signature</span></li> </ul> <ul class="tsd-legend"> <li class="tsd-kind-constructor tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited constructor</span></li> <li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited property</span></li> <li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited method</span></li> <li class="tsd-kind-accessor tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited accessor</span></li> </ul> <ul class="tsd-legend"> <li class="tsd-kind-property tsd-parent-kind-class tsd-is-protected"><span class="tsd-kind-icon">Protected property</span></li> <li class="tsd-kind-method tsd-parent-kind-class tsd-is-protected"><span class="tsd-kind-icon">Protected method</span></li> <li class="tsd-kind-accessor tsd-parent-kind-class tsd-is-protected"><span class="tsd-kind-icon">Protected accessor</span></li> </ul> <ul class="tsd-legend"> <li class="tsd-kind-property tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private property</span></li> <li class="tsd-kind-method tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private method</span></li> <li class="tsd-kind-accessor tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private accessor</span></li> </ul> <ul class="tsd-legend"> <li class="tsd-kind-property tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static property</span></li> <li class="tsd-kind-call-signature tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static method</span></li> </ul> </div> </div> </footer> <div class="container tsd-generator"> <p>Generated using <a href="http://typedoc.org/" target="_blank">TypeDoc</a></p> </div> <div class="overlay"></div> <script src="assets/js/main.js"></script> <script>if (location.protocol == 'file:') document.write('<script src="assets/js/search.js"><' + '/script>');</script> </body> </html>