Revenue Share Table

How a payout splits between parties. The unallocated remainder gets a named row instead of leaving the reader to subtract, and a split exceeding 100% is called out rather than quietly rendered.

src/components/ui/revenue-share-table.tsx

About

From the component's own source, where it was written.

How a payout splits between parties.

The rows are shares of a gross figure, so the table adds them up and shows the remainder as a named row rather than leaving the reader to subtract. A split that does not reach 100% is the normal case — the house keeps the rest — and a split that exceeds it is a configuration error worth seeing immediately.

Each party's amount is computed from the gross rather than passed in, because a percentage beside an amount that contradicts it is worse than either alone.

Install

npx astralyx-ui add revenue-share-table

Usage

import { RevenueShareTable } from '@/components/ui/revenue-share-table'

<RevenueShareTable rows={rows} gross={48210} currency="USD" />

Composer

Change the props and the source below follows.

PartyShareAmount
Publisher — nightjar.mediaTier 2 rate35%US$16,873.50
Sub-affiliate10%US$4,821.00
Network fee5%US$2,410.50
Retained50.0%US$24,105.00
Gross100%US$48,210.00
Props
tsx
<RevenueShareTable rows={rows} gross={48210} />

API

Generated from the source, so it cannot fall behind the code. One table per exported component, then hooks, functions and types.

RevenueShareTable

How a payout splits between parties.

Extends Omit<ComponentProps<'div'>, 'children'>.

PropTypeDefaultDescription
rowsRevenueShareRow[]required{ id, party, share, note? } where share is 0–1.
grossnumberrequiredThe figure being split. Each party's amount is computed from it, so a percentage can never sit beside an amount that contradicts it.
currencystring'USD'—
localestring'en-GB'—
remainderLabelReactNode'Retained'—
partyHeaderReactNode'Party'—
shareHeaderReactNode'Share'—
amountHeaderReactNode'Amount'—
grossLabelReactNode'Gross'Label on the total row.
overAllocatedLabelReactNode'Over-allocated'Replaces remainderLabel when the shares exceed 100%.

Types

RevenueShareRow

FieldTypeDescription
idstring—
partyReactNode—
sharenumberShare of gross, 0–1.
note?ReactNode—

Behaviour

TopicDetailDescription
remaindernamed rowWhat is left over gets a row of its own. A split reaching only 90% is normal — the house keeps the rest — and it should be visible.
over-allocationflaggedShares totalling more than 100% render as an "Over-allocated" row in the destructive tone. That is a configuration error, not a display problem.