Add a feedback widget to your React or Next.js app
Mount the tinyDialog SDK once in your app layout, then add inline surveys and feedback buttons wherever users need them. Widgets connect automatically as components mount and users navigate.
Install tinyDialog in React
- Install the JavaScript SDK in your React 18+ project.
npm install @tinydialog/sdk-js - Import
TinyDialogfrom@tinydialog/sdk-js/reactand render it once near the root of your app. In the Next.js App Router, you can render it inside your existing Server Component layout.Next.js App Router
app/layout.tsximport type {ReactNode} from 'react'; import {TinyDialog} from '@tinydialog/sdk-js/react'; export default function RootLayout({children}: {children: ReactNode}) { return ( <html lang="en"> <body> <TinyDialog /> {children} </body> </html> ); }In TanStack Start, mount it in your shared root route component. In Vite or an existing Create React App project, render it in your top-level
Appcomponent. If you already installed tinyDialog using a script tag, remove that tag when you switch to the React setup. - Create a survey in the tinyDialog dashboard. Open Setup & Connections, copy the survey ID, and use it in one of the examples below.
Add an inline survey or feedback button
Ask “Was this page helpful?”
Create a Yes/No survey and place this container below a help article or docs page.
<div data-tinydialog-widgetcontainer="YOUR_SURVEY_ID" />Open a survey from your own button
Add a button to your toolbar or help menu and style it to match your app.
<button type="button" data-tinydialog-openwidget="YOUR_SURVEY_ID">
Give feedback
</button>tinyDialog connects widgets as components mount and updates the page URL on client-side navigation. Send a test response from a second page and check its URL in the survey’s Responses tab.
See the React & Next.js SDK guide for inline widget styling and client-side setup examples. To open a survey after a user action, see the in-app feedback guide.
Create your first survey
Start free with 25 responses per month.
Start free