Skip to end of banner
Go to start of banner

Tag input

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this content. View the current version.

Compare with Current View Version History

« Previous Version 17 Next »

Carlie Bradshaw

Description

Tag inputs allow multiple metadata tags to be added to a piece of content from a pre-defined set. Adding tags can make the content easier to find, instigate relevant workflows, or define access permissions.

Common tagsets include department, region, product, and personal information such as email addresses.

Where tags are subsequently being used to filter content, use the Filter Pane.

Types

Type

Usage

Image

Browsable list

Users may not know what the options are, and need to browse the entire list of possible tags.

Users may not know the exact terminology used for the tag labels.

For small-to-medium size tagsets.

Auto-completion

Users know what they are looking for, and do not need to browse the entire list of possible tags.

Users are likely to know the exact labels for the tags they’re looking for.

For large tagsets.

Usage & Behavior

General guidelines

Each tagset should have its own tag input.

Structure

Browsable list

A browsable list tag input consists of:

  • the tag field, containing:

    • applied tag pills, showing the tags already selected.

    • a trigger button, to open the tag selector.

  • a tag menu, containing:

    • a Search field.

    • a list of all available tags, each including:

      • a label.

      • a checkbox.

    • a scrollbar, where needed.

Auto-completion

An auto-completion tag input consists of:

  • the tag field, containing:

    • applied tag pills, showing the tags already selected.

    • a text field, to the right of any applied tags.

  • a completion menu, containing:

    • a list of up to 20 tags.

    • a scrollbar, where needed.

Default State

  • Where appropriate, tags may be pre-applied by default.

  • When the browsable list tag menu is opened the search field should be in focus by default.

Internal Logic

  • For both input types, search should follow the logic and behavior of Live Search.

Tag field

  • The tag field may optionally expand as more tags are applied. A limit may be set to the field height.

  • Can pills be truncated if the tag is particularly long? With the full label shown on hover?

  • When there is no more space for additional pills, either:

    • a Scrollbar may be added to the field to show additional rows of pills, or

    • multiple additional tags may be combined into one pill. The pill label should show the number of additional tags, e.g. 4 tags. (Browsable list only)

      • On hover, all of the individual additional tags will be shown in a Tooltip.

      • On click, the full tag menu will open, allowing the user to remove tags.

Tag ordering

  • Browsable list:

    • The list of tags should be in a logical order to make them easy to scan, such as alphabetical, numerical, or frequency of use.

    • The tag order should remain the same when a search is applied.

  • Auto-complete:

    • When the tag field is first selected, the tags should be ordered by frequency or recency for the individual user.

    • After search, the results should be ordered by relevance.

Pill ordering

  • Pills should be arranged left-to-right in the order in which the tags were added.

States

IMAGES

State

Browsable list tag field

Auto-complete tag field

Applied tag pill

Regular

List items: follow Multi-select Checkbox List

Follow Text Field ? And List.

Hover

Active

-

Error

-

Warning

-

Focused

Interaction

Browsable list

The tag menu will be opened when the user clicks on either:

  • the trigger button, or

  • any blank space in the tag field.

Tag menu

  • In the search field:

    • entering characters filters the tags using Live Search.

    • pressing Enter:

      • selects the top tag, and

      • clears the search field, ready for another search. The tag selector remains open.

  • Within the tag list:

    • clicking anywhere on the tag label or checkbox selects and applies the tag. The tag selector remains open.

  • Clicking outside of the tag menu closes it.

Auto-complete

Tag field

  • When the tag field is selected:

    • the completion menu is opened.

    • the most frequently or recently selected tags are shown.

  • As characters are entered, the tags are filtered using Live Search.

  • Pressing Enter while focus is on the tag field:

    • applies the first tag in the completion menu,

    • clears the current search, and

    • closes the completion menu.

  • Where no matching tags are shown, pressing Enter while focus is on the tag field should keep the existing search string.

Completion menu

  • Clicking on a tag will:

    • apply the focused tag,

    • clear the current search,

    • close the completion menu, and

    • return the focus to the tag field, ready to search again.

  • Clicking outside of the completion menu closes it. The existing search string should be kept.

Applied tag pills

  • Tags can be removed by:

    • clicking the X button on the right-hand side of a pill.

    • clicking on a pill to select it and clicking Delete.

  • When a pill is removed, the remaining pills will move to close the gap.

  • Clicking on a pill label may open a Popover showing further details, where relevant (optional).

Auto-complete

  • Pressing Delete when there are no search characters applied will delete the last applied tag pill.

Validation and Errors

The tag menu should show an empty state when a search has no matching tags.

Best practices

General

  • Where content is shown in a table, allow multiple items to be tagged at the same time.

Use:

  • a tag input to apply tag metadata to a piece of content.

  • a browsable list for smaller tagsets where the user is unlikely to know which tags are available.

  • auto-completion for larger tagsets where the user is likely to know the exact label for the tag(s) they’re looking for.

Don’t use:

  • to apply tag filters when searching for content → use the Filter Pane instead.

  • where only one tag can be applied to an item → use a Drop-down Menu instead.

Accessibility Compliance

Unless otherwise specified, see our general compliance information in Fundamentals - Accessibility.

Focus management

Browsable list tag field

Keyboard

Description

Tab

  • From a previous component, moves focus to the first pill in the list.

  • Moves between the pills, then to the trigger button.

  • From the trigger button, will navigate to the next component.

Shift + Tab

Reverse tab

Space

Focuses the pill (for tooltips) or selects the trigger button.

Enter

Focuses the pill (for tooltips) or selects the trigger button.

Delete

On a pill: removes the pill, de-selecting the tag.

Esc

Removes the pill, de-selecting the tag.

Arrows

Left/Right: moves between the pills and trigger button.

Up/Down: nothing?

Auto-complete tag field

Keyboard

Description

Tab

  • From a previous component, moves focus to the first pill in the list.

  • Moves between the pills.

  • After the last pill, moves to the text field.

  • From the text field, navigates to the next component.

Shift + Tab

Reverse tab

Space

On a pill: focuses the pill (for tooltips)

On the text area: as text input.

Enter

On a pill: focuses the pill (for tooltips).

On the text area: opens the completion menu. Should it also close it if it’s already open?

Esc

Removes the pill, de-selecting the tag.

Delete

On a pill: removes the pill, de-selecting the tag.

On the text area: as text input. After all text deleted, removes the last added pill.

Arrows

Left/Right: moves between the pills and text area.

Up/Down: nothing?

a-z, A-Z

Automatically moves focus/cursor to right of the last pill and starts to search.

Browsable list tag menu and Auto-complete completion menu

Follow https://kanasoftware.jira.com/wiki/spaces/UserExp/pages/1273110308/List#Focus-management

Design

Zeplin link

Screen thumbnail

<<Short Zeplin link. YouUse this >>

<<Screen with 200 width>>



Code

<<a box containing the code - discuss with Femi>>

  • No labels