Skip to content

Getting started

Installation

Add the 0xui registry to a shadcn project and set up wagmi.

0xui is a shadcn registry. Components are copied into your project as source, so you own and can edit them.

If your project doesn’t use shadcn yet, follow the shadcn installation guide for your framework. You need Tailwind CSS v4 and a components.json.

0xui needs the Base UI flavor of shadcn (npx shadcn@latest init --base base). The Radix flavor isn’t supported: components use Base UI props that Radix primitives don’t have.

Add the @0xui namespace to components.json:

components.json
{
// ...
"registries": {
"@0xui": "https://0xui.io/r/{name}.json"
}
}
Terminal window
npx shadcn@latest add @0xui/wagmi-config

This adds two files:

  • lib/wagmi-config.ts: chains, connectors and transports. Edit it to match your app.
  • components/web3-provider.tsx: WagmiProvider and a TanStack QueryClientProvider.

Wrap your app once:

app.tsx
import { Web3Provider } from "@/components/web3-provider";
export function App() {
return <Web3Provider>{/* your app */}</Web3Provider>;
}

Optionally, register the config type so wagmi hooks infer your chain IDs:

lib/wagmi-config.ts
declare module "wagmi" {
interface Register {
config: typeof config;
}
}

If you already have a wagmi setup, skip this step. Every 0xui component reads from whatever WagmiProvider is above it.

Terminal window
npx shadcn@latest add @0xui/chain-selector

Shared helpers (@0xui/0xui-utils, @0xui/use-mounted, …) and shadcn primitives (popover, dialog, …) install automatically as dependencies.

The shadcn MCP server lets agents browse and install from any registry in your components.json, including @0xui:

Terminal window
npx shadcn@latest mcp init