Skip to main content

AddressInput

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.

AddressInput Example

Importโ€‹

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

Usageโ€‹

const [address, setAddress] = useState("");

<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.