Giter Site home page Giter Site logo

mhzarini / ion-bottom-nav-drawer Goto Github PK

View Code? Open in Web Editor NEW

This project forked from toniantunovi/ion-bottom-drawer

2.0 1.0 3.0 4.52 MB

Bottom navigation drawer component for Ionic 4/Angular

JavaScript 11.46% TypeScript 60.83% HTML 14.74% CSS 12.97%
ionic4 angular bottom-navigation bottom-navigation-view ionic

ion-bottom-nav-drawer's Introduction

Ionic 4 Bottom Navigation Drawer

Bottom Navigation Drawer component for Ionic 4.

Installation

$ npm i ion-bottom-nav-drawer --save

API

Inputs

  • dockedHeight: number - Height of the drawer in docked position. Default value: 50.
  • shouldBounce: boolean - Determines whether the drawer should automatically bounce between docked, closed and top positions. Default value: True.
  • disableDrag: boolean - Disables drawer drag. Default value: False.
  • distanceTop: number - Distance from top of fully opened drawer. Default value: 0.
  • transition: string - Specify custom CSS transition for bounce movement. Default value: 0.25s ease-in-out.
  • state: DrawerState - Current state of the drawer. Possible values: DrawerState.Bottom, DrawerState.Docked, DrawerState.Top. Default value: DrawerState.Docked.
  • minimumHeight: number - Height of the drawer when in closed state calculated from the bottom of the screen. Default value: 0.

Behavior

The drawer has three basic states: closed, docked and opened to maximum 'distanceTop' from top of the screen. It will bounce by default which means it will always go to one of three states above. This can be disabled by setting 'shouldBounce' to false.

If 'ion-content' is beneath the drawer it might be bouncing itself while dragging the drawer. To prevent that add 'no-bounce' attribute to ion-content element.

<ion-content padding no-bounce>
...
</ion-content>

Integration and Usage

First, import the IonBottomNavDrawerModule to your app:

import { IonBottomNavDrawerModule } from 'ion-bottom-nav-drawer';

@NgModule({
  imports: [
    ...,
    IonBottomNavDrawerModule
  ],
  ...
})
export class AppModule { }

Use it in your component template like this:

<ion-content no-bounce>Component content.<ion-content>

<ion-bottom-nav-drawer [disableDrag]="disableDrag" [(state)]="drawerState" [minimumHeight]="minimumHeight"
  [dockedHeight]="dockedHeight" [shouldBounce]="shouldBounce" [distanceTop]="distanceTop">
  <div class="drawer-content">
    Bottom Drawer Content
  </div>
</ion-bottom-nav-drawer>

License

The MIT License (MIT)

Copyright (c) Mohammad Nuairat

ion-bottom-nav-drawer's People

Contributors

toniantunovi avatar mhzarini avatar

Stargazers

Adarsh Srivastava avatar Khurshid 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.