Ancillaries component customisation in React Native

About

This guide will show you how to customise the Ancillaries Component in React Native.

Prerequisites

Customising the Ancillaries Component

Code example

Here's an example of how you can customise the Ancillaries Component in React Native using the theme prop:

React

<DuffelAncillaries
...
theme={{
primaryTextColor: '#FBFBFB',
secondaryTextColor: '#A4A6A8',
borderColor: '#2D2F30',
modalBackgroundColor: '#131416',
cardBackgroundColor: '#2D2F30',
tooltipBackgroundColor: '#2D2F30',
primaryButtonTextColor: 'black',
primaryButtonBackgroundColor: 'lightblue',
secondaryButtonTextColor: '#ccc',
secondaryButtonBackgroundColor: '#111',
secondaryButtonBorderColor: '#ccc',
disabledSecondaryButtonTextColor: '#cccccc55',
disabledSecondaryButtonBackgroundColor: '#11111155',
disabledSecondaryButtonBorderColor: '#cccccc55',
positiveCalloutTextColor: '#106331',
positiveCalloutBackgroundColor: '#bde0af',
}}
/>

Visual guide

The following diagrams illustrate how each of the theme controls map into the component UI:
Diagram of cards

API reference

Prop nameTypeDefault
primaryTextColorstring#1d1d1d
secondaryTextColorstring#bbbbbb
borderColorstring#cccccc
cardBackgroundColorstringwhite
modalBackgroundColorstringwhite
tooltipBackgroundColorstringwhite
primaryButtonTextColorstringwhite
primaryButtonBackgroundColorstring#1d1d1d
secondaryButtonTextColorstring#666
secondaryButtonBackgroundColorstring#eee
secondaryButtonBorderColorstring#ddd
disabledSecondaryButtonTextColorstring#ccc
disabledSecondaryButtonBackgroundColorstring#efefef
disabledSecondaryButtonBorderColorstring#eee
positiveCalloutTextColorstring#106331
positiveCalloutBackgroundColorstring#bde0af