AddressInput

The document describes an Ethereum address input component that validates address formats, resolves ENS domains, displays avatars, and shows blockie images, along with its import, usage, and available props.

Display an Ethereum address input that validates the address format, resolves ENS domains, and shows their avatars.

Also shows a blockie image for each address.

Import

typescript
1import { AddressInput } from "~~/components/scaffold-eth";

Usage

typescript
1const [address, setAddress] = useState("");
jsx
1<AddressInput onChange={setAddress} value={address} placeholder="Input your address" />

Props

PropTypeDefault ValueDescription
valuestringundefinedAn Ethereum address in (0x___ format) or an ENS domain.
onChangefunctionundefinedA callback invoked when the data in the address input changes.
placeholder (optional)stringundefinedThe string that will be rendered before address input has been entered.
name (optional)stringundefinedHelps identify the data being sent if AddressInput is submitted into a form.
disabled (optional)booleanfalseIf true, sets the address input un-clickable and unusable.