ITS UX Pattern Library Components - DEV - BS5

Use this scratchpad/staging page to check the responsiveness and accessibility of components before they go into the PRODUCTION SCRATCHPAD. Test in all major browsers and available devices.

This page is using the DEVELOPMENT Pattern Library CSS file: https://dv0z2zws0de9x.cloudfront.net/patterns/styles.css

With a Bootstrap 5.0.2 foundation: https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css

Last Updated: 3-21-2022
NOTE: For WAVE accessibility checking, you can also use the Firefox or Chrome WAVE extension on this page.


NOTES

PL Breaking changes from BS4 to BS5

AFFECTED COMPONENTS FROM THE BS4-BASED IUX PL:

  • Accordion: Data attribute changes; CSS changes needed due to data attribute changes (only if using the plus and minus switch on panels for the BS4?); Difference in plus vs. minus and now BS5 chevrons; Note that the BS5 accordion may still need custom (branding) styling.
  • Buttons: Data attribute changes for the Dropdown Button and Kebab Menu dropdown; Note also the active button styling with the bright blue - which may be applied by the browser as now I'm seeing that effect in the BS4 components also; For the Button Groups, the syntax changed for the input type of "radio" and "checkbox" with how the component is coded and the CSS changed also due to the changed HTML which you can see internal on this page - for the JS radio "button" examples, the JS is still needed and works compared to the BS4 examples.
  • Modals: Data attribute changes (closing them out via the "Close" button or close icon); Note new XL and fullscreen modals out-of-the-box with BS5
  • Dismissable alerts: Data attribute change (closing them out)
  • Card with chevron: CSS changes needed for chevron animation behavior; CSS styling needed with margin 0 inline and also .card-footer styling
  • Tooltips & Popovers: Data attribute changes

