Introduction
use-cardano is a react context, hook, and set of components that makes interacting with the Cardano blockchain easy. It allows you to build web3 applications, connect wallets and perform tasks such as signing transactions and interacting with smart contracts.
Philosophy
The main design goal of use-cardano is to make it as easy as possible to build Cardano dApps with React. We hope this will lower the bar of entry into Cardano dApps development, and enable developers to focus on the unique value proposition of their products.
While highly customizable, getting started with use-cardano is easy. Below is a minimal, but fully functional example.
minimal-example.tsx
import "use-cardano/styles/use-cardano.css"
import { useCardano, CardanoProvider, CardanoWalletSelector, CardanoToaster } from "use-cardano"
const Content = () => {
const { account } = useCardano()
return (
<>
<CardanoWalletSelector />
<div>Connected Address: {account.address}</div>
</>
)
}
const App = () => (
<CardanoProvider options={options}>
<Content />
<CardanoToaster />
</CardanoProvider>
)