Feature 3
App documentation widget - React
4 min
we have already explained some of the benefits on contextual documentation in the previous chapter this guide serves as an alternative for react and nextjs apps to integrate the archbee app widget in a more elegant way integrate app widget install our npm package # with npm $ npm install save @archbee/app widget \# or with yarn $ yarn add @archbee/app widget when the package is installed, go to your jsx/tsx file and instantiate the component react import react from 'react'; import { archbeeappwidget, abwidgetref } from '@archbee/app widget' function app() { const widgetref = useref\<abwidgetref>(null); return ( \<div> \<archbeeappwidget ref={widgetref} spaceid={ / published space id / } onwidgetopen={() => { / / }} // callback function called after widget has open onwidgetclose={() => { / / }} // callback function called after widget has open \> \<button type='button' onclick={() => { \<! opens widget > widgetref current? open(); }}> open \</button> \<button type='button' onclick={() => { \<! closes widget > widgetref current? close(); }}> close \</button> \<button type='button' onclick={() => { \<! gets the instance of the widget if needed for various event manipulations > widgetref current? instance(); }}> get widget instance \</button> \</archbeeappwidget> \</div> ); } you can also reference the info from space settings select your space inside the editor click on the gear icon (⚙️) to get into settings go to widget integration click the react tab and then on the copy button, and paste the code into your tsx/ jsx file now, the widget will handle everything behind the scenes don't worry, everything is bundled and minified it's a mere 56kb download and it loads asynchronously, so your users won't feel a difference component props false true 178,121,119false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type shareable tokens are available in the scaling plan read more about public access controls docid 5os2ggyzvg4wpb6xjgjoz ref methods if ref is not passed to archbeeappwidget , children will automatically open the modal pop up upon after being clicked true falsefalse unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type
🤔
Have a question?
Our super-smart AI,knowledgeable support team and an awesome community will get you an answer in a flash.
To ask a question or participate in discussions, you'll need to authenticate first.