Name Description Size Coverage
_WidgetCelebration.scss 14931 -
_Widgets.scss 16215 -
_WidgetsRowAd.scss 3783 -
_WidgetWrapper.scss 1732 -
Clocks -
Crossword -
FocusTimer -
FramedWidgetCard.jsx A submenu of checkable options for a WidgetMenuItem of type "choice". @param {object} props @param {string} props.submenuId - id of the submenu panel-list @param {object} props.item - the WidgetMenuItem @param {string} props.checkedValue - the chosen value @param {Function} props.onChoose - called with the value of a clicked option 7578 -
Horoscopes -
Lists -
MoveSubmenu.jsx 4690 -
MozWidgetCard.jsx The moz-widget card of a WIDGET_REGISTRY entry drawn by a widget document. Its menu holds the shared widget items, below any menuItems. Without a document, the card shows a placeholder. @param {object} props @param {Function} props.dispatch - Redux dispatch. @param {object} props.entry - the WIDGET_REGISTRY entry, merged with its ExtensionWidget @param {string} props.size - the widget's size @param {string} [props.displaySize] - the size the widget is drawn at, which can be larger than its size @param {string} props.src - URL of the widget's document, or "" for none @param {boolean} [props.readyOnLoad=true] - count the document's load as ready. @param {object} props.widgetEnabledMap - Map of widget id to whether it is currently active, used by the Move submenu. @param {React.ReactNode} [props.menuItems] - menu items drawn above the shared ones; omit for none @param {Function} [props.onChangeSize] - called with the size the user chooses, after it is stored @param {{current: Element|null}} [props.cardRef] - set to the moz-widget 6543 -
PictureOfTheDay -
Privacy -
RecentSearches -
SizeSubmenu.jsx 1083 -
Solitaire -
Stocks -
Travel -
useCountUp.jsx Animates a number from one value to another on demand. Returns `displayValue` (the resting value unless an animation is running), `countUp(from, to)` to start one, `hold(at)` to pin the readout without animating, and `release()` to undo a hold. Callers keep rendering their own value; this only takes over for the duration of a run. @param {number} value Resting value shown when no animation is running. @param {number} durationMs Length of the count, in ms. 3077 -
useFramedWidgetMessages.jsx Calls onMessage for every valid message a framed widget's document posts. The frame posts with targetOrigin "*" (about:newtab is opaque), so a message only counts when it comes from the frame's window and origin on the widget's channel, `<telemetryName>_widget`. @param {object} options @param {object} options.widget - a WIDGET_REGISTRY entry @param {string} options.src - URL of the widget's document @param {object} options.iframeRef - ref to the widget's iframe @param {Function} options.onMessage - called with (type, message, payload) 7261 -
usePageVisible.jsx 884 -
useWidgetCelebration.jsx Shared widget-celebration lifecycle hook. Usage: 1. Create a ref for the widget root element and pass it to this hook. 2. Render <WidgetCelebration /> only when both `isCelebrating` and `celebrationFrame` are truthy, and pass `completeCelebration` to the component's `onComplete` prop. 3. Call `triggerCelebration()` when the widget reaches its completion state. Returns `false` if the animation was skipped (reduced motion or no widget ref) so the caller can run its completion handler inline. For effects that decorate one element rather than the whole card (e.g. the Privacy count-up sparkles), render <CelebrationSparkles> inside that element instead — it positions itself in CSS, with no measured rect to go stale. Example: const widgetRef = useRef(null); const { celebrationFrame, celebrationId, completeCelebration, isCelebrating, triggerCelebration, } = useWidgetCelebration(widgetRef); <article ref={widgetRef}> {isCelebrating && celebrationFrame ? ( <WidgetCelebration celebrationFrame={celebrationFrame} celebrationId={celebrationId} onComplete={completeCelebration} ... /> ) : null} </article> 2789 -
useWidgetDnD.jsx Widgets-row adapter over the generic pointer reorder hook. Keeps the order the user just chose on screen until the pref write comes back. 2440 -
useWidgetTelemetry.jsx Shared telemetry hook for function-component widgets. Returns recorders for the five widget telemetry actions (impression, user event, enabled, error, ready) so call sites don't hand-build payloads. `widget` is a WIDGET_REGISTRY entry; `widget.telemetryName` becomes `widget_name`. const { impressionRef, recordImpression, recordUserAction, recordEnabled, recordError, recordReady, } = useWidgetTelemetry({ dispatch, widget, widgetSize }); <article ref={impressionRef}>...</article> recordUserAction(WIDGET_USER_ACTIONS.LEARN_MORE, { source: WIDGET_SOURCES.CONTEXT_MENU, }); Optional `widgetVariant` is sent as `widget_variant` on all five events, and left off while it's undefined. Per-call options on `recordUserAction`: `value` (action_value), `size` (overrides widgetSize), `alsoToMain: true` (routes via AlsoToMain), and `legacy: true` (co-dispatches `legacyUserEventType` with `{ userAction }`). `recordImpression()` is a manual one-shot fire that shares the observer's impressionFired guard; useful when a widget needs to record an impression outside the IntersectionObserver path. Constructor `legacyImpressionTypes` (array) and `legacyUserEventType` bridge the Bug 2012779 transition: while WIDGETS_TIMER_* / WIDGETS_LISTS_* legacy events still exist alongside the unified events, FocusTimer and Lists pass the matching legacy action types so the hook emits both. Both co-dispatches fire legacy first, unified second. `onImpression` (optional) runs once, right after the widget impression fires (from the IntersectionObserver, or a manual recordImpression), receiving the impression payload. Use it to hang extra, view-gated telemetry off the same trigger so it lines up with the impression and never fires on a preloaded tab that was never seen. 8649 -
Weather -
WeatherForecast -
WidgetCelebration.jsx Sparkle burst, rendered *inside* the element it should decorate (give that element `position: relative`). Positioning is pure CSS inset, so it tracks the element through icon swaps, count-up digit changes and font loads — a measured rect captured once at trigger time does not. 10564 -
WidgetError.jsx The message shown in place of a widget that could not be loaded. Mount it only while the widget is in its error state. It records the error the first time the message is on screen, so a preloaded tab the user never saw records nothing. @param {object} props @param {Function} props.recordError - recordError from useWidgetTelemetry. @param {string} [props.errorType="load_error"] - the error type to record. @param {string} props.title - the widget's name, already localized. role="alert" announces the message and nothing else, so the name goes inside it even when a header already shows it. @param {boolean} [props.headerless] - true for a widget that draws no header of its own. The name then shows above the message rather than only being announced. @param {string} [props.l10nId="newtab-widget-error-not-available"] - Fluent id of the message. A widget with its own wording passes that instead. @param {string} [props.slot] - the slot for the error message. 2495 -
WidgetMenuButton.jsx 657 -
WidgetMenuFooter.jsx 2140 -
WidgetMenuPoweredBy.jsx 904 -
WidgetPlacement.jsx Provides the placement and the location for the widgets section. @param {object} props @param {string|null} [props.placement] - a WIDGET_PLACEMENTS value @param {React.ReactNode} props.children 4439 -
Widgets.jsx 41988 -
WidgetsComponentRegistry.jsx 2250 -
WidgetsRowAd.jsx The sponsored card in one cell of the widgets row. @param {object} spoc - a normalized spoc from state.DiscoveryStream.spocs @param {Function} dispatch @param {string} type - telemetry source 1782 -
WidgetsSidebar.jsx 2186 -
WidgetWrapper.jsx 598 -