Skip to content

Commit fa6fba0

Browse files
antonisclaude
andauthored
Update React Native feedback docs: FeedbackWidget → FeedbackForm (#17190)
## DESCRIBE YOUR PR Fixes getsentry/sentry-react-native#5894 Rename all `FeedbackWidget` → `FeedbackForm` and `showFeedbackWidget` → `showFeedbackForm` references in the React Native user feedback documentation. Updated pages: - `docs/platforms/react-native/user-feedback/index.mdx` - `docs/platforms/react-native/user-feedback/configuration/index.mdx` Image filenames left unchanged (only alt text updated). Follows SDK rename in getsentry/sentry-react-native#5931. > **Note:** The old `FeedbackWidget` / `showFeedbackWidget` APIs remain as deprecated aliases in the SDK, so existing user code is not broken. ## IS YOUR CHANGE URGENT? - [ ] Urgent deadline (GA date, etc.): - [ ] Other deadline: - [x] None: Not urgent, can wait up to 1 week+ ⚠️ Should be merged after getsentry/sentry-react-native#5931 is released ## PRE-MERGE CHECKLIST - [ ] Checked Vercel preview for correctness, including links - [ ] PR was reviewed and approved by any necessary SMEs (subject matter experts) - [ ] PR was reviewed and approved by a member of the [Sentry docs team](https://github.com/orgs/getsentry/teams/docs) --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 8769c50 commit fa6fba0

File tree

2 files changed

+51
-113
lines changed

2 files changed

+51
-113
lines changed

docs/platforms/react-native/user-feedback/configuration/index.mdx

Lines changed: 36 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,56 @@
11
---
22
title: Configuration
33
sidebar_order: 6100
4-
description: Learn about the User Feedback Widget configuration options.
4+
description: Learn about the User Feedback Form configuration options.
55
og_image: /og-images/platforms-react-native-user-feedback-configuration.png
66
---
77

8-
The User Feedback Widget offers many customization options, and if the available options are insufficient, you can [use your own UI](/platforms/react-native/user-feedback/#user-feedback-api).
8+
The User Feedback Form offers many customization options, and if the available options are insufficient, you can [use your own UI](/platforms/react-native/user-feedback/#user-feedback-api).
99

10-
![An image showing the main customization options for the User Feedback Widget](./img/mobile-user-feedback-widget-customization.png)
11-
To collect user feedback from inside your application, use the `showFeedbackButton`/`hideFeedbackButton` to show/hide a button that triggers the Feedback Widget or the `showFeedbackWidget` method to present the widget directly.
10+
![An image showing the main customization options for the User Feedback Form](./img/mobile-user-feedback-widget-customization.png)
11+
To collect user feedback from inside your application, use the `showFeedbackForm` method to present the form.
1212

13-
```JavaScript {tabTitle:Widget}
13+
```JavaScript
1414
import * as Sentry from "@sentry/react-native";
1515

1616
Sentry.wrap(RootComponent);
1717

18-
Sentry.showFeedbackWidget();
19-
```
20-
21-
```JavaScript {tabTitle:Button}
22-
import * as Sentry from "@sentry/react-native";
23-
24-
Sentry.wrap(RootComponent);
25-
26-
Sentry.showFeedbackButton();
27-
Sentry.hideFeedbackButton();
18+
Sentry.showFeedbackForm();
2819
```
2920

3021
Note that [the root application component must be wrapped with `Sentry.wrap`](/platforms/react-native/#wrap-your-app) for this to work.
3122

3223
## General
3324

34-
The following options can be configured for the integration in `feedbackIntegration({})` or passed in the `FeedbackWidget` component props:
25+
The following options can be configured for the integration in `feedbackIntegration({})` or passed in the `FeedbackForm` component props:
3526

3627

3728
| Key | Type | Default | Description |
3829
| ---------------------- | ------------------------ | ------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
3930
| `showBranding` | `boolean` | `true` | Displays the Sentry logo. |
40-
| `showName` | `boolean` | `true` | Displays the name field on the feedback widget. |
41-
| `showEmail` | `boolean` | `true` | Displays the email field on the feedback widget. |
42-
| `enableShakeToReport` | `boolean` | `false` | Opens the Feedback Widget when the user shakes the device. |
31+
| `showName` | `boolean` | `true` | Displays the name field on the feedback form. |
32+
| `showEmail` | `boolean` | `true` | Displays the email field on the feedback form. |
33+
| `enableShakeToReport` | `boolean` | `false` | Opens the Feedback Form when the user shakes the device. |
4334
| `enableScreenshot` | `boolean` | `false` | Allows the user to send a screenshot attachment with their feedback. |
4435
| `enableTakeScreenshot` | `boolean` | `false` | Determines whether the "Take Screenshot" button is displayed. |
45-
| `isNameRequired` | `boolean` | `false` | Requires the name field on the feedback widget to be filled in. |
46-
| `isEmailRequired` | `boolean` | `false` | Requires the email field on the feedback widget to be filled in. |
36+
| `isNameRequired` | `boolean` | `false` | Requires the name field on the feedback form to be filled in. |
37+
| `isEmailRequired` | `boolean` | `false` | Requires the email field on the feedback form to be filled in. |
4738
| `shouldValidateEmail` | `boolean` | `true` | If set the email is validated with the following regular expression `"/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/"` |
4839
| `useSentryUser` | `Record<string, string>` | `{ email: 'email', name: 'username'}` | Sets the default values for the `email` and `name` fields. |
4940

5041

5142
## Text Customization
5243

53-
All the text that you see in the Feedback widget can be customized.
44+
All the text that you see in the Feedback Form can be customized.
5445

55-
The following options can be configured for the integration in `feedbackIntegration({})` or passed in the `FeedbackWidget` component props:
46+
The following options can be configured for the integration in `feedbackIntegration({})` or passed in the `FeedbackForm` component props:
5647

5748
| Key | Default | Description |
5849
| ------------------------------ | ------------------------------------------------------- | ------------------------------------------------------------------- |
59-
| `formTitle` | `"Report a Bug"` | The title at the top of the feedback widget. |
60-
| `submitButtonLabel` | `"Send Bug Report"` | The label of the submit button used in the feedback widget. |
61-
| `cancelButtonLabel` | `"Cancel"` | The label of cancel buttons used in the feedback widget. |
62-
| `addScreenshotButtonLabel` | `"Add a screenshot"` | The label of the button to add a screenshot to the widget. |
50+
| `formTitle` | `"Report a Bug"` | The title at the top of the feedback form. |
51+
| `submitButtonLabel` | `"Send Bug Report"` | The label of the submit button used in the feedback form. |
52+
| `cancelButtonLabel` | `"Cancel"` | The label of cancel buttons used in the feedback form. |
53+
| `addScreenshotButtonLabel` | `"Add a screenshot"` | The label of the button to add a screenshot to the form. |
6354
| `removeScreenshotButtonLabel` | `"Remove screenshot"` | The label of the button to remove the screenshot. |
6455
| `captureScreenshotButtonLabel` | `"Take a screenshot"` | The label for the button that triggers the capture screenshot flow. |
6556
| `nameLabel` | `"Name"` | The label of the name input field. |
@@ -87,7 +78,7 @@ feedbackIntegration({
8778

8879
## Style Customization
8980

90-
You can customize placement of the feedback components on the widget, as well as the fonts and colors.
81+
You can customize placement of the feedback components on the form, as well as the fonts and colors.
9182

9283
The example below shows how to customize the submit button background color and border radius with the `feedbackIntegration`.
9384

@@ -103,15 +94,15 @@ Sentry.feedbackIntegration({
10394
},
10495
});
10596

106-
Sentry.showFeedbackWidget();
97+
Sentry.showFeedbackForm();
10798
```
10899

109-
The same can be achieved by passing the `styles` prop to the `FeedbackWidget` component:
100+
The same can be achieved by passing the `styles` prop to the `FeedbackForm` component:
110101

111102
```javascript
112-
import { FeedbackWidget } from "@sentry/react-native";
103+
import { FeedbackForm } from "@sentry/react-native";
113104

114-
<FeedbackWidget
105+
<FeedbackForm
115106
styles={{
116107
submitButton: {
117108
backgroundColor: '#6a1b9a',
@@ -125,7 +116,7 @@ The following styles are available for customisation.
125116

126117
| Style | Type | Description |
127118
| --------------------- | ------------ | ----------------------------------------------- |
128-
| `container` | `ViewStyle` | The widget container style. |
119+
| `container` | `ViewStyle` | The form container style. |
129120
| `title` | `TextStyle` | The title text style. |
130121
| `label` | `TextStyle` | The label text style (name, email). |
131122
| `input` | `TextStyle` | The input field text style (name, email). |
@@ -140,58 +131,17 @@ The following styles are available for customisation.
140131
| `screenshotThumbnail` | `ImageStyle` | The screenshot thumbnail image style. |
141132
| `titleContainer` | `ViewStyle` | The title container style. |
142133

143-
## Feedback Button Customization
144-
145-
You can customize placement of the feedback button, as well as the fonts and colors.
146-
147-
The example below shows how to customize the bottom margin with the `feedbackIntegration`.
148-
149-
```javascript
150-
import * as Sentry from "@sentry/react-native";
151-
152-
Sentry.init({
153-
integrations: [
154-
Sentry.feedbackIntegration({
155-
buttonOptions: {
156-
styles: {
157-
triggerButton: {
158-
marginBottom: 75,
159-
},
160-
},
161-
},
162-
}),
163-
],
164-
});
165-
166-
Sentry.showFeedbackButton();
167-
```
168-
169-
You can customize the button text with the following options.
170-
171-
| Key | Default | Description |
172-
| ------------------ | ---------------- | -------------------------------------------------------------------- |
173-
| `triggerLabel` | `"Report a Bug"` | The label for the Feedback widget button that opens the dialog. |
174-
| `triggerAriaLabel` | - | The aria label for the Feedback widget button that opens the dialog. |
175-
176-
The following styles are available for customisation.
177-
178-
| Style | Type | Description |
179-
| --------------- | ------------ | --------------------------------- |
180-
| `triggerButton` | `ViewStyle` | The feedback widget button style. |
181-
| `triggerText` | `TextStyle` | The feedback widget text style. |
182-
| `triggerIcon` | `ImageStyle` | The feedback widget icon style. |
183-
184134
## Event Callbacks
185135

186-
The following callbacks can be configured for the integration in `feedbackIntegration({})` or passed in the `FeedbackWidget` component props:
136+
The following callbacks can be configured for the integration in `feedbackIntegration({})` or passed in the `FeedbackForm` component props:
187137

188138
| Callback | Parameters | Default behavior | Description |
189139
| ----------------- | ---------------------------------------------------------- | ----------------------- | ------------------------------------------------------------------------------------------------------------- |
190-
| `onFormOpen` | | | Callback when widget is opened. |
191-
| `onFormClose` | | The widget is unmounted.| Callback when widget is closed and not submitted. |
140+
| `onFormOpen` | | | Callback when form is opened. |
141+
| `onFormClose` | | The form is unmounted. | Callback when form is closed and not submitted. |
192142
| `onSubmitSuccess` | `data: FeedbackFormData` | | Callback when feedback is successfully submitted. |
193143
| `onSubmitError` | `error: Error` | | Callback when feedback is unsuccessfully submitted. |
194-
| `onFormSubmitted` | | The widget is unmounted.| Callback when the feedback widget is submitted successfully, and the SuccessMessage is complete, or dismissed.|
144+
| `onFormSubmitted` | | The form is unmounted. | Callback when the feedback form is submitted successfully, and the SuccessMessage is complete, or dismissed. |
195145
| `onAddScreenshot` | `addScreenshot: (uri: string) => void` | | Callback when a screenshot is added. |
196146

197147
## Screenshots
@@ -228,10 +178,10 @@ Sentry.init({
228178
});
229179
```
230180

231-
The `imagePicker` integration is used when launching the feedback widget with the `showFeedbackWidget` or the `FeedbackButton`. In order to use it with a custom `FeedbackWidget` component, you need to pass the `imagePicker` prop to the component as shown below:
181+
The `imagePicker` integration is used when launching the feedback form with `showFeedbackForm`. In order to use it with a custom `FeedbackForm` component, you need to pass the `imagePicker` prop to the component as shown below:
232182

233183
```javascript
234-
<FeedbackWidget
184+
<FeedbackForm
235185
imagePicker={ImagePicker}
236186
/>
237187
```
@@ -262,14 +212,15 @@ Sentry.feedbackIntegration({
262212

263213
### Screenshot Button
264214

265-
You can show a button that allows the user to take a screenshot in the Feedback Widget. The button is shown when `enableTakeScreenshot` is set to `true` in the `feedbackIntegration` method like in the example below.
215+
You can show a button that allows the user to take a screenshot in the Feedback Form. The button is shown when `enableTakeScreenshot` is set to `true` in the `feedbackIntegration` method like in the example below.
266216

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

270220
Sentry.init({
271221
integrations: [
272222
Sentry.feedbackIntegration({
223+
enableTakeScreenshot: true,
273224
screenshotButtonOptions: {
274225
triggerLabel: 'Take Screenshot',
275226
styles: {
@@ -281,11 +232,9 @@ Sentry.init({
281232
}),
282233
],
283234
});
284-
285-
Sentry.showFeedbackButton();
286235
```
287236

288-
You can customize the Feedback Widget screenshot button text with the following options.
237+
You can customize the Feedback Form screenshot button text with the following options.
289238

290239
| Key | Default | Description |
291240
| ------------------ | ------------------- | ----------------------------------------- |
@@ -308,7 +257,7 @@ Note that the screenshot button is currently not supported on the web.
308257

309258
## Theming
310259

311-
You can also customize the Feedback Widget colors to match your app's theme. The example below shows how to customize the widget background and foreground for the light and dark system themes with the `feedbackIntegration`.
260+
You can also customize the Feedback Form colors to match your app's theme. The example below shows how to customize the form background and foreground for the light and dark system themes with the `feedbackIntegration`.
312261

313262
```javascript
314263
import * as Sentry from "@sentry/react-native";
@@ -335,8 +284,8 @@ The available theme options are:
335284
| Key | Type | Default | Description |
336285
| ------------- | ----------------------------| ---------- | -------------------------------------------------------- |
337286
| `colorScheme` | `"system", "light", "dark"` | `"system"` | The color theme. "system" will use your OS color scheme. |
338-
| `themeLight` | Feedback Widget Theme | - | The light color scheme. |
339-
| `themeDark` | Feedback Widget Theme | - | The dark color scheme. |
287+
| `themeLight` | Feedback Form Theme | - | The light color scheme. |
288+
| `themeDark` | Feedback Form Theme | - | The dark color scheme. |
340289

341290
For each theme you can set the following colors:
342291

0 commit comments

Comments
 (0)