Accelerate frontend development with a powerful set of UI components designed for Circle's Developer-Controlled Wallets. These embedded wallets enable users to store, send, and spend USDC and other digital assets seamlessly.
- Pre-built components for common Circle operations
- Built with React, TypeScript, and Tailwind CSS
- Accessible by default using Radix UI primitives
- Dark mode support
- Responsive and mobile-friendly
- Form components with validation
- Transaction management components
- Wallet management components
Before using the components, you need to configure the Circle Console. The easiest way is to use our setup tool:
npx @circle-libs/sdk-setup --api-key YOUR_API_KEY
You'll need:
- A Circle API key from the Circle Console. Read how to setup your Circle Developer Account here.
The setup tool will automatically:
-
Generate a secure entity secret
-
Register your configuration with Circle
-
Save the configuration to
.env
file with required environment variables:CIRCLE_API_KEY
: Your Circle API keyCIRCLE_SECRET
: Generated entity secret for secure communication with the Circle API
-
Generate a recovery file (
recovery_file_YYYY-MM-DD.dat
)
recovery_file_YYYY-MM-DD.dat
) in a secure location and remove it from your project directory.
Then you can proceed with the installation of the Circle Developer-Controlled Wallet SDK and Circle React Elements.
npm install @circle-libs/react-elements
or
yarn add @circle-libs/react-elements
This package requires the following peer dependencies:
{
"@circle-fin/developer-controlled-wallets": "^7.0.0", // Circle SDK
"@web3icons/react": "^3.16.0", // Blockchain icons
"lucide-react": "^0.474.0", // Icon library
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-hook-form": "^7.54.2", // Form validation
"tailwindcss": "^4.0.4" // CSS framework
}
Install them all in a single command:
npm install @circle-fin/developer-controlled-wallets @web3icons/react lucide-react react react-dom react-hook-form tailwindcss
or
yarn add @circle-fin/developer-controlled-wallets @web3icons/react lucide-react react react-dom react-hook-form tailwindcss
Import the Circle React Elements CSS in your app's tailwind.css
file:
@import 'tailwindcss';
@import '@circle-libs/react-elements/styles.css';
@custom-variant dark (&:is(.dark *));
:root {
--primary: hsl(255 82% 64%); /* Overwrite to match your theme. */
}
.dark {
--primary: hsl(255 82% 64%); /* Overwrite to match your theme. */
}
Here's a simple example using the wallet creation form:
import { NewWalletForm } from '@circle-libs/react-elements';
function CreateWallet() {
const handleSubmit = async (data) => {
try {
// Call Circle's API to create wallet
await createWallet(data);
} catch (error) {
// Handle error
}
};
return (
<NewWalletForm walletSetId="your-wallet-set-id" onSubmit={handleSubmit} isTestnet />
);
}
The library provides several categories of components:
WalletDetails
- Show wallet informationWalletSetDetails
- Show wallet set informationWalletBalance
- Display token balancesWalletReceive
- Show wallet address with QR code
ChainIcon
- Display blockchain network iconChainLabel
- Show network name with iconChainSelect
- Network selection dropdown for mainnetsTestChainSelect
- Network selection dropdown for testnets
TokenItem
- Display token informationTokenSelect
- Token selection dropdown with balancesAmount
- Format token amounts
TransactionDetails
- Display transaction informationTransaction
- Flexible transactions component that dynamically renders transaction details within a table, supporting customizable columns
NewWalletForm
- Create a new walletEditWalletForm
- Edit an existing walletNewWalletSetForm
- Create a new wallet setEditWalletSetForm
- Edit an existing wallet setSendTransactionForm
- Send tokens from a wallet
SuccessMessage
- Display a success messageTransactionState
- Show transaction stateComplianceStatus
- Show compliance status
The package is written in TypeScript and includes full type definitions. All components and their props are fully typed for the best development experience.
The components use Tailwind CSS for styling and can be customized through your Tailwind configuration. They respect your theme's colors, spacing, and other design tokens.
Contributions are welcome! Please open an issue or submit a pull request on GitHub.
This project is licensed under the MIT License.