@pnsdomains/widgets
v1.0.5
Published
React components for interacting with the PulseChain Name Service
Downloads
1
Readme
PNS Widgets
A small, configurable React component for interacting with the PulseChain Name Service.
Installation
Install the widgets library and its peer dependencies via npm
or yarn
.
yarn add @pnsdomains/widgets ethers wagmi
npm install @pnsdomains/widgets ethers wagmi
Name Registration Widget
This component assumes your app is already wrapped in <WagmiConfig>
and either a RainbowKit or ConnectKit provider.
Required props:
connectAction
: a RainbowKit or ConnectKit function that opens a wallet connect modal
Optional props:
hasContainer
: if true (default), the widget will be wrapped in a container with padding and a borderhasHeader
: if true (default), the widget will have a header with a title and link to pulse.domainsname
: a preset name to registeronStatusUpdate
: a callback that gives you access to the status of the registration processshadowless
: if true, the widget will not have a shadowtheme
: easily choose between dark and light mode (defaults to light)trackingCode
: an PNS name that will be hashed and included in the transaction for on-chain analytics according to ENSIP-14
import { RegistrationWidget } from '@pnsdomains/widgets'
import { useConnectModal } from '@rainbow-me/rainbowkit'
export default function Page() {
const { openConnectModal } = useConnectModal()
return <RegistrationWidget connectAction={openConnectModal} />
}
Running examples
Clone this repo and install dependencies
git clone https://github.com/pulsedomains/pns-widgets.git
cd pns-widgets
yarn install
Start the code bundler for the component and the example Vite app
yarn dev:vite # or dev:next for a Next.js example
# then in another terminal window:
yarn dev:widget
Any changes to packages/widget or examples/vite will auto-reload the page.