Popover

Version 7.0.1

Popovers are containers used to display transient content such as menus, options, additional actions, and more. They visually stand out through stroke and drop shadow and float on top of the interface.

2 examples of a popover. An action button, label Settings, with popover with avatar, label Lisa Wilson and 3 menu options under a divider, Language, Notifications, Badges. Popover with tip triggered by a color swatch, 2 menu options, Edit and Delete.2 examples of a popover. An action button, label Settings, with popover with avatar, label Lisa Wilson and 3 menu options under a divider, Language, Notifications, Badges. Popover with tip triggered by a color swatch, 2 menu options, Edit and Delete.
DateVersionSpectrumExpress UI KitDec 15, 20227.0.1DownloadDownloadApr 06, 20227.0.0DownloadJan 13, 20216.0.0DownloadApr 19, 20195.0.0Download

Anatomy#

Image illustrating through labels the component anatomy of a popover, including its content area, and optional tip.

Options#

Image illustrating through pink shading areas along the width and height dimensions of a popover that the width and height are customizable.

Width and height#

A popover’s width and height can be customized appropriately for its context.

2 different popovers. A popover with option show tip, no. This popover floats directly above the source. A popover with option show tip, yes. This popover floats directly above the source and has a triangular tip that points to the source.

Show tip#

By default, popovers do not have a tip. Popovers without a tip should be used when the source has a visually distinct down state, in order to show the connection between the popover and its source.

Popovers can have a tip. A tip should be used to help show the connection to its source, in cases where the source does not have a visually distinct down state.

3 examples of popover placement. First example, placement: top. Popover is centered and directly above the source. Second example, placement: bottom start. Popover is aligned to the left and below the source. Third example, placement: right top. Popover is aligned to the right upper corner of the source.

Placement#

A popover is positioned in relation to its source. The placement property values are the following: top, top left, top right, top start, top end, bottom, bottom left, bottom right, bottom start, bottom end, left, left top, left bottom, start, start top, start bottom, right, right top, right bottom, end, end top, end bottom. The default placement value is at the top.

2 popovers, one without a tip and one with a tip, both with 8 pixels of an offset.

Offset#

The offset is the distance between the source and the popover edge (or the end of the tip, when there is a tip). The default value is spacing-100 (8 px), but this should be adjusted depending on the perceived bounding box of the source.

Example of a popover with placement of top start and cross offset of -16 pixels.

Cross offset#

The cross offset is the placement offset on the cross axis (x-axis for top and bottom, y-axis for left and right). The default value is 0 px.

Example of a popover with top placement and 8 pixels of container padding.

Container padding#

To make sure that a popover will stay within certain boundaries (e.g., a browser window) it’s possible to define a container, and a container padding value, to respect. The default value is 8 px.

Table of options#

From the design point of view, each component has a number of options. These options and their names are platform agnostic, and each implementation should adapt these to fit into their framework.

PropertyValuesDefault Valuewidthnumberheightnumbershow tipyes / nonoplacementtop / top left / top right / top start / top end / bottom / bottom left / bottom right / bottom start / bottom end / left / left top / left bottom / start / start top / start bottom / right / right top / right bottom / end / end top / end bottombottomoffsetnumberspacing-100 (8 px)cross offsetnumber0container paddingnumber8 px

Behaviors#

Animation showing the behavior of a popover from its opening to its closing. A picker labeled Country opens to show 3 menu options: Canada, Mexico, and United States. Selected option, United States.

Animation#

When displaying a popover, it should animate from its source to reinforce the connection between popover and source. It fades in and slides with a subtle motion from the source.

Dismissing a popover#

A popover can be dismissed by either clicking or tapping anywhere outside of the popover (including clicking or tapping the source again), or by selecting an option or taking an action inside the popover.

Usage guidelines#

Popovers or trays?#

Trays can be used as alternatives to popovers on small screens. Use a tray when showing a volume of content that is too overwhelming to put in a popover.

do
Key example of the correct use of a popover on a mobile device. Icon-only action button, label More options. 3 menu options, Share with..., Edit, Delete.

Show tip when source is ambiguous#

When the source that triggers the popover does not have a visually distinct down state, use a popover with a tip to clearly indicate the connection to its source.

do
2 key examples of correct usage of popovers with and without tips. First example, an icon-only action button, label More options, in a selected down state, with 3 menu options, Rename, Delete, Share with…, no tip. A swatch group of 6 swatches with a popover with a tip pointing to the third swatch from the left, 2 menu options, Edit, Delete.
dont
Key example of incorrect usage of a popover. A swatch group of 6 swatches with a popover with no tip, 2 menu options, Edit, Delete. Source is not clear because there is no tip on the popover.

Changelog#

DateNumberNotesDec 15, 20227.0.1
  • Default offset value updated to spacing-100 (8 px)
  • Background color updated to background-layer-2-color (no change in light theme, changed from gray-50 to gray-100 in dark/darkest themes)
  • Migrated to latest token system
Apr 06, 20227.0.0
  • Updated all colors to 6.0.0
Jan 13, 20216.0.0
  • Removed top and bottom padding
  • Added options (width, height, show tip, placement, offset, cross offset, container padding)
Apr 19, 20195.0.0
  • This component is now individually versioned (individual versions of existing items start at 5.0.0)

Design checklist#

N/A

All interactive states

Includes all interactive states that are applicable (hover, down, focus, keyboard focus, disabled).

check

All color themes

Works properly across all four color themes (lightest, light, dark, darkest).

check

All platform scales

Includes a desktop scale (UWP, macOS, web desktop) and a mobile scale (iOS, Android, web mobile).

N/A

Accessible use of color

Color is not used as the only visual means of conveying information (WCAG 2.0 1.4.1).

N/A

Accessible contrast for text

Text has a contrast ratio of at least 4.5:1 for small text and at least 3:1 for large text (WCAG 2.0 1.4.3).

unchecked

Accessible contrast for UI components

Visual information required to identify components and states (except inactive components) has a contrast ratio of at least 3:1 (WCAG 2.1 1.4.11).

check

Content design

UI language and information design considerations have been incorporated into component design.

check

Defined options

Includes relevant options (variant, style, size, orientation, optional iconography, decorations, selection, error state, etc.)

check

Defined behaviors

Includes guidelines for keyboard focus, layout (wrapping, truncation, overflow), animation, interactions, etc.

check

Usage guidelines

Includes a list of dos and don'ts that highlight best practices and common mistakes.

N/A

Writing guidelines

Includes content standards or usage guidelines for how to write or format in-product content for the component.

N/A

Internationalization guidelines

Works properly across various locales and includes guidelines for bi-directionality (RTL).

N/A

Keyboard interactions

Follows WCAG 2.0 standards for keyboard accessibility guidelines and includes a description of the keyboard interactions.

check

Design tokens

All design attributes (color, typography, layout, animation, etc.) are available as design tokens.

check

UI kit

Includes a downloadable XD file that shows multiple options, states, color themes, and platform scales.

unchecked

Generated UI kit

Includes a downloadable XD file, generated by code using design tokens defined in Spectrum DNA, and shows multiple options, states, color themes, and platform scales.

unchecked

In Spectrum for Adobe XD plugin

Component is included in the Spectrum for Adobe XD plugin.