Skip to content

Components

Block Number

Live block indicator that doubles as an RPC health check.

Shows the latest block and updates as new blocks arrive. The dot shows whether the RPC is responding.

Loading block…
Terminal window
npx shadcn@latest add @0xui/block-number
import { BlockNumber } from "@/components/block-number";
<BlockNumber />;

With HTTP transports, wagmi polls for new blocks (every 4 seconds by default). Pass watch={false} to fetch once.

Loading block…
<BlockNumber chainId={8453} explorer />

data-phase on the root holds the current state.

data-phase What the user sees
loading Grey dot and a skeleton where the number will be. “Loading block…” for screen readers.
live Green dot (pulses while watching) and the block number.
error Red dot, “RPC unavailable”.
Prop Type Default Description
chainId number current chain Chain to watch.
watch boolean true Keep updating.
explorer boolean false Link the number to the block on the explorer.