Skip to main content
This page documents @whop/elements@1.0.0-beta.3 and @whop/elements-react@1.0.0-beta.3.
Pre-release, not yet part of a stable release.
Mounts inside Wallet. Create it to get a handle, then mount its elements on that handle. Call destroy() to remove the sub-controller. Create it again to get a fresh handle.

Preview

A live, interactive demo of this sub-controller’s default arrangement with example data:
Mounts anywhere in your view hierarchy. BalanceElement and ListElement are independent, so use one alone or both on one screen. Each takes an accountId and loads its own data.

Preview

Running on an iPhone, in the example app:

Options

Pass these to wallet.create('balances', { … }), or as props on <Balances> in React. Parent-injected props never appear here.
string
A scoped token for balance breakdown and settlement reads. An account needs company:balance:read. Omitted, the viewer’s same-origin session is used.
boolean
Show this unit’s holding balance page in place of the chart and list when a row is clicked. Off by default so a host that routes on balanceSelected is not covered by a second screen. Defaults to false.

Methods

Call these on the sub handle from wallet.create('balances', { … }).

update

Merges new props and callbacks into the sub-controller.Signature: (options: Partial<BalancesSubOptions>) => void

destroy

Destroys the sub-controller and its elements, then frees its exclusive slot. A later create("balances") starts fresh.Signature: () => void

Parameters

String
required
The account whose money the view reads. Use an account ID prefixed biz_. A user ID prefixed user_ reads the viewer’s own balance and needs viewer authentication (WhopSDK.configureWithOAuth), not an account token.

States

Each view manages its own states, so neither blocks the other from rendering.

Good to know

Call WhopSDK.configure(tokenProvider:) once at launch. Views wait for the token. See Getting started. Apply a theme with .whopTheme(_:).

Elements

The elements this sub-controller mounts. Each has its own page:

BalanceElement

An account’s balance and a chart of how it changed. The total and its change sit at the top, the chart below that, and the time range buttons at the bottom. The viewer can read individual points on the chart and switch the time range themselves.

BreakdownElement

One currency’s total split into available, pending, reserve, and negative balances. Zero-value rows disappear, and the surface deliberately contains no money-movement buttons so the host owns those actions.

SettlementElement

The account balance details shown by Whop’s dashboard: available funds, pending settlement dates, reserve terms, and any negative balance. It opens as a 550px modal and uses the balances handle’s account, currency, and credential.

ListElement

The holdings behind an account’s balance. Every currency and token gets its own row, showing its name and its value in dollars, largest first. Rows can report which one the viewer tapped, so you can open your own screen for it. When openHoldingOnSelect is on, a row click shows that holding’s balance page in place of this unit’s chart and list.