DETAILS ON BREAKING CHANGES:

  • Data attributes are now namespaced in BS5 (see https://github.com/twbs/bootstrap/issues/32656)
    • Changed all instances of data-toggle to data-bs-toggle
    • Changed all instances of data-parent to data-bs-parent
    • Changed all instances of data-target to data-bs-target
    • Changed all instances of data-bs-icon to data-bs-icon
    • Changed all instances of data-prefix to data-bs-prefix
    • Changed all instances of data-dismiss to data-bs-dismiss
    • For the popovers HTML: Changed all instances of data-container to data-bs-container, data-placement to data-bs-placement, and data-content to data-bs-conent
  • Changed all of the modal buttons to a newer, cleaner BS5 class. Specifically, this code:

    <button type="button" class="close" data-bs-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
    was changed to

    <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>

IDEAS MOVING FORWARD:

  • One option is to make a new BS5-based PL with a newly generated stylesheet and stop updating the BS4 one - then, do we find a "new" PL creation site or stay with the current one (with some technical debt with dependency updates)>.
  • Another option would be to isolate the CSS that needs to happen for BS5 apps using the BS4 pattern library, and either add that to the main stylesheet (CSS after the "regular" CSS/SASS in the PL files), or have a BS5-specific stylesheet (manually maintained?) with the override styles loaded after the BS4 > IUX PL > BS5 IUX PL.

Accordion

Using the card component, you can extend the default collapse behavior to create an accordion. To properly achieve the accordion style, be sure to use .accordion as a wrapper.

Also, check the JS tab for an example of a jQuery "scroll to active panel" script, which is a preferred interaction for opened accordion panels (the only exception being accordion used within modals, which should not have this animation).

BS5 Accordion from https://getbootstrap.com/docs/5.0/components/accordion/

ACCORDION - Breaking changes from BS4 to BS5:

  • Changed the CSS from data-toggle to data-bs-toggle for changing the plus and minus icons on the panels. Note that the modified CSS is internal on this page.
  • I had to comment out the "scroll to active panel" script, as that was making the new BS5 accordion not work. We should look into if we need to/should modify the script, when used by an app, to work well with BS5 to offer that same behavior.
  • Next steps:
    • Possibly make an "Accordion for BS4" and "Accordion for BS5" pages on the PL, with the example code. Then, we can still have the current accordion style and "scroll to active panel" JS, and, style up the BS5 accordion to use for BS5-based projects.

This is the first item's accordion body. It is shown by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the .accordion-body, though the transition does limit overflow.

This is the second item's accordion body. It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the .accordion-body, though the transition does limit overflow.

This is the third item's accordion body. It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the .accordion-body, though the transition does limit overflow.

BS4 Accordion Currently in the PL

Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.

Alerts

Alert controls retain color palette specified in variables with a few twists. View colors here.

Alerts - Default

Use alerts to show the user a message.

Small Alerts

Use a small alert if you need to put an alert within a card.

Dismissable Alerts

Alerts Bullet List

Alerts - Timeout

Apply a 5-second timeout for alerts without a close. This excludes error messages. (Refresh the page and scroll to this section to see an example.)


Badges

A small count and labeling component.

Default Example

Badges scale to match the size of the immediate parent element by using relative font sizing and em units.

Heading 1 Primary

Heading 2 Primary

Heading 3 Primary

Heading 4 Primary

Heading 5 Primary
Heading 6 Primary

Contextual Variations

Add any of the below mentioned modifier classes to change the appearance of a badge. Please note that this is also the default sizing of a badge. This default size would appear when there is no font size defined within the parent element.

Primary Secondary Success Danger Warning Light Dark

Casing Options

Should be the opposite casing of the buttons so that users do not confuse it with a button.

Uppercase

Primary Secondary Success Danger Warning Light Dark

Lowercase

Primary Secondary Success Danger Warning Light Dark

Capitalize

Primary Secondary Success Danger Warning Light Dark

Defined Sizes

Add any of the below mentioned modifier classes to set a specific size of a badge.

Small

Primary Secondary Success Danger Warning Light Dark

Medium

Primary Secondary Success Danger Warning Light Dark

Large

Primary Secondary Success Danger Warning Light Dark

Notifications

Badges can be used as part of links or buttons to provide a counter for notifications. Use the .badge-pill class for notifications.

My List 500

Cart 1
My List 500

Cart 1

We prefer using arrows to slashes when creating a breadcrumb.


Buttons

For practical reasons APA applications adhere to Bootstrap's semantic buttons.

Yellow CTA’s should be used sparingly and only for e-commerce layouts. General CTA’s should contrast the background color (blue on white, white on blue).

Responsive Buttons

We recommend making some buttons full width on mobile devices. You could use the following code within the mobile viewport. You might need to add margin to the top or bottom of the mobile button depending on your layout.


          @media only screen and (max-width: 767px) {
              .btn-responsive {
                  width: 100%;
              }
          }
          

Core Buttons

Primary - .btn-primary


Outline - .btn-outline


CTA - .btn-cta


Success - .btn-success


Danger - .btn-danger


Outline (Dismiss) - .btn-outline--dismiss

Outline (No Fill) - .btn-outline--no-fill

Text Button - .btn-textbutton

APA Publishing Buttons

Red Squared - Solid - .btn-pubs-1


Blue Squared - Solid - .btn-pubs-2


Purple Squared - Solid - .btn-pubs-3


Red Rounded - Outline - .btn-pubs-4


Blue Rounded - Outline - .btn-pubs-5


Purple Rounded - Outline .btn-pubs-6


Purple Squared - Outline - .btn-pubs-7


Blue Squared - Outline - .btn-pubs-8


Outline (Dismiss, Square Btn Override) - .btn-outline--dismiss

Button Sizes & Types

Large - .btn-lg


Medium - .btn-md


Small - .btn-sm


Icon Left


Icon Right


Dropdown Button


Anchor Tag Button

Button Text

Add New Item Button

Used mostly in forms for users to add new fields or values.

Kebab Menu

Used in menus and menu bars to show additional options. The icon is most often located at the top-right or top-left of the screen or window.

Dropdown Button

Button Group

USAGE: Button groups are used as an alternative for radio buttons, and work well for the UI when you need a more prominent display on the form and a larger tapping target than a radio button component has. Button groups are also commonly used as filter options or acting like "tabs," or for rating scales like the Net Promoter Score (NPS).

An example of a simple button group acting as radio buttons is on the Course Adoption System Request screen, for the Country field when picking either "United States" or "Canada." Here, choosing one of the options controls the "State/Province/Region" select list values.

STYLING: Instead of applying button sizing classes to every button in a group, just add .btn-group-* to each .btn-group, including each one when nesting multiple groups (all of the demo examples are using .btn-group-sm except the NPS demo which is using the default size). The "primary" style for button groups is modeled after the .btn-outline button class, while the Publications Style is modeled after the .btn-pubs-8 button class. Also, if using a button group with labels and input radio type components, add .btn-group-toggle to the div containing the button group to style the <input>s within your buttons.

RESPONSIVENESS: The amount of buttons and horizontal length of the button group will determine the best approach to achieve responsiveness. Some options are to convert the button group to a dropdown at smaller screen widths, as shown on the Polaris Explore All Notifications mockup for the sort and filter buttons. Or, coverting a horizontal display to a vertical display for the button groups, as shown on the Polaris Record Views mockup for the Time Period field. Another option is to set a min-width with overflow-x: auto; for a container of the button group to make a horizontal scroll bar appear below a certain screen width.

ACCESSIBILITY: Accessibility elements include a role="group" and aria-label="description of the button group" in the .btn-group div, and <fieldset> tags and a <legend> which can be .sr-only and/or specifying the field as required field using .sr-only.

PURE CSS vs. JAVASCRIPT: For checkbox behavior with button groups, no additional JavaScript is needed. If you apply data-toggle="buttons" to the wrapper element the child buttons will automatically have .active applied to whichever button is clicked. Note that this .active class can be applied to any number of <button> elements within the group; if your intention is to make .active unique with radio button behavior, you need to use JavaScript. If you’re pre-toggling a button, you must manually add the .active class and aria-pressed="true" to the <button>.

To achieve radio button behavior with button groups, additional JavaScript is needed for the styling of selected/checked buttons when using button components, but not necessary when using labels and input radio type components (e.g., the NPS example in the demo). For certain types of responsive switches with button groups, JavaScript may be needed.

Horizontal Display - Checkbox Behavior with Button Components - All CSS, No Javascript Needed (modeled after .btn-outline) - NOTE: This changed in BS5

Select a single or multiple options (required)

Horizontal Display - Radio Button Behavior with Button Components - JavaScript Needed For Radio Button Behavior with Buttons (modeled after .btn-outline)

Select a single option (required)

Vertical Display - Radio Button Behavior with Button Components - JavaScript Needed For Radio Button Behavior with Buttons (modeled after .btn-outline)

Select a single option (required)

Horizontal Display - Radio Button Behavior with Labels and Radio Input Components - All CSS, No Javascript Needed (modeled after .btn-outline) - NOTE: This changed in BS5

How likely are you to recommend PsycInfo to your friends and colleagues?

Not very likely

Very likely

PUBLICATIONS STYLE - Horizontal Display - Radio Button Behavior with Button Components - JavaScript Needed For Radio Button Behavior with Buttons (modeled after .btn-pubs-8)

Select a single option (required)

Cards

APA applications adhere to Bootstrap card containers for markup. In general, content cards should always be lighter than their backgrounds (e.g., white cards on light gray backgrounds). Below are a few basic styles:

Card Header: Semantics

When creating cards, be mindful of section heading semantics. Headings communicate the organization of the content on the page. Web browsers, plug-ins, and assistive technologies can use them to provide in-page navigation. For more information, visit W3C's web accessibility tutorials on headings.

H2 Card Header

Text goes here

H3 Card Header

Text goes here

Card with Customization

Card with image cap, card title, subtitle, text, list group, and medium primary button.

Card titles are used by adding .card-title to a <h*> tag. In the same way, links are added and placed next to each other by adding .card-link to an <a> tag.

Subtitles are used by adding a .card-subtitle to a <h*> tag. If the .card-title and the .card-subtitle items are placed in a .card-body item, the card title and subtitle are aligned nicely.

placeholder
Card title
Card subtitle

Some quick example text to build on the card title and make up the bulk of the card's content.

  • Cras justo odio
  • Dapibus ac facilisis in
  • Vestibulum at eros

placeholder

Text goes here

Card with Header and Chevron Expandable Section

Used to hide/show additional content within a card.

Card Title With Chevron

Text goes here

  • Cras justo odio

Responsive Card Group

Used for a 4-card row desktop design which goes to 2 cards per row and then 1 card per row, all with rounded corners around all cards based on the breakpoints.

placeholder
Header

Card text here.

Button
placeholder
Header

Card text here.

Button
placeholder
Header

Card text here.

Button
placeholder
Header

Card text here.

Button

Apps need a slim minimal footer for all pages which contains a link to APA's Privacy Policy for General Data Protection Regulation (GDPR) compliance.

Sticky Footer

To make the footer stick to the bottom of the page, add a surrounding div with a unique id around your content. In this demo, we named the div id #mainBodyContainer.

Be sure not to wrap the div around the footer.

Here is an example of the markup:

                                
                                <html>
                                  <head>...</head>
                                  <body>
                                    <div id="mainBodyContainer">
                                      <!-- main content here -->
                                    </div>
                                    <!-- /#mainBodyContainer -->
                                    <footer>
                                      <!-- footer content here -->
                                    </footer>
                                  </body>
                                </html>   
                                
                                

You then want to add this CS for the body and unique ID:

                                
                                body {
                                  display: flex;
                                  height: 100vh;
                                  flex-direction: column;
                                }
                                #mainBodyContainer {
                                  flex: 1 0 auto;
                                }  
                                
                                

