Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time


Easy to use and secure iframes for displaying inscriptions of many different types.

How it works and how to use it

There are two main parts here:

  • the custom web element: <toniq-nft-frame>
    • This element is published on npm here:
    • It can be used by installing it: npm i @toniq-labs/toniq-nft-frame, and then importing it's main script somewhere in your run-time, and then placing it in your DOM with toniq-nft-frame.
    • You'll need to pass properties to this element using Javascript properties on the element instance. All the properties are listed in the types exported by nft-config.ts.
    • Host the iframe code mentioned below on a separate domain, and pass the path to the iframe code in to this custom element to the childFrameUrl property.
  • the iframe code
    • The iframe code is produced by the npm run build command and is then located at packages/toniq-nft-frame/iframe-dist within this repo.
    • This code will need to be hosted on a domain separate from your main website, but on the same domain as all the NFTs / images that it will be loading.

Content Security Policies

These have been tested to work:

  • parent domain: default-src <the domain of your hosted iframe> 'unsafe-inline' 'self' blob: data:
  • iframe domain: default-src 'unsafe-inline' 'self' blob: data:


To display HTML ordinals, such as those generated by this BitGen standard, on your website, you must load the inscription inside an iframe. For security purposes, make sure to host your iframe code on another domain or sub-domain than your frontend to prevent inscription code from hijacking your website.

This, combined with iframe sizing difficulties, can make displaying ordinals a daunting task. However, Toniq Labs has created toniq-nft-frame to smooth out the process. Check it out here:


Easy to use and secure iframes for displaying inscriptions of many different types.