Skip to content

RN: Adds feedback widget theme documentation #13513

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: antonis/rn-feedback-button
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions docs/platforms/react-native/user-feedback/configuration/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -238,3 +238,42 @@ Sentry.feedbackIntegration({
onAddScreenshot={handleChooseImage}
});
```

## Theming

You can also customize the Feedback Widget colors to match your app's theme. The example below shows how to customize the widget backgroung and foreground for the light and dark system themes with the `feedbackIntegration`.

```javascript
import * as Sentry from "@sentry/react-native";

Sentry.feedbackIntegration({
colorScheme: 'system',
themeLight: {
foreground: '#ff0000',
background: '#00ff00',
},
themeDark: {
foreground: '#00ff00',
background: '#ff0000',
},
}),
```

The available theme options are:

| Key | Type | Default | Description |
| ------------- | ----------------------------| ---------- | -------------------------------------------------------- |
| `colorScheme` | `"system", "light", "dark"` | `"system"` | The color theme. "system" will use your OS color scheme. |
| `themeLight` | Feedback Widget Theme | - | The light color scheme. |
| `themeDark` | Feedback Widget Theme | - | The dark color scheme. |

For each theme you can set the following colors:

| Key | Description |
| ------------------ | ----------------------------------------|
| `background` | Background color for surfaces. |
| `foreground` | Foreground color (i.e. text color). |
| `accentForeground` | Foreground color for accented elements. |
| `accentBackground` | Background color for accented elements. |
| `border` | Border color. |
| `feedbackIcon` | Color for feedback icon. |