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…
Installation
Section titled “Installation”npx shadcn@latest add @0xui/block-numberpnpm dlx shadcn@latest add @0xui/block-numberyarn dlx shadcn@latest add @0xui/block-numberbunx --bun shadcn@latest add @0xui/block-numberimport { 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.
Examples
Section titled “Examples”Linked to the explorer
Section titled “Linked to the explorer”Loading block…
<BlockNumber chainId={8453} explorer />States
Section titled “States”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. |
