Layout
The feedback widget accepts HTML attributes to control its position, style, rating mode, and visibility options.
Usage
After installing the widget, set attributes on <feedback-button>:
<feedback-button project="YOUR_PROJECT_ID" button-style="dark" hide-icon="true">Feedback</feedback-button>
Properties
Use HTML attribute names below. The Docusaurus plugin uses camelCase names.
| Property | Description |
|---|---|
project | Required Type: stringThe project ID. |
api-key | Type: stringDefault value: ""Required when the project has Require an API key for submissions enabled. Use a key scoped to feedback_create only: see API key security. |
button-position | Type: stringDefault value: defaultAvailable values: default, bottom-right, bottom-left, top-right, top-left, center-right, center-leftPosition of the button. Use center-right or center-left to display the button as a vertical tab attached to the edge of the screen. |
button-style | Type: stringDefault value: defaultAvailable values: default, dark, lightStyle of the button. |
click-outside-close | Type: booleanDefault value: trueWhether clicking outside the feedback modal closes it. Any message typed by the user is kept, so an accidental click does not discard their input. Also applies to the screenshot editor, where clicking outside returns to the feedback form. See Accessibility. |
custom-font | Type: booleanDefault value: falseWhen set to true, the Inter font will not be loaded. Use your site's font instead. |
embedded | Type: booleanDefault: falseOn <feedback-modal> only. Show the form in the page without a trigger, close button, or backdrop. |
email-address | Type: stringInitial value for the email input field. |
escape-close | Type: booleanDefault value: trueAvailable on <feedback-modal> directly. Whether pressing Esc closes the feedback modal. Like clicking outside, any message typed by the user is kept. Also applies to the screenshot editor. Set to false if your site already binds Esc to something else. See Accessibility. |
hide-email | Type: booleanDefault value: falseWhether to hide the email input. |
hide-icon | Type: booleanDefault value: falseWhether to hide the button icon. |
hide-mobile | Type: booleanDefault value: falseWhen set to true, hides the feedback button on mobile devices. |
hide-privacy-policy | Type: booleanDefault value: trueWhether to hide the privacy policy checkbox. |
hide-rating | Type: booleanDefault value: false Whether to hide the ratings input. |
hide-screenshot-button | Type: booleanDefault value: falseWhether to hide the screenshot button. |
history-close | Type: booleanDefault value: trueWhether pressing the browser back button while the feedback modal is open closes it instead of navigating away. Especially useful on mobile, where going back is the natural way to dismiss an overlay. |
is-email-required | Type: booleanDefault value: falseWhen set to true, users must provide an email address to submit feedback. Tip: Remember to also update the email-placeholder property to remove "(optional)" from the text when using this option. |
metadata | Type: stringDefault value: ""A string attached to feedback, such as a JSON-encoded product version or user role. |
screenshot-positioning | Type: booleanDefault value: falseFor an inline button, shows a page-positioning step before capturing a screenshot. Fixed buttons keep the direct capture flow. |
modal-position | Type: stringDefault value: centerAvailable values: center, sidebar-right, sidebar-left, top-right, top-left, bottom-right, bottom-left, center-right, center-leftPosition of the feedback modal. |
rating | Type: numberDefault value: -1 (neutral) Rating selected by default. Available values: stars mode: 1...5. thumbs mode: 0 dislike and 1 like. -1 means neutral in both modes. |
rating-mode | Type: stringDefault value: thumbs Available values: thumbs, starsType of rating system. |
recaptcha-text | Type: stringDefault value: This form is protected by reCAPTCHA and the Google <a href="https://policies.google.com/privacy" target="_blank" rel="noopener noreferrer">Privacy Policy</a> and <a href="https://policies.google.com/terms" target="_blank" rel="noopener noreferrer">Terms of Service</a> apply.Text displayed in the footer when reCAPTCHA is enabled. Supports a limited set of HTML tags ( a, b, br, code, em, i, p, small, span, strong, u) and attributes (href, target, rel, title). |
session-id | Type: stringDefault value: Autogenerated Identifies a session. Set a custom value to associate feedback with an existing session. |
submit | Type: booleanDefault: falseWhen the button is clicked, submits a rating without opening the modal. If no rating is provided, it submits a neutral rating ( -1). |
privacy-policy-text | Type: stringDefault value: I have read and expressly consent to the terms of the <a href='https://pushfeedback.com/privacy'>Privacy Policy</a>.Privacy policy text. |
Examples
Replace YOUR_PROJECT_ID with the ID from Projects > your project > Snippet.
Change the button style
<feedback-button project="YOUR_PROJECT_ID" button-style="light">Feedback</feedback-button>
Create a floating button
<feedback-button project="YOUR_PROJECT_ID" button-position="center-right" modal-position="sidebar-right" button-style="dark">Feedback</feedback-button>
Add the widget to any button
<feedback-button project="YOUR_PROJECT_ID" button-position="default">
<button type="button">Report a problem</button>
</feedback-button>
Like / dislike buttons
Each button opens the form with the selected rating. Set submit="true" to submit a rating immediately without opening the form.
<feedback-button project="YOUR_PROJECT_ID" rating="1" button-position="default">Helpful</feedback-button>
<feedback-button project="YOUR_PROJECT_ID" rating="0" button-position="default">Not helpful</feedback-button>
Change modal position
<feedback-button project="YOUR_PROJECT_ID" modal-position="sidebar-left">Feedback</feedback-button>
Prefill email
<feedback-button project="YOUR_PROJECT_ID" email-address="[email protected]">Feedback</feedback-button>
Enable privacy policy
<feedback-button project="YOUR_PROJECT_ID" hide-privacy-policy="false" privacy-policy-text="I agree to the <a href='https://example.com/privacy'>privacy policy</a>.">Feedback</feedback-button>
Enable stars rating
<feedback-button project="YOUR_PROJECT_ID" rating-mode="stars">Feedback</feedback-button>