Footer - Basic

Here a very minimal footer for web apps.

This is the body.

Forms

General Form Field

APA applications adhere to Bootstrap forms.

Forms are a crucial component of many ITS applications. If you have something that you would like to add to this section, please send us an email at ux-services@apa.org with your feedback.

Below is the general structure for a text field input. The field label should be clear and properly describe the input. Placeholder text should simple and straightforward (Example: "Enter {Field Label Name}"). Also, if needed, provide helper text to help users add the correct input. We generally recommend single column format for all fields except for first and last name. We also recommend using title casing for field labels and placeholders. Helper text should use sentence casing. The following fields are accessible as well.

From W3C: The name attribute specifies the name of an <input> element. The name attribute is used to reference elements in a JavaScript, or to reference form data after a form is submitted. Note: Only form elements with a name attribute will have their values passed when submitting a form.

Also, autocomplete attributes ("autofill") should be used for input fields when appropriate. See documentation here.

Anything that would be important for the user to know should go here instead of the placeholder.

Required & Optional

Required Usage

All required fields should be marked with a red asterisk

The "All fields marked with * are required" statement (see example in demo) should be displayed at the top of every form with required field asterisks. The statement only needs to be displayed once at the "top" of the screen (e.g., if there are multiple cards with form fields, put the statement on the first/top-most card with fields).

