How to Embed a PDF Directly in a CRM Card (Without a Modal)?

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:

  1. Is it possible to render the <IFrame /> component directly on the main surface of a CRM card, or is it restricted to modals only?
  2. If direct embedding is possible, what is the correct approach to make it work?
  3. Is there a specific limitation or best practice I’m missing for this use case?

Any guidance on this would be greatly appreciated.

Hey @SPrakash37 :waving_hand: Thanks for the great question. We appreciate you including your details. I’d like to invite some community members to the conversation — @frameofwork @himanshurauthan have you tackled anything similar in your recent dev work? Thank you for taking a look! — Jaycee

The components allowed on the main area is super restricted to what Hubspot allows. Even simple things like where a React version of a module has X option doesn’t mean the Hubspot variant supports it (to my chagrin for things like padding and margin!). As far as I’m aware, iFrames are limited to the modal window.

You can view the supported components here:

Unfortunately, iFrame is not one of them.