Installation
Install and configure W3-Kit for your Web3 application. W3-Kit follows the shadcn/ui patterns for seamless integration.
Prerequisites
Before you begin, ensure your project meets these requirements:
- Frameworks: Next.js, Vite, Remix, or Laravel
- Required: React 18+ and Tailwind CSS
- Recommended: TypeScript for better developer experience
Create Project
Start a new project with the shadcn CLI. This sets up your project with customizable styles and configurations:
npx shadcn@latest initOr use the new create command for an interactive setup with more customization options:
npx shadcn@latest createThe create command allows you to customize:
- Component library (Radix UI or Base UI)
- Visual style presets
- Base color scheme
- Fonts and icons
Visual Style Presets
Choose from 5 visual styles to match your design system:
- Vega – The classic shadcn/ui look
- Nova – Reduced padding and margins for compact layouts
- Maia – Soft and rounded, with generous spacing
- Lyra – Boxy and sharp, pairs well with mono fonts
- Mira – Compact, made for dense interfaces
Add W3-Kit Components
Once your project is set up, add Web3 components using the W3-Kit CLI. For example, to add the NFT Collection Grid:
npx w3-kit@latest add nft-collection-gridThis command will:
- Create a
components/uidirectory in your project - Copy the selected component to
components/ui/nft-collection-grid - Create a config directory and copy the
tokens.tsfile - Add all necessary dependencies to your
package.json
Useful CLI Commands
The shadcn CLI provides additional commands to help you manage components:
View a component before installing:
npx shadcn@latest view buttonSearch for components:
npx shadcn@latest searchList all available components:
npx shadcn@latest listCheck for component updates:
npx shadcn@latest diffMigration Guide
If you have an existing project using the old @radix-ui/react-* packages, you can migrate to the new unified radix-ui package:
npx shadcn@latest migrate radixThis command will:
- Replace all
@radix-ui/react-*imports withradix-ui - Update your UI components automatically
- Install the new
radix-uipackage as a dependency
Example Usage
After adding a component, import and use it in your code:
import { NFTCollectionGrid } from '@/components/ui/nft-collection-grid'export default function Home() { return ( <div> <NFTCollectionGrid /> </div> ) }