Giter Site home page Giter Site logo

mallajay / ion-slides-tabs Goto Github PK

View Code? Open in Web Editor NEW

This project forked from leoruhland/ion-slides-tabs

0.0 1.0 0.0 187 KB

An Add-On directive for the ion-slides, that adds tabs to the slide box, known from the Android Material Design specification

License: MIT License

HTML 40.30% JavaScript 52.37% CSS 7.33%

ion-slides-tabs's Introduction

ion-slides-tabs

This fork is an adaptation of the JKnorr91 code using the new directive ion-slides instead of ion-slide-box.

All credits and thanks to JKnorr91.

Changes:

  • Replaced ion-slide-box directive with ion-slides.
  • Centralized the active tab. (when possible)
  • Updated the demos to Ionic v1.3.1

This Directive adds Tabs for the Ionic Slidebox with moving indicator at the bottom.

Preview & Demos

alt tag

Example 1: Simple, fixed sizes

Example 2: Multiple tabs, scrollable

Example 3: Multiple dynamic tabs, scrollable

Example 4: Initial slide

Installation

  1. Add the slidingTabsDirective.js to your Ionic Project and include it in your index.html.

Example: If you put the slidingTabsDirective.js to your js folder, you should paste the following line into your index.html anywhere after the ionic inclusion.

<script src="js/slidingTabsDirective.js"></script>
  1. Add the SCSS or the CSS code from slidingTabs.scss or slidingTabs.css to your project Styles.

Usage

In order to use the Tabs with an existing Slides, add the ion-slides-tabs Attribute to the ion-slides Element. To name the Tabs you should add the Attribute ion-slide-tab-label="yourLabel" to the ion-slide-page of the Slides. You can paste in any HTML for the labels.

Example:

<ion-content scroll="false">
    <ion-slides slider="slider" ion-slides-tabs>
        <ion-slide-page ion-slide-tab-label="test"><h1>Tab 1</h1></ion-slide-page>
        <ion-slide-page ion-slide-tab-label="secondTest"><h1>Tab 2</h1></ion-slide-page>
        <ion-slide-page ion-slide-tab-label="<b>boldTest</b>"><h1>Tab 3</h1></ion-slide-page>
    </ion-slides>
</ion-content>

API

Currently there ist only one attribute to change the behaviour of the tabs:

Attribute Type Default Description
slide-tabs-scrollable boolean true Wheter the tabs should be scrollable (true) or fill up the viewport width (false). In case of false, every tab will have the same size.

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.