Reward: {
    Root: (__namedParameters: RewardRootProps) => Element;
    Amount: (__namedParameters: RewardAmountProps) => Element;
    USD: (__namedParameters: RewardUSDProps) => Element;
    Image: (
        props: Omit<HTMLAttributes<HTMLImageElement>, "src"> & {
            fallback?: ReactNode;
        },
    ) => Element;
} = ...

Compound component for displaying reward information. Provides a namespace for all reward-related components.

Type declaration

  • Root: (__namedParameters: RewardRootProps) => Element

    Component that displays the reward amount with optional formatting. Must be used within a Reward.Root component.

    Whether to show abbreviated numbers (default: true)

    Whether to show the token symbol (default: true)

    Content to show when reward data is not available

    Optional render function with incentive data

    <Reward.Root id="11155111:0x...:1">
    // With render prop
    <Reward.Amount
    abbreviated={true}
    withSymbol={true}
    fallback="No reward available"
    >
    {(incentive) => <div>{incentive.rewardAmount}</div>}
    </Reward.Amount>
    // With standard display
    <Reward.Amount
    abbreviated={true}
    withSymbol={true}
    fallback="No reward available"
    /> // 9.62K SOL
    </Reward.Root>
  • Amount: (__namedParameters: RewardAmountProps) => Element

    Component that displays the reward amount with optional formatting. Must be used within a Reward.Root component.

    Whether to show abbreviated numbers (default: true)

    Whether to show the token symbol (default: true)

    Content to show when reward data is not available

    Optional render function with incentive data

    <Reward.Root id="11155111:0x...:1">
    // With render prop
    <Reward.Amount
    abbreviated={true}
    withSymbol={true}
    fallback="No reward available"
    >
    {(incentive) => <div>{incentive.rewardAmount}</div>}
    </Reward.Amount>
    // With standard display
    <Reward.Amount
    abbreviated={true}
    withSymbol={true}
    fallback="No reward available"
    /> // 9.62K SOL
    </Reward.Root>
  • USD: (__namedParameters: RewardUSDProps) => Element

    Component that displays the USD value of the reward. Must be used within a Reward.Root component.

    // Whether to show abbreviated numbers (default: true). An abbreviated number would be the dollar amount rounded to 2 decimal places. If false, decimals are not rounded to 2 places.

    Whether to show the USD symbol (default: true)

    Content to show when reward data is not available

    Optional render function with USD value

    <Reward.Root id="boost-123">
    <Reward.USD
    abbreviated={true}
    withSymbol={true}
    fallback="USD value not available"
    />
    </Reward.Root>
  • Image: (
        props: Omit<HTMLAttributes<HTMLImageElement>, "src"> & {
            fallback?: ReactNode;
        },
    ) => Element

    Component that displays the reward token's image. Must be used within a Reward.Root component.

    Content to show when image is not available

    Additional HTML img element props

    <Reward.Root id="boost-123">
    <Reward.Image
    className="token-image"
    alt="Token"
    fallback={<div>No image</div>}
    />
    </Reward.Root>
<Reward.Root id="11155111:0x:1">
<div>
<Reward.Image className="token-image" />
<Reward.Amount withSymbol />
<Reward.USD abbreviated />
</div>
</Reward.Root>