0.0.7 • Published 8 months ago
@easya/layer-ui-react v0.0.7
@easya/layer-ui-react
A React component library for building blockchain applications with ease, focusing on XRPL integration (more coming soon).
Features
- 🔗 Seamless blockchain connectivity
- 💰 Token management components
- 🎨 Dark/Light mode support
- 🔐 Wallet integration
- 📊 Balance display components
- 🔄 Transaction handling
Installation
npm install @easya/layer-ui-react
# or
yarn add @easya/layer-ui-react
Quick Start
import { BlockchainProvider, ConnectButton } from '@easya/layer-ui-react';
const config = {
network: 'testnet',
blockchain: 'xrpl',
wallet: 'crossmark'
};
function App() {
return (
<BlockchainProvider config={config}>
<ConnectButton />
</BlockchainProvider>
);
}
Core Components:
BlockchainProvider
- Provides blockchain context to all componentsConnectButton
- Button to connect/disconnect walletAddressDisplay
- Shows wallet addressBalanceDisplay
- Shows XRP balanceBalancesDisplay
- Shows all token balancesTransactionForm
- Send tokens/XRPIssueTokenForm
- Create new fungible tokensTrustLineForm
- Create token trust lines
Setup
create a react app:
npm create vite@latest your-project-name -- --template react
cd your-project-name
npm install
npm i @easya/layer-ui-react
- now, we can start using it! update App.jx content to:
import { BlockchainProvider, ConnectButton } from '@easya/layer-ui-react';
const config = {
network: 'testnet',
blockchain: 'xrpl',
wallet: 'crossmark'
};
function App() {
return (
<BlockchainProvider config={config}>
<div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center', height: '100vh' }}>
<ConnectButton />
</div>
</BlockchainProvider>
);
}
export default App;
npm run dev
Setup a full functional sample
- clone the starter repo
https://github.com/EasyA-Tech/easya-layer-starter-react
- npm install
npm start
You can now start modifing the starter app