Use an asterisk (*) with the form field label:

  • <span class="text-danger required-asterisk">*</span>

Add text for a screen reader that a field is required:

  • <span class="sr-only">required</span>

Provide HTML and ARIA required attributes.

  • HTML5: <input type="text" id="first-name1" name="first-name" required>
  • ARIA: <input type="text" id="first-name2" name="first-name" aria-required="true">
Optional Usage

For optional fields, "(optional)" can be displayed if it makes sense for the specific form/screen (e.g., on the ecommerce redesigns, with the Phone Extension field). If using Optional display instead of Required, include the statement "All fields are required unless marked as Optional" at the top of the form.

When marking an optional field, use <span class="optionalText">(optional)</span>

Circumstances that you can utilize Optional form fields:

  • When asking for an address from a user, additional address fields beyond the first can be marked as optional.
  • When asking for a user's name and the middle name or initial is optional.

Ideally, a combination of the above methods to mark that fields are required and optional within forms to make it clearest to all users. This will reduce the number of errors when filling out forms and allow a smoother user experience for users.

All fields marked with * are required

Email & Password

Password should use uppercase and lowercase letters.

First Name & Last Name

First Name and Last Name are two input fields which can be placed horizontally.

Address Form Example

To make the first option in the select list be "disabled", which adds an effect similar to input field placeholder text, use code such as: <option selected="true" disabled="disabled">Choose section...</option>

