Back to Chromium

Component Spec: Key UIs / IPH

agents/projects/chrome-design-system/assets/component-specs/Key_UIs_IPH_Spec.md

153.0.7995.17.2 KB
Original Source

Component Spec: Key UIs / IPH

This specification document outlines the mapping, design tokens, styling variants, and interactive states of the IPH (In Product Help) component across Figma, C++ Views, and WebUI (Web Frontend).


Overview

The IPH (In Product Help) bubble is a prominent, contextual UI element used to educate users about features or changes. It attaches to an anchor view and supports combinations of a title, body text, an optional leading icon, progress dots for multi-step tutorials, and call-to-action buttons (a default primary button and secondary buttons).


1. Component Metadata & Source Files

FeatureFigma ComponentC++ Views (Desktop)WebUI (Web Frontend)
Component NameKey UIs / IPHuser_education::HelpBubbleView<help-bubble>
Source FilesFigma Link: 323:15270components/user_education/views/help_bubble_view.ccui/webui/resources/cr_components/help_bubble/help_bubble.ts

2. Styling, Variants & Features (Layout & Style)

Figma uses distinct layout variants to model combinations of features, whereas both C++ Views and WebUI use dynamic properties to conditionally render layout slots.

Figma VariantC++ HelpBubbleParams ConfigurationWebUI <help-bubble> Property
WITH ICON AND TITLEbody_icon + title_textbodyIconName + titleText
WITH TITLEtitle_text (without body_icon)titleText (without bodyIconName)
WITHOUT TITLEEmpty title_textEmpty titleText
WITH PROGRESS DOTSprogress (std::pair<int, int>)progress object ({current, total})
Action Buttonsbuttons vectorbuttons array
Dismiss/CloseHandled natively by bubblecloseButtonAltText (always present)

3. Component States

Interactive states apply primarily to the embedded call-to-action buttons within the IPH bubble.

Interactive StateFigmaC++ user_education::MdIPHBubbleButtonWebUI <cr-button> within IPH
DefaultSolid or Outlined renderingButtonState::STATE_NORMAL.action-button or .cancel-button
HoveredN/A (Standard CDS hover)ButtonState::STATE_HOVERED (InkDrop applied):hover pseudo-class / ripple
PressedN/A (Standard CDS press)ButtonState::STATE_PRESSED:active pseudo-class / ripple
FocusedN/A (Focus ring spec)views::FocusRing::Get(this)Focus ring via WebUI standard
DisabledN/AButtonState::STATE_DISABLED[disabled] attribute

4. Design Token Comparison (Side-by-Side)

Token TypeFigma PropertyC++ ui::ColorId / ConstantWebUI Variable / CSS
Background Color--desktop/sys/primary-colors/primary (#0b57d0)kColorFeaturePromoBubbleBackground--color-feature-promo-bubble-background
Foreground / Text Color--desktop/sys/primary-colors/on-primary (white)kColorFeaturePromoBubbleForeground--color-feature-promo-bubble-foreground
Default Button Bg--desktop/sys/primary-colors/on-primary (white)kColorFeaturePromoBubbleDefaultButtonBackground--color-feature-promo-bubble-default-button-background
Default Button Text--desktop/sys/primary-colors/primary (#0b57d0)kColorFeaturePromoBubbleDefaultButtonForeground--color-feature-promo-bubble-default-button-foreground
Corner Radius12pxProvided by LayoutProvider--help-bubble-border-radius: 12px
Inner Padding20pxUseCompactMargins()--help-bubble-padding: 20px
Element Spacing8pxHandled by FlexLayout gaps--help-bubble-element-spacing: 8px
Title Font Size18px (desktop/font_size/headline-three)ChromeTextContext::CONTEXT_IPH_BUBBLE_TITLENative h1 sizing
Body Font Size14px (desktop/font_size/body-two)ChromeTextContext::CONTEXT_IPH_BUBBLE_BODYNative p sizing (14px)

5. Architectural & Implementation Gaps

  • Component Decomposition vs. Monolith: Figma models different layouts (with/without icon, with/without title) as separate components for ease of design. The Chromium implementation (both C++ and WebUI) uses a single flexible component that dynamically toggles child nodes.
  • Button Architecture: In C++, user_education::MdIPHBubbleButton is a subclass of views::MdTextButton that overrides background painting logic to remove the default MD button border for prominent buttons and manually applies border strokes based on HelpBubbleDelegate colors. WebUI delegates standard <cr-button> styles.
  • Arrow Positioning: WebUI uses a robust CSS injection (--help-bubble-arrow-offset) and rotated div injection for the pointer arrow, whereas C++ uses native views::BubbleFrameView and views::BubbleBorder::Arrow translations.

6. Styling, Variants, Features and States Mismatches

  • Typography Mapping: The C++ layer abstracts font sizes through ChromeTextContext::CONTEXT_IPH_BUBBLE_TITLE and ChromeTextContext::CONTEXT_IPH_BUBBLE_BODY. Figma explicitly names the fonts Google_Sans and sizes them at 18px and 14px, which strictly relies on the Chromium text context correctly resolving those sizes globally.
  • Focus & Accessibility: In C++, a prominent focus ring (views::FocusRing) is manually injected matching GetHelpBubbleForegroundColorId(). Figma does not explicitly depict this state.
  • Close Button Color: C++ uses GetHelpBubbleCloseButtonInkDropColorId() for the ClosePromoButton state, managing a custom ink drop to blend against the prominent blue background.

7. Usage & UX Guidance

1. General Principles & Best Practices

  • Concise Content: Keep titles short and directly actionable. Body text should explain feature value without overcrowding the layout.
  • Progress Tracking: Always provide multi-step tutorials using the progress properties so users understand the length of the flow.

2. Platform Consistency, Keyboard Controls & Accessibility (a11y)

  • WebUI a11y rules: <help-bubble> acts as role="alertdialog" and uses aria-live="assertive", aria-modal="true", and ties labels using aria-labelledby and aria-describedby.
  • C++ Views native focus: HelpBubbleView overrides SetAccessibleWindowRole(ax::mojom::Role::kAlert). Navigation between panes is bound to IDC_FOCUS_NEXT_PANE accelerators.

3. Icon Usage Guidelines

  • Leading icons should ideally utilize high-contrast white bounds (#ffffff on #0b57d0).
  • The Close icon is strictly for dismissal and utilizes the generic system exit icon (cancel or close).

8. Inheritance Structure

  • C++ Views (Desktop): views::Viewviews::BubbleDialogDelegateViewuser_education::HelpBubbleView (Internal button uses views::MdTextButtonuser_education::MdIPHBubbleButton)

  • WebUI (Web Frontend): HTMLElementLitElementHelpBubbleElement (<help-bubble>)