Interface: NumberUnitDisplayProps<F>
Component props for NumberUnitDisplay.
Type parameters
Name | Type |
---|---|
F | extends string |
Hierarchy
AbstractNumberUnitDisplayProps
<F
>↳
NumberUnitDisplayProps
Properties
children
• Optional
children: DisplayChildren
[]
The children of the display component.
Inherited from
AbstractNumberUnitDisplayProps.children
Defined in
src/sdk/components/FSComponent.ts:122
class
• Optional
class: string
| ToggleableClassNameRecord
| SubscribableSet
<string
>
CSS class(es) to add to the root of the icon component.
Defined in
src/garminsdk/components/common/NumberUnitDisplay.tsx:27
displayUnit
• displayUnit: null
| Unit
<F
> | Subscribable
<null
| Unit
<F
>>
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
Defined in
src/sdk/components/common/AbstractNumberUnitDisplay.tsx:18
formatter
• formatter: (number
: number
) => string
A function which formats numbers.
Type declaration
▸ (number
): string
A function which formats numbers.
Parameters
Name | Type |
---|---|
number | number |
Returns
string
Defined in
src/garminsdk/components/common/NumberUnitDisplay.tsx:13
hideUnitWhenNaN
• Optional
hideUnitWhenNaN: boolean
Whether to hide the unit text when the displayed value is equal to NaN
. Defaults to false
.
Defined in
src/garminsdk/components/common/NumberUnitDisplay.tsx:24
ref
• Optional
ref: NodeReference
<any
>
A reference to the display component.
Inherited from
AbstractNumberUnitDisplayProps.ref
Defined in
src/sdk/components/FSComponent.ts:125
unitFormatter
• Optional
unitFormatter: (out
: [string
, string
], unit
: Unit
<F
>, number
: number
) => void
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.
Type declaration
▸ (out
, unit
, number
): void
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
Name | Type |
---|---|
out | [string , string ] |
unit | Unit <F > |
number | number |
Returns
void
Defined in
src/garminsdk/components/common/NumberUnitDisplay.tsx:21
value
• value: NumberUnitInterface
<F
, Unit
<F
>> | Subscribable
<NumberUnitInterface
<F
, Unit
<F
>>>
The NumberUnitInterface value to display, or a subscribable which provides it.
Inherited from
AbstractNumberUnitDisplayProps.value
Defined in
src/sdk/components/common/AbstractNumberUnitDisplay.tsx:12