The Tyro React Native component can be customized during the initialization of the <TyroProvider /> to match the look and feel of your site, by using the theme and styleProps configuration properties.
Themes
Fast track your integrations appearance by selecting one of our provided themes.
Styles
To fine-tune individual properties of the visualization, you can use style properties. Style properties will override theme properties.
When using styleProps the following property rules apply, any property that is irregular will be ignored.
Any colors, such as background or text, require a Hex color code e.g. "#FFF" or "#FFFFFFF"
Sizes such as font, border and size, require a numeric representation but can be supplied as a string e.g. "10" or 10
Padding and margins currently only support numeric representation e.g. "10" or 10
Font weights are per hundred similar to HTML markup specifications e.g. "400", "800" or 800
Visual Style Guide
Implementation
Copy
Copied
// example javascript code for using styleProps in the TyroProvider componentimport{ TyroProvider }from"@tyro/tyro-pay-api-react-native";const theme ='default';const styleProps ={bodyBackgroundColor:'#f2f2f2',bodyPadding:10,inputFontSize:16,showSupportedCards:false}functionApp(){return(<TyroProvider
options={liveMode:false,theme: theme,styleProps: styleProps}>// Your App Checkout Code wrapped here</TyroProvider>);}
Config Parameters
theme
string
An optional string to load a set of preset styleProps. Defaults to default.
Enum:"default""dark""sharp""minimal"
object
An optional object containing properties for customizing the appearance of the widget.
object
buttonBorderRadius
string
Border radius of the Apple Pay button.
buttonStyle
string
Style of the Apple Pay button. Defaults to black.
Enum:"black""white""white-outline"
buttonType
string
Type of the Apple Pay button. Setting this property will add text to the Apple Pay button based on the type chosen. Defaults to plain.