Skip to content
Domain-Specific

CurrencyDisplay

client48 kB
@stellaria/nebula-webCurrencyDisplayProps

Preview

Props

19
PropTypeDefault

amount

string | number | null

—

className

string

—

colorBySign

booleanfalse

compact

booleanfalse

component

The element it paints. A paragraph by default, so use `component="span"` for text that lives inside a sentence — a `<p>` nested in a `<p>` is invalid markup the browser silently splits.

ElementType"p"

currency

string"USD"

decimals

number

—

fallback

ReactNode"—"

hideSymbol

booleanfalse

inherit

Takes family, size, weight and line height from the parent instead of the `Text` defaults. For text that must sit inside a heading or a button without breaking its type.

boolean

—

lines

Clamps the text to this many lines with an ellipsis. Beats `truncate`, and only applies above zero. Needs a width to work against: inside a flex child, that usually means `miw={0}`.

number

—

loading

booleanfalse

locale

string

—

prefix

ReactNode

—

reveal

Animates the element in when it first scrolls into view. `true` takes the catalogue entrance; an object tunes it — `preset`, `distance`, `spring`, `duration`, `once`, `amount`, `rootMargin` and `index` for a stagger. It lives here rather than on each surface so that `Card`, `Paper`, `GradientBorder`, `Section` and anything else built on `Box` inherit one implementation. Without it `Box` stays a server component; with it the root swaps for a client shell and the children keep rendering on the server. The entrance is a CSS transition, not a JavaScript animation: it is the only motion in the catalogue that fires WHILE the user scrolls, and the compositor should own it.

boolean | UseRevealOptions

—

sign

CurrencySign"auto"

suffix

ReactNode

—

transform

((formatted: string) => string)

—

truncate

Cuts the text to a single line with an ellipsis. Ignored when `lines` is set, which does the same thing over several lines. The full text stays in the DOM, so it is still read aloud.

boolean

—

Also accepts

On top of its own props, this component forwards these groups.

Style props · 128