gitlab-org--gitlab-foss/doc/development/ux_guide/components.md

7.0 KiB
Raw Blame History

Components

Contents


Tooltips

Usage

A tooltip should only be added if additional information is required.

Tooltip usage

Placement

By default, tooltips should be placed below the element that they refer to. However, if there is not enough space in the viewpoint, the tooltip should be moved to the side as needed.

Tooltip placement location


Anchor links are used for navigational actions and lone, secondary commands (such as 'Reset filters' on the Issues List) when deemed appropriate by the UX team.

States

Rest

Primary links are blue in their rest state. Secondary links (such as the time stamp on comments) are a neutral gray color in rest. Details on the main GitLab navigation links can be found on the features page.

Hover

An underline should always be added on hover. A gray link becomes blue on hover.

Focus

The focus state should match the hover state.

Anchor link states


Buttons

Buttons communicate the command that will occur when the user clicks on them.

Types

Primary

Primary buttons communicate the main call to action. There should only be one call to action in any given experience. Visually, primary buttons are conveyed with a full background fill

Primary button example

Secondary

Secondary buttons are for alternative commands. They should be conveyed by a button with an stroke, and no background fill.

Secondary button example

Icon and text treatment

Text should be in sentence case, where only the first word is capitalized. "Create issue" is correct, not "Create Issue". Buttons should only contain an icon or a text, not both.

TODO: Rationalize this. Ensure that we still believe this.

Colors

Follow the color guidance on the basics page. The default color treatment is the white/grey button.


Dropdowns

Dropdowns are used to allow users to choose one (or many) options from a list of options. If this list of options is more 20, there should generally be a way to search through and filter the options (see the complex filter dropdowns below.)

TODO: Will update this section when the new filters UI is implemented.

Dropdown states


Counts

A count element is used in navigation contexts where it is helpful to indicate the count, or number of items, in a list. Always use the number_with_delimiter helper to display counts in the UI.

Counts example


Lists

Lists are used where ever there is a single column of information to display. Ths issues list is an example of a important list in the GitLab UI.

Types

Simple list using .content-list

Simple list

List with avatar, title and description using .content-list

List with avatar

List with hover effect .well-list

List with hover effect

List inside panel

List inside panel


Tables

When the information is too complex for a list, with multiple columns of information, a table can be used. For example, the pipelines page uses a table.

Table


Blocks

Blocks are a way to group related information.

Types

Content blocks

Content blocks (.content-block) are the basic grouping of content. They are commonly used in lists, and are separated by a botton border.

Content block

Row content blocks

A background color can be added to this blocks. For example, items in the issue list have a green background if they were created recently. Below is an example of a gray content block with side padding using .row-content-block.

Row content block

Cover blocks

Cover blocks are generally used to create a heading element for a page, such as a new project, or a user profile page. Below is a cover block (.cover-block) for the profile page with an avatar, name and description.

Cover block


Panels

TODO: Catalog how we are currently using panels and rationalize how they relate to alerts

Panels


Alerts

TODO: Catalog how we are currently using alerts

Alerts


Forms

There are two options shown below regarding the positioning of labels in forms. Both are options to consider based on context and available size. However, it is important to have a consistent treatment of labels in the same form.

Types

Labels stack vertically

Form (form) with label rendered above input.

Vertical form

Labels side-by-side

Horizontal form (form.horizontal-form) with label rendered inline with input.

Horizontal form


File holders

A file holder (.file-holder) is used to show the contents of a file inline on a page of GitLab.

File Holder component


Data formats

Dates

Exact

Format for exacts dates should be Mon DD, YYYY, such as the examples below.

Exact date

Relative

This format relates how long since an action has occurred. The exact date can be shown as a tooltip on hover.

Relative date

References

Referencing GitLab items depends on a symbol for each type of item. Typing that symbol will invoke a dropdown that allows you to search for and autocomplete the item you were looking for. References are shown as links in context, and hovering on them shows the full title or name of the item.

Hovering on a reference

% Milestones

Milestone reference

# Issues

Issue reference

! Merge Requests

Merge request reference

~ Labels

Labels reference

@ People

People reference

TODO: Open issue: Some commit references use monospace fonts, but others don't. Need to standardize this.