Git Product home page Git Product logo

mdbootstrap / bootstrap-offcanvas Goto Github PK

View Code? Open in Web Editor NEW
2.0 5.0 3.0 975 KB

Hidden sidebar built with the latest Bootstrap 5, perfect for use in the form of additional navigation, for example in ecommerce projects or dashboards.

Home Page: https://mdbootstrap.com/docs/standard/extended/offcanvas/

License: Other

HTML 3.98% JavaScript 48.47% SCSS 47.55%
offcanvas bootstrap bootstrap5 bootstrap-offcanvas bootstrap-offcanvas-menu bootstrap-template bootstrap-dashboard responsive responsive-design navigation

bootstrap-offcanvas's Introduction

Hidden sidebar, perfect for use in the form of additional navigation, for example in ecommerce projects or dashboards.

Check out Bootstrap Offcanvas Documentation for detailed instructions & even more examples.

How it works

Offcanvas is a sidebar component that can be toggled via JavaScript to appear from the left, right, or bottom edge of the viewport. Buttons or anchors are used as triggers that are attached to specific elements you toggle, and data attributes are used to invoke our JavaScript.

  • Offcanvas shares some of the same JavaScript code as modals. Conceptually, they are quite similar, but they are separate plugins.
  • Similarly, some source Sass variables for offcanvas’s styles and dimensions are inherited from the modal’s variables.
  • When shown, offcanvas includes a default backdrop that can be clicked to hide the offcanvas.
  • Similar to modals, only one offcanvas can be shown at a time.

Heads up! Given how CSS handles animations, you cannot use margin or translate on an .offcanvas element. Instead, use the class as an independent wrapping element.

Basic example

Bootstrap 5 Offcanvas

<div class="offcanvas offcanvas-start show" tabindex="-1" id="offcanvas" aria-labelledby="offcanvasLabel"
  data-mdb-backdrop="false" data-mdb-scroll="true">
  <div class="offcanvas-header">
    <h5 class="offcanvas-title" id="offcanvasLabel">Offcanvas</h5>
    <button type="button" class="btn-close text-reset" data-mdb-dismiss="offcanvas" aria-label="Close"></button>
  </div>
  <div class="offcanvas-body">
    Content for the offcanvas goes here. You can place just about any Bootstrap component or custom elements here.
  </div>
</div>

How to use?

  1. Download MDB 5 - free UI KIT

  2. Choose your favourite customized component and click on the image

  3. Copy & paste the code into your MDB project

▶️ Subscribe to YouTube channel for web development tutorials & resources

More examples

Bootstrap Offcanvas Placement: Bootstrap 5 Offcanvass

Bootstrap Offcanvas Backdrop: Bootstrap 5 Offcanvas

Bootstrap Offcanvas Sass: Bootstrap 5 Offcanvas


More extended Bootstrap documentation

bootstrap-offcanvas's People

Contributors

bwsky-a avatar marveluck avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  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.