Hello HubSpot Developer Community,
I am building a custom CRM Card to display a PDF document for our custom object records.
I have found that I can use a button on the card to trigger the actions.openIframeModal function. This successfully opens a modal and displays the PDF inside an iframe, which confirms the basic functionality is working.
However, my goal is to embed the PDF viewer directly within the main body of the card itself, so it’s visible immediately when the record page loads, without requiring a button click or a separate modal.
When I try to render the <IFrame /> component on the main surface of the card, it doesn’t appear. It seems to only render when called through the modal action.
My Questions:
- Is it possible to render the <IFrame /> component directly on the main surface of a CRM card, or is it restricted to modals only?
- If direct embedding is possible, what is the correct approach to make it work?
- Is there a specific limitation or best practice I’m missing for this use case?
Any guidance on this would be greatly appreciated.