Murphy Logo Murphy
Metaplex

Mint NFT Form

A Solana NFT minting component with shadcn UI styling

Mint NFT Form

Create NFT
Create a new NFT on Solana

Loading...

Installation

Install dependencies

Start by installing required Solana and Metaplex dependencies

pnpm add @solana/web3.js @solana/wallet-adapter-react @metaplex-foundation/umi-bundle-defaults @metaplex-foundation/umi-signer-wallet-adapters @metaplex-foundation/mpl-token-metadata @metaplex-foundation/umi

Add Wallet Provider

Make sure you have added the Wallet Provider to your application. If not, follow the steps in the Connect Wallet Button guide first.

Add Mint NFT Form

pnpm dlx shadcn@canary add https://www.murphyai.dev/r/mint-nft-form.json

Basic Usage

import { MintNFT } from "@/components/ui/murphy/mint-nft-form";
export default function MyPage() {
  return (
    <div>
      <h1 className="text-xl font-bold mb-2">Create an NFT</h1>
      <MintNFT className="max-w-md" />
    </div>
  );
}

Features

  • Connect with Solana wallet
  • Create standard Solana NFTs (SPL tokens)
  • Customizable NFT metadata (name, symbol, URI)
  • Optional collection support
  • Real-time network detection (devnet/mainnet)
  • Multi-stage UI (input, confirming, success, error)
  • Transaction signature display with explorer links
  • Error handling with retry capability

Advanced Usage

You can specify a collection mint to add your NFT to an existing collection:

export default function MyPage() {
  return (
    <div>
      <h1 className="text-xl font-bold mb-2">Create an NFT</h1>
      <MintNFT
        className="max-w-md"
        collectionMint="DUSTawucrTsGU8hcqRdHDCbuYhCPADMLM2VcCb8VnFnQ"
      />
    </div>
  );
}

Note: For minting compressed NFTs with lower gas fees, consider using the Mint CNFT Form component instead.

On this page