Skip to content

Components

NFT Card

Image, name and collection for an ERC-721 or ERC-1155 token, from its on-chain metadata.

Reads tokenURI (ERC-721) or uri (ERC-1155) and fetches the metadata. Handles IPFS, Arweave and inline data: metadata. The third card below is a token that doesn’t exist.

Loading NFT
Loading NFT
Loading NFT
Terminal window
npx shadcn@latest add @0xui/nft-card
import { NftCard } from "@/components/nft-card";
<NftCard contract="0xBC4C…f13D" tokenId={1n} chainId={1} />;
Loading NFT
<NftCard contract={contract} tokenId={1n} showAttributes />

ipfs:// links go through https://ipfs.io/ipfs/ by default. The public gateway is slow and rate-limited, so use your own in production:

<NftCard gateway="https://my-gateway.mypinata.cloud/ipfs/" … />
data-phase What the user sees
loading A skeleton measured from the card’s own layout.
ready Image, name, collection and id.
not-found “Token not found”: no tokenURI/uri, so it’s not an NFT or doesn’t exist.
metadata-error “Metadata unavailable”: the token exists, but its metadata host failed. Usually a rate-limited public IPFS gateway.

Helpers: useNft, fetchNftMetadata, resolveUri and expandTokenUri (ERC-1155 {id} substitution).