Installation & Update


Make sure to install and get to know matestack-ui-core first!

Add the Ruby gem and NPM package:

bundle add 'matestack-ui-bootstrap'
yarn add 'matestack-ui-bootstrap'

Adjust the relevant application layout and add a div with the ID matestack-ui


<!DOCTYPE html>
<title>Your App</title>
<meta name="viewport" content="width=device-width,initial-scale=1">
<%= csrf_meta_tags %>
<%= csp_meta_tag %>
<%= stylesheet_link_tag 'application', media: 'all'%>
<%= javascript_pack_tag 'application'%>
<div id="matestack-ui">
<%= yield %>

Tell Webpack to import Bootstraps CSS:


@import "~bootstrap/scss/bootstrap.scss";

Import the required JS libraries and mount MatestackUiCore and MatestackUiBootstrap properly. We recommend to remove Turbolinks, as it might interfere with some of the reactivity feature of Matestack:


import Rails from "@rails/ujs"
// import Turbolinks from "turbolinks"
import * as ActiveStorage from "@rails/activestorage"
import "channels"
import "./stylesheets/application.scss";
import Vue from 'vue/dist/vue.esm'
import Vuex from 'vuex'
import MatestackUiCore from 'matestack-ui-core'
import MatestackUiBootstrap from "matestack-ui-bootstrap"
let matestackUiApp = undefined
document.addEventListener('DOMContentLoaded', () => {
matestackUiApp = new Vue({
el: "#matestack-ui",
// Turbolinks.start()

Download and import Bootstraps icons:


and finally compile the code with webpack:

$ bin/webpack --watch

When you update the matestack-ui-bootstrap Ruby gem, make sure to update the npm package as well!


Ruby Gem

Depending on the entry in your Gemfile, you might need to adjust the allowed version ranges in order to update the Gem. After checked and adjusted the version ranges, run:

bundle update matestack-ui-bootstrap

and then check the installed version:

bundle info matestack-ui-bootstrap

JavaScript Package

If you've installed the JavaScript dependecies via Yarn/Webpacker you need to update the JavaScript assets via yarn:

yarn update matestack-ui-bootstrap

and finally check if the correct version is installed:

yarn list --pattern "matestack-ui-bootstrap"

The Ruby gem version and the NPM package version should match!