Introducing Bootcards: Bootstrap Cards Made Easy

Share this article

Bootcards framework, Bootstrap-based cards layout

Key Takeaways

  • Bootcards is a UI framework that simplifies the creation of card interfaces. The framework is based on Bootstrap and allows for a dual-pane capability for both desktop and mobile, making it a versatile tool for UX designers aiming to create minimalistic interfaces.
  • Bootcards offers a full set of features for creating high-quality cards that are optimized for all devices and media queries. It provides separate stylesheets for different platforms (iOS, Android, Desktop) and has OS-specific CSS files to provide a UI that changes its look and feel depending on the platform being used.
  • The Bootcards framework supports different types of cards including Detailed Lists, Base Cards, Media Cards, Summary Cards, and File Cards. These cards can be used to display various types of information in an organized and visually appealing manner, making it a useful tool for creating card-based dashboards, contact details, summaries, file information, and more.
A Bootcards and Tarot card-style illustration

Bootcards is a UI framework for card interfaces. Like its name says, it is based on the Bootstrap framework and it has a dual-pane capability for both desktop and mobile.

These days information is everywhere and sometimes the sheer amount of it can confuse us. With the rise of mobile devices, UX designers have been trying to create interfaces that are minimalistic and don’t overload users with information.

Cards interfaces have been gaining lots of popularity, mainly because they focus on what’s important and are graphically catchy.

Bootcards is mostly used on lists, Summary Cards, different type of File Cards, and Media Cards such as Twitter Cards. The framework is helpful when we want to create lists which contain more information than usual. Another use case for Bootcards relates to Summary Cards, which are a great way of creating card-based dashboards.

Why Cards

Cards are in fashion nowadays. They show exactly what users want by keeping the focus strictly on key points. You can use cards to display contact details, summaries, file information, and more. This pattern breaks the content into small components and arranges them in eye-catching designs.

A lot of big names such as Google, Spotify, Pinterest and Amazon have used cards in their designs, especially in mobile devices. Cards gained importance when they got used for the first time by Twitter. Twitter Cards were presented in 2012 and since then the hype has gone up.

A cards-based layout consists of text, images, videos and more, all of which creates a valuable mix of information. Twitter uses cards to create a connection between users and content: users can quickly spot the summary that is important to them without having to go through the entire content. One more good reason for using Twitter Cards is to drive engagement to your Tweets.

Google Cards

The Google Now Cards‘ slogan is to give the right information at the right time. Google Now Cards accomplish this by showing only valuable information with a focus on the needs of mobile users.

Bootcards offers a full set of features for creating high quality cards. The framework is optimized for all devices and media queries. Another good point is its native look and feel. It offers separate stylesheets for each platform: iOS, Android or Desktop.

Quick Start with Bootcards

In this section, we will learn how to create cards with the help of Bootcards. To get started, before adding Bootcards files, we need to add Bootstrap. Next, you can add Bootcards’ OS-specific CSS files (desktop, Android or iOS) and its JavaScript file.

The reason why Bootcards has OS-specific CSS files is to provide a UI that can change its look and feel depending on the platform that you are using. Different CSS files will change default heading colors, make the navbar collapsible and other UI changes. Be careful, you will only need to load one type of CSS file depending on the device being used to view your web page.

<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css" rel="stylesheet">

<!-- Important: you'll only need one of the Bootcards CSS files below for every platform -->

<!-- Bootcards CSS for iOS: -->
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/bootcards/1.0.0/css/bootcards-ios.min.css">

<!-- Bootcards CSS for Android: -->
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/bootcards/1.0.0/css/bootcards-android.min.css">

<!-- Bootcards CSS for desktop: -->
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/bootcards/1.0.0/css/bootcards-desktop.min.css">

<!-- Bootstrap and Bootcards JS -->
<script src="//netdna.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/bootcards/1.0.0/js/bootcards.min.js"></script>

You can start working with Bootcards just by adding its CSS files, but for enhanced usability, make sure you include the JavaScript function below:

