Simple examples showing how to use @tago-io/custom-widget-react in your custom widgets.
Each file is a self-contained React component you can copy into your project.
| Example | What it shows |
|---|---|
| read-data.tsx | Display real-time data from devices |
| send-data.tsx | Send data back to devices with a form |
| read-resource.tsx | Access user info and blueprint devices |
- Copy the example file into your React project
- Make sure you have the SDK installed:
npm install @tago-io/custom-widget-react - Render the
Appcomponent from the example as your root component (or adapt it to fit your app)
Every example follows the same pattern:
- Wrap your app in
<TagoIOProvider>(once, at the top level) - Use hooks like
useWidget(),useRealtimeData(),useSendData()inside your components
Check out the JavaScript SDK examples — they cover the same use cases using plain HTML and window.TagoIO.