Skip to main content

Interface: NumberUnitDisplayProps<F>

Defined in: workingtitle-instruments-epic2/shared/Components/NumberDisplays/NumberUnitDisplay.tsx:10

Component props for NumberUnitDisplay.

Extends​

  • AbstractNumberUnitDisplayProps<F>

Type Parameters​

Type Parameter
F extends string

Properties​

children?​

optional children: DisplayChildren[]

Defined in: sdk/components/FSComponent.ts:122

The children of the display component.

Inherited from​

AbstractNumberUnitDisplayProps.children


class?​

optional class: string | ToggleableClassNameRecord | SubscribableSet<string>

Defined in: workingtitle-instruments-epic2/shared/Components/NumberDisplays/NumberUnitDisplay.tsx:26

CSS class(es) to add to the root of the icon component.


displayUnit​

displayUnit: null | Unit<F> | Subscribable<null | Unit<F>>

Defined in: sdk/components/common/AbstractNumberUnitDisplay.tsx:18

The unit type in which to display the value, or a subscribable which provides it. If the unit is null, then the native type of the value is used instead.

Inherited from​

AbstractNumberUnitDisplayProps.displayUnit


formatter()​

formatter: (number) => string

Defined in: workingtitle-instruments-epic2/shared/Components/NumberDisplays/NumberUnitDisplay.tsx:12

A function which formats numbers.

Parameters​

ParameterType
numbernumber

Returns​

string


hideUnitWhenNaN?​

optional hideUnitWhenNaN: boolean

Defined in: workingtitle-instruments-epic2/shared/Components/NumberDisplays/NumberUnitDisplay.tsx:23

Whether to hide the unit text when the displayed value is equal to NaN. Defaults to false.


ref?​

optional ref: NodeReference<any>

Defined in: sdk/components/FSComponent.ts:125

A reference to the display component.

Inherited from​

AbstractNumberUnitDisplayProps.ref


unitFormatter()?​

optional unitFormatter: (out, unit, number) => void

Defined in: workingtitle-instruments-epic2/shared/Components/NumberDisplays/NumberUnitDisplay.tsx:20

A function which formats units. The formatted unit text should be written to the 2-tuple passed to the out parameter, as [bigText, smallText]. bigText and smallText will be rendered into separate <span> elements representing the big and small components of the rendered unit text, respectively. If not defined, then units will be formatted based on the text generated by the UnitFormatter class.

Parameters​

ParameterType
out[string, string]
unitUnit<F>
numbernumber

Returns​

void


value​

value: NumberUnitInterface<F, Unit<F>> | Subscribable<NumberUnitInterface<F, Unit<F>>>

Defined in: sdk/components/common/AbstractNumberUnitDisplay.tsx:12

The NumberUnitInterface value to display, or a subscribable which provides it.

Inherited from​

AbstractNumberUnitDisplayProps.value