
- 338 pages
- English
- ePUB (mobile friendly)
- Available on iOS & Android
Bootstrap 4 Cookbook
About this book
Take your Bootstrap game to the next level with this practical guideAbout This Book• Packed with easy-to-follow recipes on building responsive web pages with Bootstrap 4 that can be applied to a web project of your choice• Build intuitive user interfaces that are mobile-ready with the latest features offered by BS4• Stay on top of the changes that Bootstrap 4 brings to front-end development• Craft beautiful UIs and learn best practices, tips and tricks for quick, effortless, and proper Bootstrap 4 developmentWho This Book Is ForIf you are a web designer or a developer who is familiar with the basics of Bootstrap and now want to build highly responsive and professional web pages using Bootstrap 4, this cookbook is for you. Familiarity with the fundamentals of HTML, CSS and jQuery, and some experience of incorporating JavaScript plugins is assumed. What You Will Learn• Craft beautiful UIs the right way• Use jQuery and JavaScript to extend Bootstrap layouts• Become more efficient by speeding up your workflow to achieve amazing results in the shortest time possible• Setup your environment for future changes of the framework.• Stay DRY by quickly prototyping Bootstrap-based websites with the help of Github's own serverless blogging platform, Jekyll• Integrate Bootstrap with the most popular JS frameworks, Angular and React• Combine Bootstrap with the.NET platformIn DetailBootstrap, one of the most popular front-end frameworks, is perfectly built to design elegant, powerful, and responsive interfaces for professional-level web pages. It supports responsive design by dynamically adjusting your web page layout.Bootstrap 4 is a major update with many impressive changes that greatly enhance the end results produced by Bootstrap. This cookbook is a collection of great recipes that show you how to use all the latest features of Bootstrap to build compelling UIs.This book is using the most up-to-date version of Bootstrap 4 in all its chapters. First off, you will be shown how you can leverage the latest core features of Bootstrap 4 to create stunning web pages and responsive media. You will gradually move on to extending Bootstrap 4 with the help of plugins to build highly customized and powerful UIs.By the end of this book, you will know how to leverage, extend, and integrate bootstrap to achieve optimal results for your web projects.Style and approachPacked full of solutions that can be instantly applied, the practical-based recipes will help you get the most from Bootstrap.
Frequently asked questions
- Essential is ideal for learners and professionals who enjoy exploring a wide range of subjects. Access the Essential Library with 800,000+ trusted titles and best-sellers across business, personal growth, and the humanities. Includes unlimited reading time and Standard Read Aloud voice.
- Complete: Perfect for advanced learners and researchers needing full, unrestricted access. Unlock 1.4M+ books across hundreds of subjects, including academic and specialized titles. The Complete Plan also includes advanced features like Premium Read Aloud and Research Assistant.
Please note we cannot support devices running on iOS 13 and Android 7 or earlier. Learn more about using the app.
Information
Extending Bootstrap 4
- Converting checkboxes into Toggles with Bootstrap Toggle plugin
- Onboarding users with Shepherd
- Toggling visibility of password fields with custom jQuery code
- Extending the functionality of select elements with Bootstrap Select plugin
- Customizing select boxes with Select2 plugin
- Adding input sliders with Rangeslider.js
- Allowing users to easily add dates to your input fields with jQuery UI Datepicker
- Converting plain tables into sophisticated data tables with Bootgrid
- Navigating easily with simple-sidebar jQuery plugin
- Adding fully customizable notifications with Notify.js
- Integrating a fancy modal using animatedModal.js
- Making pagination dynamic with the jQuery Pagination plugin and simplePagination.js
- Validating forms with svalidate.js
- Adding a rating system using jQuery Bar Rating plugin
Introduction
Converting checkboxes into Toggles with Bootstrap Toggle plugin
Getting ready
- The plugin's CSS, available at https://github.com/minhur/bootstrap-toggle/blob/master/css/bootstrap-toggle.css
- The plugin's JS, available at https://github.com/minhur/bootstrap-toggle/blob/master/js/bootstrap-toggle.js
How to do it…
- Copy the raw CSS code from the GitHub link at https://raw.githubusercontent.com/minhur/bootstrap-toggle/master/css/bootstrap-toggle.css.
- Open the currently blank recipe06-01.scss and paste the code copied from step 1.
- Starting on line 58, add the following code to recipe06-01.scss:
// added
.toggle-handle {
background: #ddd;
}
// added
.btn.active.toggle-off {
box-shadow: inset 0 3px 5px rgba(0,0,0,.125);
color: #333;
background-color: #e6e6e6;
border-color: #adadad;
}
- Open the currently empty file titled recipe06-01.ejs, which can be found inside the app folder, and paste the following code:
<div class="container">
<div class="mt-5">
<h1><%- title %></h1>
<p><a href="https://v4-alpha.getbootstrap.com/components/alerts/" target="_blank">Link to bootstrap alerts docs</a></p>
</div><!-- /.container -->
<div class="col-12 col-md-5">
<div class="checkbox">
<label>
<input type="checkbox" data-toggle="toggle">
Option one is enabled
</label>
</div>
<div class="checkbox disabled">
<label>
<input type="checkbox" disabled data-toggle="toggle">
Option two is disabled
</label>
</div>
<div class="form-check mb-2 mr-sm-2 mb-sm-0">
<label class="form-check-label">
<input class="form-check-input" type="checkbox"> Remember me
</label>
</div>
</div>
- Add the following code to main.scss:
@import "./bower_components/bootstrap/scss/bootstrap.scss";
@import "./bower_components/bootstrap/scss/_mixins.scss";
@import "./bower_components/font-awesome/scss/font-awesome.scss";
@import "./bower_components/hover/scss/hover.scss";
// @import "./bower_components/bootstrap-toggle/css/bootstrap-toggle.css";
@import "recipe06-01.scss";
- In app/partial/_js.ejs, on line 9, insert the following GitHub CDN link:
<script src="https://gitcdn.github.io/bootstrap-toggle/2.2.2/js/bootstrap-toggle.min.js"></script>
- Run the grunt and harp server commands in separate Bash windows, and preview the result in the browser at localhost:9000/recipe06-01.
How it works…
Onboarding users with Shepherd
Getting ready
How to do it…
- Open app/partial/_js.ejs and add the following code:
<%- partial("_recipe-06-02-js") %> - Open app/recipe06-02.ejs and paste this code:
<div class="container">
<div class="mt-5">
<h1><%- title %>...Table of contents
- Title Page
- Copyright
- Credits
- About the Author
- About the Reviewer
- www.PacktPub.com
- Customer Feedback
- Preface
- Installing Bootstrap 4 and Comparing Its Versions
- Layout Like a Boss with the Grid System
- Power Up with the Media Object, Text, Images, and Tables
- Diving Deep into Bootstrap 4 Components
- Menus and Navigations
- Extending Bootstrap 4
- Make Your Own jQuery Plugins in Bootstrap 4
- Bootstrap 4 Flexbox and Layouts
- Workflow Boosters
- Creating a Blog with Jekyll and Bootstrap 4
- Bootstrap 4 with ASP.NET Core
- Integrating Bootstrap 4 with React and Angular