TypeScript API
Listtemplateconfig

Interface: ListTemplateConfig

Hierarchy

Table of contents

Properties

Methods

Properties

actions

Optional actions: [Action<"custom">] | [Action<"custom">, Action<"custom">]

Sets the ActionStrip for this template or null to not display an . This template allows up to 2 Actions. Of the 2 allowed Actions, one of them can contain a title as set via setTitle. Otherwise, only Actions with icons are allowed.

Defined in

packages/react-native-carplay/src/templates/ListTemplate.ts:105 (opens in a new tab)


assistant

Optional assistant: Object

Assistant Configuration

See

https://developer.apple.com/documentation/carplay/cplisttemplate#3762508 (opens in a new tab) iOS

Type declaration

NameType
action"playMedia" | "startCall"
enabledboolean
position"top" | "bottom"
visibility"off" | "always" | "limited"

Defined in

packages/react-native-carplay/src/templates/ListTemplate.ts:83 (opens in a new tab)


backButtonHidden

Optional backButtonHidden: boolean

Option to hide back button

Default

false

Defined in

packages/react-native-carplay/src/templates/ListTemplate.ts:76 (opens in a new tab)


emptyViewSubtitleVariants

Optional emptyViewSubtitleVariants: string[]

An optional array of strings, ordered from most to least preferred. The variant strings should be provided as localized, displayable content. The system will select the first variant that fits the available space. If the list template does not contain any items (itemCount == 0), then the template will display an empty view with a title and subtitle to indicate that the template has no list items. If the list template is updated to contain items, the empty view will be automatically removed. iOS

Defined in

packages/react-native-carplay/src/templates/ListTemplate.ts:46 (opens in a new tab)


emptyViewTitleVariants

Optional emptyViewTitleVariants: string[]

An optional array of strings, ordered from most to least preferred. The variant strings should be provided as localized, displayable content. The system will select the first variant that fits the available space. If the list template does not contain any items (itemCount == 0), then the template will display an empty view with a title and subtitle to indicate that the template has no list items. If the list template is updated to contain items, the empty view will be automatically removed. iOS

Defined in

packages/react-native-carplay/src/templates/ListTemplate.ts:34 (opens in a new tab)


headerAction

Optional headerAction: Action<"appIcon" | "back">

Sets the Action that will be displayed in the header of the template. Android

Defined in

packages/react-native-carplay/src/templates/ListTemplate.ts:100 (opens in a new tab)


id

Optional id: string

Give the template your own ID. Must be unique.

Inherited from

TemplateConfig.id

Defined in

packages/react-native-carplay/src/templates/Template.ts:23 (opens in a new tab)


items

Optional items: ListItem[]

Sets a single ItemList to show in the template. Android

Defined in

packages/react-native-carplay/src/templates/ListTemplate.ts:22 (opens in a new tab)


leadingNavigationBarButtons

Optional leadingNavigationBarButtons: BarButton[]

An array of bar buttons to display on the leading side of the navigation bar.

The navigation bar displays up to two buttons in the leading space. When including more than two buttons in the array, the system displays only the first two buttons. iOS

Inherited from

TemplateConfig.leadingNavigationBarButtons

Defined in

packages/react-native-carplay/src/templates/Template.ts:30 (opens in a new tab)


loading

Optional loading: boolean

Sets whether the template is in a loading state. If set to true, the UI will display a loading indicator where the list content would be otherwise. The caller is expected to call invalidate and send the new template content to the host once the data is ready. If set to false, the UI will display the contents of the ItemList instance(s) added via setSingleList or addSectionedList. Android

Defined in

packages/react-native-carplay/src/templates/ListTemplate.ts:95 (opens in a new tab)


sections

Optional sections: ListSection[]

The sections displayed in the list.

Defined in

packages/react-native-carplay/src/templates/ListTemplate.ts:17 (opens in a new tab)


tabImage

Optional tabImage: ImageSourcePropType

Image source for tab

Inherited from

TemplateConfig.tabImage

Defined in

