ThirdwebNftMedia
Component that renders an NFT from given a metadata object.
Under the hood, if the image property of the metadata is an URL/IPFS URI, it is fetched from the source.
The mime type of the
asset is determined and the appropriate component is rendered on the UI.
For example, if your NFT is an image, the img tag will be used. If it is a video, the video tag will be used, etc.
The component currently supports:
Images
Videos
Audio files
3D Models
SVGs (for on-chain NFTs )
iframesandHTMLIf none of these are appropriate, the fallback is a link to the asset
Example
Provide the metadata object to the component to render the NFT.
The NFT's image is used as the media, and the name is used as the alt text for the media.