0

Installation

Next

Learn what AGW Reusables is and how to install it.

Introduction

AGW Reusables is a collection of components and utilities for building applications on Abstract. It allows you to add features, components, and utilities to your application using single commands, with only one requirement: your app must use Next.js .

Built on top of the shadcn/ui library, AGW Reusables uses the shadcn CLI to add snippets of code to your project and install any required dependencies to use them.

Watch the demo video below for an overview and a guide to getting started.

Get Started

Follow the steps below to start using AGW Reusables.

1

Setup your project

Create a new project or configure an existing one using the shadcn init command:

pnpm dlx shadcn@latest init
2

Install the AGW Provider

Install the required wrapper component, the AGW Provider:

pnpm dlx shadcn@latest add "https://build.abs.xyz/r/agw-provider.json"
3

Wrap your application

Wrap your application in the installed component inside app/layout.tsx.

app/layout.tsx
import { NextAbstractWalletProvider } from "@/components/agw-provider";
import { Toaster } from "@/components/ui/sonner";
import "./globals.css";
 
export default function RootLayout({ children }: { children: React.ReactNode }) {
  return (
    <html lang="en">
      <NextAbstractWalletProvider>
        <body>
          {children}
          <Toaster />
        </body>
      </NextAbstractWalletProvider>
    </html>
  );
}