Skip to main content

Appearance

Beta

This page documents Bugsee React Native SDK 7.x, which is in beta and can change between betas. The stable release is 6.x: see the 6.x documentation. Upgrading? See Migrating from 6.x to 7.x.

Bugsee.appearance sets the colors of the bug report dialog, so that it matches your app. It is one surface for both platforms: each property sets one color of the report dialog, on Android, on iOS, or on both.

The colors of the feedback chat are set on the feedback package's own appearance; see Feedback.

Setting colors​

Assign a hex color string to a property:

import { Platform } from 'react-native';
import Bugsee from '@bugsee/react-native';

Bugsee.appearance.backgroundColor = '#101828';
Bugsee.appearance.textColor = '#ffffff';
Bugsee.appearance.versionColor = '#98a2b3';

if (Platform.OS === 'android') {
Bugsee.appearance.actionBarColor = '#1d2939';
Bugsee.appearance.actionBarTextColor = '#ffffff';
} else {
Bugsee.appearance.navigationBarColor = '#1d2939';
Bugsee.appearance.cellBackgroundColor = '#1d2939';
}
  • Colors are CSS hex strings: #RGB, #RGBA, #RRGGBB or #RRGGBBAA, with alpha last. The # is optional, and #RRGGBB is opaque.
  • The color is applied during the assignment, synchronously.
  • Set the colors in your startup code, before a report dialog can open. You can set them before or after Bugsee.launch. Colors are kept in memory only, on both platforms, so set them at every app start.

Color properties​

Each property exists on Android, on iOS, or on both:

PropertyAndroidiOS
backgroundColorReportAppearance.BackgroundColor: the dialog's background.reportBackgroundColor
textColorReportAppearance.TextColor: text and input text.reportTextColor: label text.
versionColorReportAppearance.VersionColor: the version label.reportVersionColor: the version label.
actionBarColorReportAppearance.ActionBarColor: the action bar's background.
actionBarTextColorReportAppearance.ActionBarTextColor: the action bar's button text.
actionBarButtonBackgroundClickedColorReportAppearance.ActionBarButtonBackgroundClickedColor: an action bar button's background while pressed.
editTextBackgroundColorReportAppearance.EditTextBackgroundColor: the input fields' background.
hintColorReportAppearance.HintColor: the input fields' hint text.
severityLabelActiveColorReportAppearance.SeverityLabelActiveColor: the selected severity label.
cellBackgroundColorreportCellBackgroundColor: the background of the table cells.
navigationBarColorreportNavigationBarColor
placeholderColorreportPlaceholderColor: the input fields' placeholder text.
sendButtonColorreportSendButtonColor. Not applied in iOS SDK 7.0.0-beta7, whose report screen uses the system Done button.
closeButtonColorreportCloseButtonColor. Not applied in iOS SDK 7.0.0-beta7, whose report screen uses the system Cancel button.

Check Platform.OS before setting a property that exists on one platform only: setting it on the other throws.

The report dialog has more appearance settings than these colors. The field placeholder texts (ReportAppearance.SummaryPlaceholder and the others on Android, reportSummaryPlaceholder and the others on iOS), the title of the Android notification, and the iOS theme style are not available from JavaScript in this beta.

Reading colors​

Reading a property returns the color in effect, as a lowercase #rrggbbaa string, alpha last:

import Bugsee from '@bugsee/react-native';

const background = Bugsee.appearance.backgroundColor; // for example '#101828ff', or undefined
PlatformA color you have not set
Androidundefined: only the colors you set are stored.
iOSThe iOS theme's default for that color.

Reading a property that does not exist on the running platform returns undefined.

Errors​

An assignment that is rejected throws, and changes nothing:

AssignmentThrown
A value that is not a stringTypeError
A string that is not a hex colorRangeError
A property that does not exist on the running platformRangeError
A name that is not one of the properties above (a typo, for example)RangeError
A color that could not be appliedError (… was not applied)

Error messages name the property, never the value you assigned.

Found an issue, typo, or wrong statement on this page? Report it now →