For the Country dropdown, put the "United States" select option on the top of the list if appropriate, but also include this option alphabetically in the select list. For a horizontal line separator in the select list, you can use <option value="" disabled="disabled">&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;</option>

Street address, P.O. box, company name, c/o. (Example: 1234 Main Street)
Apartment, suite, unit, building, floor, etc. (Example: Suite 203)

Checkboxes and Radios

Checkboxes allow users to select multiple options, where radio groups allow users to select one option from a group.

Use fieldsets to group related form controls. The first element inside a fieldset must be a legend element which describes the group. Please note that single checkboxes do not need to have fieldsets or legends.

Any general text which is important for filling in the form and cannot be put into a hint, should be in that legend (as shown in the first checkbox group example). But the legend shouldn't be too long either.


Radio Buttons
Radio Button Example

Single Checkbox

Checkbox Group

Checkbox Group Example

Select all that apply.

Checkbox Group (Hint outside of legend)

Avoid links in legends when possible. Links inside legends are not read by some screen readers, most notably Internet Explorer 11, paired with JAWS. If you need a pattern like this, put the link outside of the legend element, but keep all other useful hint text in the legend. You will need to use the aria-describedby attribute to show the relationship between the legend to the hint.

Checkbox Group Example 2

Find additional information in the help section.

Other Fields

For certain fields, such as the search input fields, the label can be hidden with .sr-only.

Checkbox Toggle

A checkbox toggle is a good solution for minimizing the amount of fields shown at once on the screen. Currently, we are using this toggle on two systems–APA ecommerce screens and Course Adoption System.

Form Validation Example

Here is an example of form validation (using the jQuery Validate library). The Email field here is validated as being required and it needs to be a valid email format.

In most cases, the validation message should include the field label and be written in the following format: Enter your [FIELD LABEL]. In some cases, a top error container should be used in addition to contextually placed error messages.

The cursor should be focused to the top-most invalid field on the page after a form submit.

