All Projects → maciej-gurban → Responsive Bootstrap Toolkit

maciej-gurban / Responsive Bootstrap Toolkit

Licence: mit
Responsive Bootstrap Toolkit allows for easy breakpoint detection in JavaScript

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Responsive Bootstrap Toolkit

Match Media
Universal polyfill for match media API using Expo APIs on mobile
Stars: ✭ 95 (-73.9%)
Mutual labels:  responsive, breakpoint
breaking-point
BREAKING-POINT lets you quickly define and subscribe to screen (i.e. window) breakpoints in your re-frame application
Stars: ✭ 36 (-90.11%)
Mutual labels:  responsive, breakpoint
React Flexa
Responsive React Flexbox (CSS Flexible Box Layout Module) grid system based heavily on the standard CSS API.
Stars: ✭ 120 (-67.03%)
Mutual labels:  responsive, breakpoint
React Native Responsive Grid
Bringing the Web's Responsive Design to React Native
Stars: ✭ 369 (+1.37%)
Mutual labels:  responsive, responsive-layout
react-context-responsive
A package that provides a responsive context to your application, using React Context API.
Stars: ✭ 25 (-93.13%)
Mutual labels:  responsive, responsive-layout
React Container Query
📦 Modular responsive component
Stars: ✭ 788 (+116.48%)
Mutual labels:  responsive, responsive-layout
Flexi
Just a layout framework. Design for cross-platform with ease.
Stars: ✭ 220 (-39.56%)
Mutual labels:  responsive, breakpoint
Responsiveframework
Easily make Flutter apps responsive. Automatically adapt UI to different screen sizes. Responsiveness made simple. Demo: https://gallery.codelessly.com/flutterwebsites/minimal/
Stars: ✭ 476 (+30.77%)
Mutual labels:  responsive, responsive-layout
bootstrap-grid-ms
Missing grid range in Bootstrap 3, micro-small from 480-767px.
Stars: ✭ 34 (-90.66%)
Mutual labels:  responsive, responsive-layout
react-timeline
The easiest way to add a responsive and customizable timeline to React apps
Stars: ✭ 68 (-81.32%)
Mutual labels:  responsive, responsive-layout
Mq Scss
Extremely powerful Sass media query mixin. Allows you to create almost any media query you can imagine.
Stars: ✭ 122 (-66.48%)
Mutual labels:  responsive, breakpoint
use-breakpoint
React `useBreakpoint` hook to have different values for a variable based on a breakpoints.
Stars: ✭ 17 (-95.33%)
Mutual labels:  responsive, breakpoint
react-matchmedia-connect
Higher order components for matchMedia
Stars: ✭ 49 (-86.54%)
Mutual labels:  responsive, breakpoint
science-fiction-magazines-blog
Blog template (concept) is inspired by stylish science fiction magazines of the 80-90s.
Stars: ✭ 24 (-93.41%)
Mutual labels:  responsive, responsive-layout
Layout
Flutter | Create responsive layouts for mobile, web and desktop
Stars: ✭ 312 (-14.29%)
Mutual labels:  responsive, responsive-layout
Django Jet
Modern responsive template for the Django admin interface with improved functionality. We are proud to announce completely new Jet. Please check out Live Demo
Stars: ✭ 3,207 (+781.04%)
Mutual labels:  responsive
Guillotine
jQuery plugin to crop images within an area (fully responsive), allowing to drag (touch support), zoom and rotate.
Stars: ✭ 318 (-12.64%)
Mutual labels:  responsive
Stickystack.js
A jQuery plugin that creates a stacking effect by sticking panels as they reach the top of the viewport.
Stars: ✭ 287 (-21.15%)
Mutual labels:  responsive
Grunt Email Workflow
A Grunt workflow for designing and testing responsive HTML email templates with SCSS.
Stars: ✭ 3,010 (+726.92%)
Mutual labels:  responsive
Detection
ASP.NET Core Detection with Responsive View for identifying details about client device, browser, engine, platform, & crawler. Responsive middleware for routing base upon request client device detection to specific view.
Stars: ✭ 335 (-7.97%)
Mutual labels:  responsive

Responsive Bootstrap Toolkit

Responsive Bootstrap Toolkit provides an easy way of breakpoint detection in JavaScript, detecting changes in currently active breakpoint, as well as executing any breakpoint-specific JavaScript code. Despite the name, you can use it also with Foundation, or any other framework.

Current version: 2.6.3

Documentation

HOW-TO

Installation

Using Bower:

bower install responsive-toolkit

Using NPM:

npm install responsive-toolkit

Demo

Live example available on CodePen. Hosted along with repository are the following usage examples:

Basic usage:

// Wrap IIFE around your code
(function($, viewport){
    $(document).ready(function() {

        // Executes only in XS breakpoint
        if(viewport.is('xs')) {
            // ...
        }

        // Executes in SM, MD and LG breakpoints
        if(viewport.is('>=sm')) {
            // ...
        }

        // Executes in XS and SM breakpoints
        if(viewport.is('<md')) {
            // ...
        }

        // Execute code each time window size changes
        $(window).resize(
            viewport.changed(function() {
                if(viewport.is('xs')) {
                    // ...
                }
            })
        );
    });
})(jQuery, ResponsiveBootstrapToolkit);

Execute code on window resize

Allows using custom debounce interval. The default one is set at 300ms.

$(window).resize(
    viewport.changed(function() {

      // ...

    }, 150)
);

Get alias of current breakpoint

$(window).resize(
    viewport.changed(function() {
        console.log('Current breakpoint: ', viewport.current());
    })
);

Using with Foundation

Instead of Bootstrap's aliases xs, sm, md and lg, Foundation uses: small, medium, large, and xlarge.

(function($, viewport){

    viewport.use('Foundation');

    if(viewport.is('small')) {
        // ...
    }

})(jQuery, ResponsiveBootstrapToolkit);

Note: Currently, only Foundation 5 visibility classes are supported. If you'd like to support older version of any framework, or provide your own visibility classes, refer to example below.

Providing your own visibility classes

(function($, viewport){

    var visibilityDivs = {
        'alias-1': $('<div class="device-alias-1 your-visibility-class-1"></div>'),
        'alias-2': $('<div class="device-alias-2 your-visibility-class-2"></div>'),
        'alias-3': $('<div class="device-alias-3 your-visibility-class-3"></div>')
    };

    viewport.use('Custom', visibilityDivs);

    if(viewport.is('alias-1')) {
        // ...
    }

})(jQuery, ResponsiveBootstrapToolkit);

Note: It's up to you to create media queries that will toggle div's visibility across different screen resolutions. How? Refer to this example.

How do I include it in my project?

Paste just before </body>

<!-- Responsive Bootstrap Toolkit -->
<script src="js/bootstrap-toolkit.min.js"></script>
<!-- Your scripts using Responsive Bootstrap Toolkit -->
<script src="js/main.js"></script>

Migrating from an older version

Refer to the changelog for a list of changes in each version of the library.

Dependencies:

  • jQuery
  • Bootstrap's responsive utility css classes (included in its standard stylesheet package)
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].