This page documents
@whop/elements@1.0.0-beta.0 and @whop/elements-react@1.0.0-beta.0.- Web
- Swift
Mounts inside
A row was clicked. Open your own detail view or route for it; the element never navigates.Signature:
The pointer entered a row, or left one (
The viewer changed the date filter through the filter row rather than through
Runs after the loading skeleton first paints and before
Runs after the element’s first complete paint.Signature:
Runs when the element fails to load or crashes. The fallback remains visible. Use
Re-fetch the account’s activity from the first page. Call it after a mutation made elsewhere (a deposit, a send) so the list reflects it without waiting for the cache to expire.Signature:
Set the date filter from outside the element, for example wiring a chart brush selection into the list. Pass
Mounts the element in
Removes the element and releases its frame and subscriptions. You can call it more than once. React removes the element automatically.Signature:
Merges new props into the mounted element. In React, change the component props instead.Signature: In React, pass
Wallet. accountId comes from there. Pass props and callbacks through the create options or React props. Keep the created handle, or React ref, to call refresh() and setDateRange().Example data. Open the Playground.
Props
string
Only show activity for this currency. Without it, activity from every currency is shown.
string
A scoped token for the read. An account needs
company:balance:read, and a user needs user:balance:read. Mint it on your server with POST /api/v1/access_tokens. Without it the read uses the viewer’s own session, which only works same-origin.boolean
When off, card transaction rows render inert (no click, no hover) instead of firing
activitySelected. Use it when you know the viewer isn’t allowed to see those details. Defaults to true.Events
Pass callbacks in the create options or React props.onActivitySelected
A row was clicked. Open your own detail view or route for it; the element never navigates.Signature: ((payload: { activity: LedgerActivity; }) => void)onActivityHovered
The pointer entered a row, or left one (null). Point something of your own at the same moment, like marking the row on a balance chart.Signature: ((payload: { activity: LedgerActivity; } | null) => void)onDateRangeChanged
The viewer changed the date filter through the filter row rather than through setDateRange. Clear any range selection of your own, like a chart brush, that no longer matches.Signature: ((payload: { dateRange: { start: string; end: string; } | null; }) => void)onLoaderStart
Runs after the loading skeleton first paints and before onReady.Signature: (() => void)onReady
Runs after the element’s first complete paint.Signature: (() => void)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.Signature: ((e: { message: string; code?: string | undefined; sourceKey?: string | undefined; }) => void)Methods
Call these on the handle returned bycreate, or through a React ref.refresh
Re-fetch the account’s activity from the first page. Call it after a mutation made elsewhere (a deposit, a send) so the list reflects it without waiting for the cache to expire.Signature: () => Promise<void>setDateRange
Set the date filter from outside the element, for example wiring a chart brush selection into the list. Pass null to clear it.Signature: (input: ActivityDateRangeOverride | null) => Promise<void>mount
Mounts the element in target and starts loading. React components mount themselves.Signature: (target: string | HTMLElement) => voiddestroy
Removes the element and releases its frame and subscriptions. You can call it more than once. React removes the element automatically.Signature: () => voidupdate
Merges new props into the mounted element. In React, change the component props instead.Signature: (options: Partial<ActivityElementProps>) => voidStyling
Style these parts throughappearance.classes. Use camel case or kebab case for property names and include units. Page stylesheets can’t reach the element’s frame. The framework validates each declaration before injecting it.appearance to <Wallet>. Set it globally with WhopElements({ appearance }).
