Preloader

Chapter 6: Common UI Components in Bootstrap

bootstrap

You can think of Bootstrap as a “Lego kit” for websites; instead of having to create buttons, menus or boxes yourself you use some pre-made bits(components) and just attach them to your code.

Here are the most common components explained in simple terms:

1. Navbar (Navigation Bar)

The Navbar (The .navbar components) is the header of a page. It is that generally contains the logo, some links to other pages and a search bar.

  • The Best Part: It is ‘responsive.’ On a computer all of the links are visible. On a mobile phone, it immediately condenses into a ‘hamburger’ icon (that little three line thing), that you can click to expand.

2. Buttons

Bootstrap buttons come with pre-set colors that convey meaning. Instead of just saying “Button,” you use classes to style them instantly:

  • Primary (Blue): For the main action (like “Submit”).
  • Success (Green): For positive actions (like “Save”).
  • Danger (Red): For warnings or deleting.
  • Outline: Buttons that only have a border until you hover over them.

3. Cards

A Card is a versatile box that resembles the shape of a playing card. It typically features an image on top, a title or headline, some descriptive text and a button on the bottom.

  • Use case: Perfect for “Meet the Team” sections, product listings, or blog post previews. It keeps information organized in a clean box.

4. Modals (Pop-ups)

A Modal is a dialog box that “pops up” over the current page, darkening the background.

  • What can you do with it: If you are trying to confirm the deletion of an item, want to display a login form or just want show more information without forcing the user to change page then this is perfect.

5. Alerts

Alerts are colored banners used to give feedback to the user.

  • Example: A green alert that says “Your message was sent!” or a yellow one saying “Warning: Your password is weak.” They usually have an ‘X’ button so the user can dismiss them.

6. Carousel (Slider)

The Carousel is a rotating slides show that displays any number of items most often large, stunning photos or quotes.

  • Features: It comes with “Previous” and “Next” arrows and little dots at the bottom to show which slide you are on.

7. Forms

Bootstrap would make forms look nice immediately. It takes care of the spacing between label and its input box (like where you input your email) and aligns radio buttons and checkboxes properly.

Comparison Table

ComponentReal-world AnalogyBest For…
NavbarA building’s directoryMoving around the site
CardA postcardGrouping related info
ModalA “Wait!” interruptionImportant notices/actions
AlertA sticky noteQuick status updates

Check out our resources!

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *