Shuffle with Flexbox (Bootstrap 4)

On this page, I have added the minified bootstrap css file from the Bootstrap CDN (which is also why some of the site-styles are being overriden).

The Bootstrap 4 grid system uses flexbox with padding for gutters.

The best way to handle this is to have the shuffle container element (#grid in this case), to be a .row so that all the shuffle items remain flex-items.

If you cannot make the shuffle container element a .row, you will need to set a width for each column (like width: 25%;).

Return on investment product management equity crowdfunding stock pivot innovator sales ownership.
Founders ecosystem hackathon product management lean startup MVP.
Traction bandwidth MVP direct mailing partner network gen-z growth hacking crowdsource channels responsive web design pivot.
Conversion technology long tail influencer analytics rockstar market seed money.
Investor bandwidth equity ecosystem vesting period client social media.
Angel investor niche market client churn rate crowdsource infrastructure paradigm shift marketing prototype.
Return on investment product management equity crowdfunding stock pivot innovator sales ownership.
Founders ecosystem hackathon product management lean startup MVP.
Traction bandwidth MVP direct mailing partner network gen-z growth hacking crowdsource channels responsive web design pivot.
Conversion technology long tail influencer analytics rockstar market seed money.
Investor bandwidth equity ecosystem vesting period client social media.
Angel investor niche market client churn rate crowdsource infrastructure paradigm shift marketing prototype.
Return on investment product management equity crowdfunding stock pivot innovator sales ownership.
Founders ecosystem hackathon product management lean startup MVP.
Traction bandwidth MVP direct mailing partner network gen-z growth hacking crowdsource channels responsive web design pivot.
Conversion technology long tail influencer analytics rockstar market seed money.
Investor bandwidth equity ecosystem vesting period client social media.
Angel investor niche market client churn rate crowdsource infrastructure paradigm shift marketing prototype.
Return on investment product management equity crowdfunding stock pivot innovator sales ownership.
Founders ecosystem hackathon product management lean startup MVP.

The one change I've made to the grid is to allow grid columns to fit on mobile.

By default, bootstrap 4 grid gutters are 30px, even on mobile, and they use as 12 column grid. At 320px, each column would need to be 26.667px for 12 columsn to fit, but since there is 30px of inner gutter, the columns are always >= 30px, so they don't fit for us.

If you're using Bootstrap's sass files, you can customize the gutter width via the $grid-gutter-widths map. In this example, I'm overriding it instead.

@media (max-width: 575px) {
  .row > [class*="col-"] {
    padding-left: 8px;
    padding-right: 8px;
  }
}

Source code for this demo

Link to demo source

Shuffle.js

Shuffle.js is a package for sorting, filtering, and laying out a group of items. It’s performant, responsive, and fast. Check out the demos!