bootcards.init({
  offCanvasBackdrop: true,
  offCanvasHideOnMainClick: true,
  enableTabletPortraitMode: true,
  disableRubberBanding: true
});

These options are especially useful if you are targeting mobile or iOS users. To show a backdrop when the offcanvas menu is displayed, set offCanvasBackdrop to true. In case you want to hide the offcanvas menu when you click outside it, you can use offCanvasHideOnMainClick. You can also enable single pane mode for tablets in portrait mode by setting the enableTabletPortraitMode to true. The last setting above, disableRubberBanding, is used to disable the rubber banding effect on iOS devices.

Create Better Cards

After we have set up the environment, we can start creating some sample cards. You can find these samples on GitHub, if you’d like to follow along. We will discuss the most used components of this framework and their purpose.

Detailed Lists and Base Card

The first Bootcards example we will build, is a contact list displaying companies details and a search form on top. The contact list will be enhanced when we click on company names. This list is built on two components: Detailed Lists and Base Cards.

Detailed Lists can be used to show the company names and some small details about them. If users want to learn more about a specific company, they can click the link on the Detailed List for that company to reveal the corresponding Base Card with the appropriate company details.

Base Cards are the best type of cards for detailed descriptions because they display the information in lists. Every list is separated by dividers. Finally, Detailed Lists and Base Cards are inter-connected: in our demo, each company inside Detailed Lists displays its full info in its corresponding Base Card.

See the Pen Bootcards: Detailed Lists & Base Card by SitePoint (@SitePoint) on CodePen.

Media Cards

The second card we are going to create is a Twitter Card with a large image. We will use the Media Cards component for creating this card. Media Cards are used to display information containing text with images or videos.

But first let’s talk more about Twitter Cards. A Twitter Summary Card is designed to show a quick preview of the content to the reader. After users click on the Summary Card, they will be redirected to the card’s related content for more details.

Media Cards, like most other types of cards, are made of three areas: header, body and footer. The basic structure of a Media Card is shown below:

<div class="panel panel-default bootcards-media"> 
  <div class="panel-heading">....</div>
  <div class="panel-body"> ... </div> 
  <img src="http://www.linkofphoto.com/path"/> 
  <div class="panel-footer">...</div>
</div>

In our example of Twitter Card we have removed the panel-heading while leaving out the panel-body and the panel-footer components.

Most of the content is contained inside the panel-body div, where we have placed the card’s logo, header and main content. Instead, we have put the reply, retweet and like buttons in the footer area.

See the Pen Bootcards: Media Cards (Twitter Cards) by SitePoint (@SitePoint) on CodePen.

Summary Cards

Sometimes we need to create dashboards or structures based on tabs that represent information by using icons or logos. To display this sort of structures, the Bootcards framework uses Summary Cards.

Bootcards Summary Card

Summary Cards can be used with other types of cards. In our example, we have used Chart and Table Cards alongside Summary Cards. In this case, Summary Cards can be seen as the door to the information displayed by these other types of cards.

See the Pen Bootcards: Summary Cards by SitePoint (@SitePoint) on CodePen.

For creating Chart Cards in the Finances and Growth section, we have used Morris.js. It is very helpful for creating infographics and charts. So, in case you use Chart Cards in your project, don’t forget to add those files:

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/morris.js/0.5.1/morris.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/raphael/2.1.2/raphael-min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/morris.js/0.5.1/morris.min.js"></script>

File Cards

Another type of card that is very useful around the web is the File Card. The primary function of File Cards is to show information for PDFs, Word documents, spreadsheets and other non-media formats.

For downloadable files, File Cards are among the most attractive ways of displaying this functionality to users.

The structure of File Cards is composed of three sections: page-header, page-footer and list-group. The only difference with Media Cards is that instead of the .page-body class, it uses the .list-group class on the container element.

list-group is the space where we will put our supplementary content. Inside list-group we could put as many list-group-items as we want.
<div class="list-group"> 
  <div class="list-group-item">content</div> 
  <div class="list-group-item">content</div> 
