Amount
Formatted token amounts with signs and emphasis variants.
Sizes
Signs
Constrained
Usage
import type { Hex } from 'ox'
import { Amount } from 'regen-ui'
const amount: Amount.Amount = {
amount: '0x6f05b59d3b20000' as Hex.Hex,
decimals: 18,
formatted: '50.00',
symbol: 'PathUSD',
}
export function FeeAmount() {
return <Amount amount={amount} size="md" />
}API Reference
Amount.Props
| Name | Type | Default | Description |
|---|---|---|---|
align | 'center' | 'left' | 'right' | 'left' | Horizontal alignment of the value. |
amount | Amount | None | Amount object — fiat/crypto formatting is derived automatically. |
className | string | None | Additional class names. |
maxDecimals | number | None | Maximum fractional digits to show. |
precise | boolean | None | Whether to show nonzero sub-cent fiat values with significant digits. |
sign | string | '' | Prefix character displayed before formatted values (e.g. `"−"` or `"+"`). |
size | 'lg' | 'md' | 'sm' | 'sm' | Size variant. |
strikethrough | boolean | None | Whether to strike through the values (e.g. sponsored fees). Also applies `text-foreground-secondary`. |
alignType
'center' | 'left' | 'right'Default
Horizontal alignment of the value.'left'amountType
AmountDefaultNone
Amount object — fiat/crypto formatting is derived automatically.classNameType
stringDefaultNone
Additional class names.maxDecimalsType
numberDefaultNone
Maximum fractional digits to show.preciseType
booleanDefaultNone
Whether to show nonzero sub-cent fiat values with significant digits.signType
stringDefault
Prefix character displayed before formatted values (e.g. `"−"` or `"+"`).''sizeType
'lg' | 'md' | 'sm'Default
Size variant.'sm'strikethroughType
booleanDefaultNone
Whether to strike through the values (e.g. sponsored fees). Also applies `text-foreground-secondary`.Amount.Amount
| Name | Type | Default | Description |
|---|---|---|---|
decimals | number | None | Token decimals used to format the raw hex amount. |
formatted | string | None | Human-readable token amount. |
symbol | string | None | Token symbol used for fiat or crypto display. |
amount | `0x${string}` | None | Raw token amount as a hex quantity. |
value | `0x${string}` | None | Raw token amount as a hex quantity. |
decimalsType
numberDefaultNone
Token decimals used to format the raw hex amount.formattedType
stringDefaultNone
Human-readable token amount.symbolType
stringDefaultNone
Token symbol used for fiat or crypto display.amountType
`0x${string}`DefaultNone
Raw token amount as a hex quantity.valueType
`0x${string}`DefaultNone
Raw token amount as a hex quantity.