For fields with errors, we recommend highlighting the input field border red (#a94442) along with a red message (#990000) underneath the field. On form submit, successfully validated input fields should have a green border (#2a8c3a) with no corresponding message. On focus of valid fields should have a box shadow of box-shadow: inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #51cb65; and on focus of invalid fields should have a box shadow of box-shadow: inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ff0000;

Character Count

This character count is modeled after the gov.uk component for accessibility. An example of usage is the Polaris onboarding and preference management forms.

This design allows user input to exceed the maximum characters, but applies an error class to the character count when the input exceeds the maximum allowed characters. This lets users type or copy and paste their full input, then edit it down. In addition to this message, frontend validation should be used to prevent form submission when the input exceeds the maximum allowed characters.

The JavaScript for this component makes the character count work.

Also included in this example is a script making the textarea autogrow based on input.

Do not include personal or financial information like your Social Security Number or credit card details.

Headers

Most applications can utilize a simplified header, with a minimalist design of the APA logo or specific app logo, and other elements such as a "cart" button and "log in" button (e.g., the Course Adoption System site).

The APA logo could be replaced with an app-specific logo (with changes to the destination anchor of the logo also). Note there are responsive media queries to resize and switch the logos from horizontal to stacked on smaller devices.

Header - Basic

The most basic, simplified app header, used for pages that focus on a main conversion in the page's body section (e.g., login forms).

Header - Basic with Cart and Log In Buttons

A simplified app header with additional buttons/links, used for apps which need additional top buttons (e.g., to show items in a shopping cart or "log in/log out" links.


Modals

When creating modals, be mindful of section heading semantics. Since modals sit outside of page, they should not use a <h1> but instead start with a <h2>. For an example of an accessible modal, please refer to WAI-ARIA Authoring Practices.

Modal - Types

Different types of modal designs to be used in different scenarios.




Modal - Sizes

Default (medium), full screen, extra large, large, and small modal sizes, which can be applied to any type of modal. Note there are responsive utilities for the full screen modal.





Timed Modal

An example of a modal that disappears after 5 seconds after being launched. Make sure there is enough time for a user to read the message.

Do Not Show Again Modal with Cookie

This modal example has a checkbox that when checked, sets a cookie to not show the modal again for one day.


Notes

Use a note to highlight important information on the page. This should be used instead of an alert if the message is long or needs to be larger.

Note - .alert-note

Note (Light) - .alert-note-light


Pagination

Pagination is a user interface pattern that divides content into separate pages. This component is helpful when you have a lot of content to display. For longer pages, place the pagination at the top and bottom of your list of items.

Pagination is good when the user is searching for something specific within the list of results. It also gives the user a sense of control. The numbered pages allows them to reference an item quicker too.

An alternative to pagination is a "Load more" button, where users only have to click one button to load the next set of results. With pagination, the list of results gets replaced whereas the "Load More" button adds to the list. Using the one button is ideal when users want to browse and compare items within a list.

Accessibility notes: Pages likely have more than one such navigation section. Provide a descriptive aria-label for the <nav> to reflect its purpose. For example, if the pagination component is used to navigate between a set of search results, an appropriate label could be aria-label="Search results pages". Also, provide HTML for screenreaders to show the active/current page, such as <li class="page-item active" aria-current="page"><span class="page-link">1<span class="sr-only">(current)</span></span></li>

Here is an example that has active and disabled states.

We recommend swapping out active or disabled anchors for <span> to remove click functionality and prevent keyboard focus while retaining intended styles.

Working with Icons

When adding icons instead of text to pagination, provide proper screen reader support with aria attributes and the .sr-only utility.

Large Data Sets

For large data sets, we recommend showing the first and last page number and then truncating the pagination with ellipses. To help the user quickly navigate through the list, add start start and end along with previous and next.

Responsiveness note: Consider the horizontal length of your pagination on mobile so that it is able to fit inside a smaller breakpoint.

Demo

21 - 25 of 43
Results per page:
21 - 25 of 43

Progress Meter

A simple progress meter used on several apps (e.g., ecommerce screens, CAS). Note the progress labels are not shown <760px.

  • 1Search
  • 2Request
  • 3Review
  • 4Thanks

Tags

Tags utilize the same coding as Badges, with the addition of an accessible "close" button similar to Modals. See the Badges page for variations for casing and sizes, although note that the line-height style and other styles may need to be changed for different tag sizes.

Extra JavaScript is needed for the closing/fadeout of the tags.

Contextual Variations - Badge Style

Primary
Secondary
Success
Danger
Warning
Light
Dark

Contextual Variations - Badge Pill Style

Primary
Secondary
Success
Danger
Warning
Light
Dark

Primary Tags Style

Lorem
Ipsum
Consectetur

Publications Tags Style (modeled after .btn-pubs-2)

Excepteur
Proident
Officia

Tooltips & Popovers

Tooltips

Tooltips can be used as a way to show short, non-critical information to the user. They are meant to clarify or help you use the content that they hover over, not add additional content. For a short sentence or less message to the user, use a tooltip.

Since tooltips are only meant to tell the purpose of an element, they should be short and to the point (e.g., "Click X to do X" or "User post count").

Tooltips are typically only visible on hover. So, if you need to be able to read the content while interacting with other parts of the page, then a tooltip will not work and you should consider using a popover.

For icons, we are using the question mark icon for tooltips.




Example Tooltip with Icon

Popovers

Popovers are meant to give related additional content. A popover is used to embed a longer note into a tag; by default they are activated by clicking on the tag (text and/or icon).

Popovers can be much more verbose than tooltips, and can include a header and many lines of text in the body. If HTML is needed in the message, the message is multiple sentences/lines of text, or if you want both a heading and text in the message, use a popover.

Popovers are typically dismissable, whether by clicking outside of the popover, a close button on the popover, or clicking again on the popover text/icon (depending on implementation). For that reason, you can set up a popover to allow you to interact with other elements on the page while still being able to read its content. On top of that, since popovers will remain open when mousing out of their target, you can add additional buttons or interactions within them.

For icons, we are using the info icon for popovers.







Example Popover with Icon