Dialog


var dialog = new phonepack.Dialog({
    title: 'Loading...',
    content: 'Message',         
}).show(function(){
    dialog.hide();
});

Loading


var loading = new phonepack.Loading({
    spinner: true,
    overlay: true,
    title: 'Loading'
}).show();
                
setTimeout(function() {
    loading.hide();
}, 100);

Notification


var notification = new phonepack.Notification();
notification.simple('simple message');
notification.info('Info message');
notification.success('Success message');
notification.warning('Warning message');
notification.error('Error message');

Side Menu


// Get menu element instance
sideMenu = new phonepack.SideMenu(document.getElementById('side-menu'));

// show/hide menu
sideMenu.toggle();

SideMenu HTML


<div class="side-menu" id="side-menu">
        <header class="header">
            <div class="header__title">Title</div>
        </header>
        <ul class="list">
            <li class="list__item"> Item 01 </li>
            <li class="list__item"> Item 02 </li>
        </ul>
</div>

Pull to refresh (only mobile)


var pullToRefresh = new phonepack.PullToRefresh(document.querySelector('#content'), 
	{ 
		type: 'snake'
	},
	function(){
    setTimeout(function(){
        pullToRefresh.hide();
    }, 5000); 
});
 

Html


    	<div class="content" id="content"></div>
    

TabBar

Javascript


var tabBar = new phonepack.TabBar(document.querySelector('#tab'));
    

Html


<div class="sub-header header--shadow">
    <div id="tab" class="tab-bar bg-indigo tab-bar--text-white tab-bar--indicator-bottom-white">
      <div class="tab-bar__item ripple active" ref="#tab1">
        TEXT 1
      </div>
      <div class="tab-bar__item ripple" ref="#tab2">
        TEXT 2
      </div>
      <div class="tab-bar__item ripple" ref="#tab3">
        TEXT 3
      </div>
    </div>
</div>

  <section class="content content--padding has-header has-sub-header" id="tab1">
      Tab 1
  </section>
  
  <section class="content content--padding has-header has-sub-header" id="tab2">
      Tab 2
  </section>
  
  <section class="content content--padding has-header has-sub-header" id="tab3">
      Tab 3
  </section>

Infinite Scroll


var content = document.querySelector('.content');

var infiniteScroll = new phonepack.InfiniteScroll(content, { distance: 50 }, function(){
  infiniteScroll.hide();
});

Shrink Header


phonepack.shrinkHeader(document.querySelector('.header'));