packages/react-native-carplay/src/templates/Template.ts:49 (opens in a new tab)


tabSystemImageName

Optional tabSystemImageName: string

Name of system image for tab

Inherited from

TemplateConfig.tabSystemImageName

Defined in

packages/react-native-carplay/src/templates/Template.ts:45 (opens in a new tab)


tabSystemItem

Optional tabSystemItem: number

UITabBarSystemItem

Inherited from

TemplateConfig.tabSystemItem

Defined in

packages/react-native-carplay/src/templates/Template.ts:41 (opens in a new tab)


tabTitle

Optional tabTitle: string

Set tab title

Inherited from

TemplateConfig.tabTitle

Defined in

packages/react-native-carplay/src/templates/Template.ts:53 (opens in a new tab)


title

Optional title: string

The title displayed in the navigation bar while the list template is visible.

Defined in

packages/react-native-carplay/src/templates/ListTemplate.ts:13 (opens in a new tab)


trailingNavigationBarButtons

Optional trailingNavigationBarButtons: BarButton[]

An array of bar buttons to display on the trailing side of the navigation bar.

The navigation bar displays up to two buttons in the trailing space. When including more than two buttons in the array, the system displays only the first two buttons. iOS

Inherited from

TemplateConfig.trailingNavigationBarButtons

Defined in

packages/react-native-carplay/src/templates/Template.ts:37 (opens in a new tab)

Methods

onBackButtonPressed

onBackButtonPressed(): void

Fired when the back button is pressed

Returns

void

Defined in

packages/react-native-carplay/src/templates/ListTemplate.ts:70 (opens in a new tab)


onBarButtonPressed

onBarButtonPressed(e): void

Fired when bar button is pressed

Parameters

NameTypeDescription
eBarButtonEventEvent

Returns

void

Inherited from

TemplateConfig.onBarButtonPressed

Defined in

packages/react-native-carplay/src/templates/Template.ts:79 (opens in a new tab)


onDidAppear

onDidAppear(e): void

Fired after template appears

Parameters

NameTypeDescription
eBaseEventEvent

Returns

void

Inherited from

TemplateConfig.onDidAppear

Defined in

packages/react-native-carplay/src/templates/Template.ts:68 (opens in a new tab)


onDidDisappear

onDidDisappear(e): void

Fired after template disappears

Parameters

NameTypeDescription
eBaseEventEvent

Returns

void

Inherited from

TemplateConfig.onDidDisappear

Defined in

packages/react-native-carplay/src/templates/Template.ts:73 (opens in a new tab)


onImageRowItemSelect

onImageRowItemSelect(item): Promise<void>

Fired when image row item is selected. Spinner shows by default. When the returned promise is resolved the spinner will hide.

Parameters

NameTypeDescription
itemObjectObject with the selected index
item.imageIndexnumber-
item.indexnumber-
item.templateIdstring-

Returns

Promise<void>

Defined in

packages/react-native-carplay/src/templates/ListTemplate.ts:61 (opens in a new tab)


onItemSelect

onItemSelect(item): Promise<void>

Fired when list item is selected. Spinner shows by default. When the returned promise is resolved the spinner will hide.

Parameters

NameTypeDescription
itemObjectObject with the selected index
item.indexnumber-
item.templateIdstring-

Returns

Promise<void>

Defined in

packages/react-native-carplay/src/templates/ListTemplate.ts:53 (opens in a new tab)


onWillAppear

onWillAppear(e): void

Fired before template appears

Parameters

NameTypeDescription
eBaseEventEvent

Returns

void

Inherited from

TemplateConfig.onWillAppear

Defined in

packages/react-native-carplay/src/templates/Template.ts:58 (opens in a new tab)


onWillDisappear

onWillDisappear(e): void

Fired before template disappears

Parameters

NameTypeDescription
eBaseEventEvent

Returns

void

Inherited from

TemplateConfig.onWillDisappear

Defined in

packages/react-native-carplay/src/templates/Template.ts:63 (opens in a new tab)