Blockchain Development Engineer 2022-05-14 03:56:31 阅读数:292
GitHub Address and demo See the end of the page for the address !
Web3UIKit Apply to web3 Developers quickly develop beautiful user interfaces , Contains more than 30 In decentralized applications (DApp) Lightweight commonly used in UI Components . No matter which blockchain it is built on ,Web3UIKit Can improve your dapp Development efficiency .
Web3UIKit Include Web3 Components 、UI Components 、 Interactive components 、 Pop up window components, etc , The list is as follows :
<ConnectButton />
<NFT />
<Accordion />
<Avatar />
<Badge />
<BannerStrip />
<Breadcrumbs />
<Card />
<CryptoCards />
<CryptoLogos />
<Icon />
<Illustration />
<Information />
<LinkTo />
<Logo />
<Notification />
<Table />
<Tag />
<Todo />
<Widget />
<Button />
<Checkbox />
<CodeArea />
<Credentials />
<Form />
<Input />
<Radios />
<Select />
<TextArea />
<Modal />
<Tooltip />
Use NPM install :
1 | npm install web3uikit |
Or use yarn install :
1 | yarn web3uikit |
Web3UIKit Contains more than 30 Kind of Web3 Common lightweight in applications UI Components , For example, using CryptoCards Components and Button Components :
1 2 3 4 5 6 7 8 | import { CryptoCards, Button } from 'web3uikit'; const App = () => ( <> <CryptoCards chain="ethereum" /> <Button theme="primary" type="button" text="Launch Dapp" /> </> ); |
<ConnectButton/>
Components :
ConnectButton Component allows you to make... When the server is initialized web3 Validate users . When the server is not initialized , Or, for example, you have <MoralisProvider initializeOnMount={false} >
But I don't want to Moralis Connect the server to the front end , The smart component will call enableWeb3()
.
If you want to use this component with the connected server , But not to Moralis Database add users , You can add moralisAuth The props
ConnectButton The component automatically adds local storage information about the use of connector users , And automatically call... After refreshing the page again enableWeb3(). therefore , If the user is connected , It will automatically initialize web3 Connect ( After refreshing the page, there is no need to refresh enableWeb3() add to UseEffect hook )
<NFT/>
Components :
NFT Components allow you to put a single NFT Displayed as a card . By clicking on the card , You can also view NFT All the characteristics of . It's used from react-moralis The hook To get NFT.
If you want to use this component , Please use <MoralisProvider appId={MORALIS_APP_ID} serverUrl={MORALIS_SERVER_URL} ></MoralisProvider >
. Please be there. here Read about Moralis For more information .
<NFTBalance/>
Components :
NFTBalance The component allows you to display all the information owned by the address NFT. It's used from react-moralis Hook to get all the addresses NFT.
If you want to use this component , Please use <MoralisProvider appId={MORALIS_APP_ID} serverUrl={MORALIS_SERVER_URL} ></MoralisProvider >
.
<Accordion/>
Components :
Accordion Component is a good user interface element , You can easily show and hide text or other components , Therefore, users will not be confused by too much content .
<Avatar/>
Components :
Avatar The component can display the avatar of the user .
<Badge/>
Components :
<BannerStrip/>
Components :
<Breadcrumbs/>
Components :
<Card/>
Components :
<CryptoCards/>
Components :
<CryptoLogos/>
Components :
<Icon/>
Components :
<Illustration/>
Components :
<Information/>
Components :
<LinkTo/>
Component is a simple link component , Can be used to navigate to another page or another component .
<Logo/>
Component is a simple logo component , With... That can be used for any layout moralis Or other icons .
<Notification/>
Components :
To be called Notification Components , Please use useNotification()
hook . Example :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | const App = () => { const dispatch = useNotification(); const handleNewNotification = () => { dispatch({ type: 'info', message: 'Somebody messaged you', title: 'New Notification', icon, position: position || 'topR', }); }; return ( <> <Button text="Error" onClick={handleNewNotification} theme="colored" color="red" isFullWidth={true} /> </> ); }; |
Requires that the application must be in <NotificationProvider>
Inside , for example :
1 2 3 | <NotificationProvider> <App /> <NotificationProvider> |
<Table/>
Components :
<Tag/>
Components :
<Todo/>
Components :
<Widget/>
Components :
<Button/>
Components :
<Checkbox/>
Components :
<Code/>
Components :
<Credentials/>
Components :
<Form/>
Components :
<Input/>
Components :
<Radios/>
Components :
<Select/>
Components :
<TextArea/>
Components :
<Modal/>
Components :
<Tooltip/>
Components :
demo
Webpack Apphttps://web3ui.github.io/web3uikit/?path=/story/1-web3-blockie--custom-seed
版权声明:本文为[Blockchain Development Engineer]所创,转载请带上原文链接,感谢。 https://netfreeman.com/2022/134/202205140348123689.html