Skip to main content

Interface: NavDataNumberUnitFieldProps<T>

Component props for NavDataNumberUnitField.

Type parameters

NameType
Textends NumberUnitInterface<string>

Hierarchy

Properties

children

Optional children: DisplayChildren[]

The children of the display component.

Inherited from

NavDataFieldProps.children

Defined in

src/sdk/components/FSComponent.ts:122


class

Optional class: string

CSS class(es) to apply to the root of the component.

Inherited from

NavDataFieldProps.class

Defined in

src/garminsdk/components/navdatafield/NavDataField.tsx:22


displayUnit

displayUnit: null | Unit<FamilyOfUnit<UnitOfNumber<T>>> | Subscribable<null | Unit<FamilyOfUnit<UnitOfNumber<T>>>>

A subscribable which provides the display unit type.

Defined in

src/garminsdk/components/navdatafield/NavDataField.tsx:89


formatter

formatter: (number: number) => string

A function which formats numbers.

Type declaration

▸ (number): string

A function which formats numbers.

Parameters
NameType
numbernumber
Returns

string

Defined in

src/garminsdk/components/navdatafield/NavDataField.tsx:92


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/navdatafield/NavDataField.tsx:103


model

model: NavDataFieldModel<T>

The model data field's data model.

Inherited from

NavDataFieldProps.model

Defined in

src/garminsdk/components/navdatafield/NavDataField.tsx:19


ref

Optional ref: NodeReference<any>

A reference to the display component.

Inherited from

NavDataFieldProps.ref

Defined in

src/sdk/components/FSComponent.ts:125


title

title: string

The title of the data field.

Inherited from

NavDataFieldProps.title

Defined in

src/garminsdk/components/navdatafield/NavDataField.tsx:16


unitFormatter

Optional unitFormatter: (out: [string, string], unit: Unit<FamilyOfUnit<UnitOfNumber<T>>>, 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
NameType
out[string, string]
unitUnit<FamilyOfUnit<UnitOfNumber<T>>>
numbernumber
Returns

void

Defined in

src/garminsdk/components/navdatafield/NavDataField.tsx:100