Bootstrap Framework - Input Groups
Bootstrap Framework - Input Groups
FRAMEWORK
ENTERPRISE ARCHITECTURE
BOOTSTRAP
INPUT
GROUPS
EXTENDING FORM CONTROLS WITH BOOTSTRAP
— The output of the above example will look something like this:
BUTTONS ADDONS FOR FORM CONTROLS
To make buttons larger add an extra class .btn-lg to the buttons, like this:
— The output of the above example will look something like this:
CHANGING THE SIZES OF BUTTONS
Similarly, to make buttons smaller add an extra class .btn-sm to the buttons, like this:
— The output of the above example will look something like this:
You can also create full-width or block buttons (buttons that covers the full width of the parent
elements) through using the Bootstrap's display and gap utility classes. These utilities offers much
greater control over spacing, alignment, and responsive behaviors.
— The output of the above example will look something like this:
You can also create responsive variation of these buttons using the .d-{breakpoint}-block classes.
In the following example buttons will be vertically stacked on small and extra small devices (i.e.
viewport width <768px). From medium (md) breakpoint up .d-md-block replaces the .d-grid class,
thus nullifying the .gap-2 class.
You can also create responsive variation of these buttons using the .d-{breakpoint}-block classes.
In the following example buttons will be vertically stacked on small and extra small devices (i.e.
viewport width <768px). From medium (md) breakpoint up .d-md-block replaces the .d-grid class,
thus nullifying the .gap-2 class.
BOOTSTRAP DISABLED BUTTONS
Sometimes we need to disable a button for certain reasons, for example, a user in case is not
eligible to perform this particular action, or we want to ensure that user should performed all
other required actions before proceed to this particular action.
CREATING DISABLED BUTTONS USING BUTTON
AND INPUT ELEMENT
Buttons created through <button> or <input> tag can be disabled by adding the disabled
attribute to the respective element, as shown in the following example:
— The output of the above example will look something like this:
CREATING DISABLED BUTTONS USING ANCHOR
ELEMENTS
Buttons created through <a> tag can be disabled by adding the class .disabled, like this:
— The output of the above example will look something like this:
BOOTSTRAP ACTIVE BUTTONS
Moreover, you can also apply the class .active to force the buttons look like active (i.e. pressed).
Usually you don't need to add this class to the buttons, as their active state is automatically
styled by the Bootstrap using CSS :active pseudo-class.
— The output of the above example will look something like this:
CREATING SPINNER BUTTONS
With Bootstrap you can easily include spinner icon in a button to indicate the loading state in
your application.
— The output of the above example will look something like this:
BOOTSTRAP
BUTTON
GROUPS
CREATING BUTTON GROUPS WITH BOOTSTRAP
In the previous chapter you've learnt how to create different types of individual buttons and
modify them with predefined classes. Bootstrap however, also allows you to group a series of
buttons together in a single line through the button group component.
To create a button group just wrap a series of buttons with .btn class in a <div> element and
apply the class .btn-group on it. You can additionally apply the class .active on an individual
button to indicate the active state.
— The output of the above example will look something like this:
Similarly, you can also create button groups using outline buttons, like this:
— The output of the above example will look something like this:
MIXED STYLES BUTTON GROUPS
You can also mix and match different button styles to create button groups like this:
— The output of the above example will look something like this:
BOOTSTRAP
CARDS
USING THE BOOTSTRAP CARDS
Bootstrap card is a flexible and extensible content container. It includes options for headers and
footers, a wide variety of content, contextual background colors, and powerful display options.
Card replaces panel, well, and thumbnail components in old Bootstrap 3 version.
In the following sections, you will see what you can do with the card component.
CREATING A BASIC CARD
The card markup is pretty straight forward. The outer wrapper require the base class .card,
whereas content can be placed inside the .card-body element. The following example will show
you how to create a card with a picture, mixed with some text content and a button.
— The output of the above example will look something like this:
CONTENT TYPES FOR CARD COMPONENT
The card component support a wide variety of content, including images, text, list groups, links,
navs, and more. Here are the examples of what's supported by the card.
— The output of the above example will look something like this:
CONTENT TYPES FOR CARD COMPONENT
2. Card with Titles, Text, and Links
Further, you can also place title and links inside the card along with text, like this: