This page documents
@whop/elements@1.10.0 and @whop/elements-react@1.10.0.v1.0.0.
Mounts inside Tracking. accountId and accessToken come from there. Pass props and callbacks through the create options or React props.
Example data. Open the Playground.
Props
Pin the window to an exact ISO 8601 instant instead of the handle’s
period — how a deep link reproduces the precise rows behind a metric. Set both from and to or neither. Defaults to "".Narrow to events attributed to a traffic source, as a source path —
whop:adcamp_…:* for one of the account’s campaigns, ext:*, referrer:*, direct. Defaults to "".Narrow to one person’s journey — a person ID, an email, or a visitor cookie. Set, the list ignores the window and shows their whole history. The search box moves this. Defaults to
"".Narrow by event name —
payment.completed, pixel.lead, pixel.page, or pixel.custom:<name> for a custom event. The same value the ads table’s result counts link with. Defaults to "".Events
Pass callbacks in the create options or React props.onPeriodChanged
The viewer moved the window from the period selector. Every surface under the same handle has already followed it; persist it and pass it back as period/customRange on the handle, or the window resets on the next mount.
onAttributionModelChanged
The viewer changed which touch gets the credit, from the filter row’s Attribution menu. Every surface under the same handle has already re-credited; persist it and pass it back as attributionModel on the handle, or it reverts on the next mount.
onFiltersChanged
The viewer moved a filter or the identifier search. Carries the entire filter state whichever moved — mirror it into your own URL and pass it back as props to make the view reproducible.
onPersonOpened
The viewer clicked a person cell and the handle has no links.person to follow. Present the person element with it, e.g. createOverlay("person", { identifier: payload.personId }) (personId is the stable per-person key; identifier is the most human-meaningful one the surface has), or pass links.person on the handle to turn the cells into real anchors instead.
onLoaderStart
Runs after the loading skeleton first paints and before onReady.
onReady
Runs after the element’s first complete paint.
onError
Runs when the element fails to load or crashes. The fallback remains visible. Use code for programmatic handling. sourceKey identifies a failed host-state source.
Methods
Call these on the handle returned bycreate, or through a React ref.
mount
Mounts the element in target and starts loading. React components mount themselves.
Parameters
destroy
Removes the element and releases its frame and subscriptions. You can call it more than once. React removes the element automatically.
update
Merges new props into the mounted element. In React, change the component props instead.
Parameters
Styling
This element doesn’t expose class names for styling. Useappearance (theme, accent color, variables) to restyle it.
