Components (11): Pagination / Popovers / Progress
nav
Attribute
aria-label="Pagination example"
ul.pagination
li.page-item
a
Attribute
href="..."
Previous
, 1
, 2
, ... , Next
Example: using Unicode symbol characters
li.page-item
«
span
Attribute
area-hidden="true"
Previous
li.page-item
»
span
Attribute
area-hidden="true"
Next
Using icons is the same way: example using Open Iconic (see source for detail)
Pagination items should be disabled or activated with various situations. The most common conditions are as follows.
Add .page-item
to li
. Its descendant link a
is disabled automatically.
li.page-item
.disabled
to disabled itemsa
tabindex="-1"
to disabled links (to remove from tabstops)Previous
) (displays grayed automatically)span.sr-only
to the current item
(current)
Example: on showing page 1 (Previous and 1 are disabled)
Setting .active
to li.list-item
displays an item as active state (displayed as primary context). But it does not disable an inner link. Furthermore, it cannot be used with .disabled
(li.page-item.active.disabled
does not work).
This problem can be resolved by changing inner elements from a
to span
for all disabled items.
li.page-item.(active|disabled)
span.page-link
(from a.page-link
)Add .pagination-(lg|sm)
to ul.pagenation
.ul.pagination.pagination-lg
.ul.pagination
(default)
.ul.pagination.pagination-sm
Use .justify-content-*
(see Flex utilities - Arrangement with .justify-content-* )
ul-pagination.justify-content-start
ul-pagination.justify-content-center
ul-pagination.justify-content-end
Popover is a popup component like those found in iOS. It utilizes Popper.js for implementation.
Popovers are inactivated as defaut. JavaScript is required to activate them. Below is a simple code to activate all popovers.
$('[data-toggle="popover"]').popover();
data-toggle="popover"
title="{title-text}"
data-content="{content-text}"
title
or data-content
is required. It does not show if both values are empty.Example (Click to show, click again to hide)
"right"
as default)
data-placement=("top"|"right"|"bottom"|"left")
Example
As default, a popover shows on click and hides on the next click on the same element. This specification enables showing multiple popovers at the same time (can be demonstrated by the Directions example above).
However, it is possible to dismiss a popover by clicking another element (more precisely, showing/hiding by focus events) with the following settings.
a
for the target element (some browsers may not work with button
)data-trigger="focus"
tabindex="0"
Example
Dismissible popoverIf the attribute disabled
is set to the element, it also disables a popover (example below).
button.btn.btn-primary
Attributes
type="button"
data-toggle="popover"
title="Disabled popover"
disabled
(also disables a popover)Disabled button
Example (does not popover on click)
To enable a popover for a disabled element, add a wrapping parent and set popover to it.
span
Attributes
.d-inline-block
(set to the same display
setting as button
)data-toggle="popover"
title="Disabled popover"
button.btn.btn-primary
Attributes
type="button"
style="pointer-events: none;"
(to prevent receiving pointer events)disabled
Disabled button
Example (the button is disabled but popovers on click by the parent)
The progress component is a Bootstrap alternative of progress
elements. It has extra features as multiple indicator bars, animated stripes and so on.
div.progress
div.progress-bar
(stacked from left to right) Attributes
style="width: 50%"
role="progressbar"
aria-valuenow="50"
aria-valuemin="0"
aria-valuemax="100"
(1) Set style="width: {width}%”
style="width: 0%;"
style="width: 25%;"
style="width: 50%;"
style="width: 75%;"
style="width: 100%;"
(2) Set .w-(25|75|100)
(see Sizing , 25% steps)
.w-25
.w-50
.w-75
.w-100
Set inner text of div.progress-bar
Set style (e.g. style="height: 10px;"
) to div.progress
style="height: 5px;"
style="height: 10px;"
style="height: 15px;"
style="height: 20px;"
Add .bg-{context}
to div.progress-bar
(see Colors - Background ).
.bg-success
.bg-info
.bg-warning
.bg-danger
Use mutiple div.progress-bar
's you need (stacked from left to right).
Add .progress-bar-striped
to bars.
Add .progress-bar-animated
.
Example: div.progress-bar.progress-bar-striped.progress-bar-animated