Recommended: JavaScript SDK with React Hooks
For new React apps, we recommend the JavaScript SDK with React Hooks (
@dynamic-labs-sdk/react-hooks) instead of the legacy React SDK documented here. The JS SDK comes with many benefits such as a much smaller bundle size and other optimizations. Use the React quickstart (JavaScript SDK) to get started.shadowRoot property of the host element - from there you can access the elements and manipulate them or append new ones.
For example, if you want to target the Dynamic Widget, you’d look for an element with data-testid="dynamic-modal-shadow":
- The widget content may change dynamically (e.g., different views or states).
- The widget might be destroyed and recreated in the DOM.
- Your custom content might be overwritten by internal widget updates.