Feedback widget for Docusaurus
Add the PushFeedback widget in a Docusaurus project using the official plugin.
Prerequisites
- A PushFeedback project. Copy its project ID from Projects > your project > Snippet and replace
<YOUR_PROJECT_ID>in the examples. - A Docusaurus site and Node.js installed.
For a floating button, use docusaurus-pushfeedback 1.0.9 on Docusaurus 3 or 0.1.7 on Docusaurus 2. Other modes use pushfeedback-react 0.1.76.
The examples load the widget runtime from jsDelivr and import the installed stylesheet. For a local runtime, see self-hosted assets.
Installation
Floating button

-
Install PushFeedback:
- Docusaurus 3.x
- Docusaurus 2.x
npm install [email protected]
npm install [email protected]
-
Add the plugin to your Docusaurus config file
docusaurus.config.js:plugins: [['docusaurus-pushfeedback',{project: '<YOUR_PROJECT_ID>'}]],Replace
<YOUR_PROJECT_ID>with your project's ID from the PushFeedback dashboard. -
Open your site. Click Feedback to check that the form opens.
Customization
You can change the widget's position, color, and more. Add any configuration and text option to the plugin, formatted as camelCase.
Here's an example:
plugins: [
[
'docusaurus-pushfeedback',{
project: '<YOUR_PROJECT_ID>',
buttonPosition: 'center-right',
modalPosition: 'sidebar-right',
buttonStyle: 'dark',
modalTitle: 'Share your thoughts'
}
]
],
Set CSS custom properties in your existing Docusaurus custom stylesheet. See Docusaurus custom CSS if the site has no stylesheet yet.
Other installation modes
Inline button

-
Install the React widget package:
npm install [email protected] [email protected] -
Run
npm run swizzle @docusaurus/theme-classic DocItem/Footerand choose Wrap. Replacesrc/theme/DocItem/Footer/index.jswith:import React, { useEffect } from 'react';import Footer from '@theme-original/DocItem/Footer';import { FeedbackButton } from 'pushfeedback-react';import 'pushfeedback/dist/pushfeedback/pushfeedback.css';function PageFeedback() {useEffect(() => {if (document.querySelector('script[data-pushfeedback]')) return;const script = document.createElement('script');script.type = 'module';script.src =script.dataset.pushfeedback = '';document.head.appendChild(script);}, []);return (<FeedbackButtonproject="<YOUR_PROJECT_ID>"button-position="default"modal-position="center"button-style="dark">Feedback</FeedbackButton>);}export default function FooterWrapper(props) {return (<><Footer {...props} /><PageFeedback /></>);}
This wrapper loads the stylesheet and custom elements and places the widget after each document. Remove docusaurus-pushfeedback from your config if you do not want its floating button.
Embedded form

-
Install the React widget package:
npm install [email protected] [email protected] -
Run
npm run swizzle @docusaurus/theme-classic DocItem/Footerand choose Wrap. Replacesrc/theme/DocItem/Footer/index.jswith:import React, { useEffect } from 'react';import Footer from '@theme-original/DocItem/Footer';import { FeedbackModal } from 'pushfeedback-react';import 'pushfeedback/dist/pushfeedback/pushfeedback.css';function PageFeedback() {useEffect(() => {if (document.querySelector('script[data-pushfeedback]')) return;const script = document.createElement('script');script.type = 'module';script.src =script.dataset.pushfeedback = '';document.head.appendChild(script);}, []);return <FeedbackModal project="<YOUR_PROJECT_ID>" embedded="true" />;}export default function FooterWrapper(props) {return (<><Footer {...props} /><PageFeedback /></>);}
This wrapper loads the stylesheet and custom elements and places the widget after each document. Remove docusaurus-pushfeedback from your config if you do not want its floating button.
Like and dislike buttons
![]()
-
Install the published widget and React wrapper:
npm install [email protected] [email protected] -
Run
npm run swizzle @docusaurus/theme-classic DocItem/Footerand choose Wrap. Replacesrc/theme/DocItem/Footer/index.jswith:import React, { useEffect } from 'react';import Footer from '@theme-original/DocItem/Footer';import { FeedbackButton } from 'pushfeedback-react';import 'pushfeedback/dist/pushfeedback/pushfeedback.css';export default function FooterWrapper(props) {useEffect(() => {if (document.querySelector('script[data-pushfeedback]')) return;const script = document.createElement('script');script.type = 'module';script.src =script.dataset.pushfeedback = '';document.head.appendChild(script);}, []);return (<><Footer {...props} /><p>Was this helpful?</p><FeedbackButtonproject="<YOUR_PROJECT_ID>"rating="1"button-position="default"modal-position="center"button-style="light">Helpful</FeedbackButton><FeedbackButtonproject="<YOUR_PROJECT_ID>"rating="0"button-position="default"modal-position="center"button-style="light">Not helpful</FeedbackButton></>);}
Each button opens the form with its rating selected. The visitor still clicks Send to submit. Remove docusaurus-pushfeedback from your config if you want only these buttons.
Advanced setup: Multilingual support

With Docusaurus i18n enabled:
-
Install the widget packages:
npm install [email protected] [email protected] -
Run
npm run swizzle @docusaurus/theme-classic Footerand choose Wrap. Replacesrc/theme/Footer/index.jswith:import React, { useEffect } from 'react';import Footer from '@theme-original/Footer';import useDocusaurusContext from '@docusaurus/useDocusaurusContext';import { FeedbackButton } from 'pushfeedback-react';import 'pushfeedback/dist/pushfeedback/pushfeedback.css';const labels = {en: { button: 'Feedback', title: 'Share your feedback', send: 'Send' },es: { button: 'Sugerencias', title: 'Danos tu opinión', send: 'Enviar' },};export default function FooterWrapper(props) {const { i18n } = useDocusaurusContext();const text = labels[i18n.currentLocale] || labels.en;useEffect(() => {if (document.querySelector('script[data-pushfeedback]')) return;const script = document.createElement('script');script.type = 'module';script.src =script.dataset.pushfeedback = '';document.head.appendChild(script);}, []);return (<><Footer {...props} /><FeedbackButtonproject="<YOUR_PROJECT_ID>"button-position="bottom-right"button-style="dark"modal-title={text.title}send-button-text={text.send}>{text.button}</FeedbackButton></>);}
Replace the project ID and add your languages to labels. This example translates the button, title, and send action. Add the remaining labels from Text to translate the full form. Remove docusaurus-pushfeedback from your config if you want only this button.
Verify the installation
Run npm run build, then npm run serve. Open a document, send a test message, and confirm it appears in your PushFeedback project. For multilingual sites, check each locale. Check allowed URLs if submission fails.