</div>

In our example we have used two list-group-items: one for the title name of the file, its type and its size, and another one for the description.

The footer section really makes File Cards interesting to look at. It contains three buttons which offer users the following options: download the file, save it for later or send it to someone with email.

See the Pen Bootcards: File Cards by SitePoint (@SitePoint) on CodePen.

The four Bootcards examples outlined here show some key features to better understand the framework and help you create your own cards.

Conclusion

Bootcards is a great framework which combines the cards concept with the power of Bootstrap. As long as use of mobile devices continues to grow and popular platforms like Google and Twitter keep using it, cards-based design will stay strong.

Frequently Asked Questions about Bootcards: Bootstrap Cards Made Easy

How do I customize the appearance of my Bootcards?

Customizing the appearance of your Bootcards is quite straightforward. You can use CSS to modify the look and feel of your cards. For instance, you can change the background color, border, and padding of your cards. You can also use Bootstrap’s built-in classes to customize your cards. For example, you can use the ‘card-primary’, ‘card-success’, ‘card-info’, ‘card-warning’, or ‘card-danger’ classes to change the color of your cards.

Can I use Bootcards with other Bootstrap components?

Yes, you can use Bootcards with other Bootstrap components. Bootcards are designed to work seamlessly with all Bootstrap components. You can use them with Bootstrap’s grid system, forms, buttons, and other components. This makes it easy to create complex, responsive layouts with Bootcards.

How do I add images to my Bootcards?

Adding images to your Bootcards is simple. You can use the ‘card-img-top’ class to add an image to the top of your card. You can also use the ‘card-img-bottom’ class to add an image to the bottom of your card. To add an image to the middle of your card, you can use the ‘card-img’ class.

Can I use Bootcards without Bootstrap?

Bootcards are designed to work with Bootstrap, and they rely on Bootstrap’s CSS and JavaScript. Therefore, it’s not recommended to use Bootcards without Bootstrap. However, if you want to use a similar card-based layout without Bootstrap, there are other CSS frameworks and libraries that you can use.

How do I add links to my Bootcards?

You can add links to your Bootcards by using the ‘card-link’ class. This class can be used with an ‘a’ element to create a link. You can also use the ‘card-button’ class to create a button link.

How do I make my Bootcards responsive?

Bootcards are responsive by default, which means they will automatically adjust to different screen sizes. You can also use Bootstrap’s grid system to control the layout of your cards on different devices. For example, you can use the ‘col-sm-6’ class to make your cards take up half the width of the screen on small devices.

Can I use Bootcards with Bootstrap 5?

Yes, you can use Bootcards with Bootstrap 5. However, there may be some minor differences in the way certain components work, as Bootstrap 5 has made some changes to its CSS and JavaScript. Therefore, it’s recommended to check the Bootstrap 5 documentation for any changes that might affect your use of Bootcards.

How do I add a header and footer to my Bootcards?

You can add a header and footer to your Bootcards by using the ‘card-header’ and ‘card-footer’ classes. These classes can be used with a ‘div’ element to create a header and footer for your card.

How do I add a list to my Bootcards?

You can add a list to your Bootcards by using the ‘list-group’ class. This class can be used with a ‘ul’ or ‘ol’ element to create a list. You can also use the ‘list-group-item’ class to style the items in your list.

How do I add a dropdown menu to my Bootcards?

You can add a dropdown menu to your Bootcards by using Bootstrap’s dropdown component. You can use the ‘dropdown’ class to create a dropdown menu, and the ‘dropdown-item’ class to create the items in your menu.

Taulant SpahiuTaulant Spahiu
View Author

Taulant is a web developer who is passionate about JavaScript and its technologies. He holds a bachelor's degree in Computer Engineering and is proficient in JavaScript, Java and AngularJS. In his free time, he loves playing with new web technologies.

bootcardsBootstrap-resourcescards layoutmariap
Share this article
Read Next
Get the freshest news and resources for developers, designers and digital creators in your inbox each week