Skip to main content

Hover card

A preview card that appears on hover or focus.

Left out of Brand expressive Touch screens have no hover, and visitors come from social posts on their phones. Popover already opens a product preview on tap. Use instead: Popover

See it live​

Start Storybook to see it live: npm run storybook

When to use it​

  • Use it when: A quick look at a person or link for people with a mouse, with the same detail reachable on click.
  • Not when: The only way to see the content: touch screens have no hover.

Instead:

Words​

  • Headlines are short and bold. Three to six words.
  • Verbs that move: Join, Try, Go.
  • Playful in headlines, plain in errors.
  • Use: Join, Drop, Go, Love. Avoid: Synergy, Leverage, Kindly.

The labels components use, from the voice tokens:

  • content.action.commit: Go
  • content.action.cancel: Not now
  • content.action.destroy: Remove
  • content.action.retry: Try again
  • content.action.empty-action: Explore the drop

See Voice and tone for the whole voice.

Use it in code​

npx open-ds add hover-card

The component reads only component keys and semantic tokens, so it follows the brand and mode on <html>.

Tokens it reads​

Hover card reads 6 tokens of its own, each an alias of a semantic token. Each row is one part: its own token, the semantic it aliases, and the value it ends at. Change a semantic and every component that reads it follows; override one of Hover card's tokens to change Hover card alone.

Changes with theme

Brand expressive decides what changes when you switch theme. Here a switch changes colors only, so the marked rows differ between light and dark; everything else holds steady.

PartIts token and the semantic it aliasesValue
Shared
Transition panels durationcomponent.transition.panels-durationmotion.duration.panelsvar(--transition-panels-duration)duration.moderate:200ms
Content
Cornercomponent.hover-card.content.radiusradius.controlvar(--hover-card-content-radius)radius.999:9999px
Fill
Changes with theme
component.hover-card.content.backgroundcolor.surface.raisedvar(--hover-card-content-background)Lighttaupe.light.0:#FFFFFFDarktaupe.dark.100:#33241F
Paddingcomponent.hover-card.content.paddingspace.inset.containervar(--hover-card-content-padding)space.32:2rem
Text
Changes with theme
component.hover-card.content.labelcolor.text.primaryvar(--hover-card-content-label)Lighttaupe.light.900:#1F1411Darktaupe.dark.900:#FFF8F3
Shadow
Changes with theme
component.hover-card.content.shadowelevation.overlayvar(--hover-card-content-shadow)Lightshadow.overlayDarkshadow.overlay-dark
From the system
Edge
Changes with theme
color.border.default
straight from the system, through --border
Lighttaupe.light.200 · #F2DCCFDarktaupe.dark.100 · #33241F