Skip to content

Components

Gas Price

Current gas price in gwei, optionally colored low, medium or high.

Shows the current gas price and refreshes it every 12 seconds.

Loading gas price
Terminal window
npx shadcn@latest add @0xui/gas-price
import { GasPrice } from "@/components/gas-price";
<GasPrice />;

Normal gas varies a lot between chains: 20 gwei is cheap on mainnet and very expensive on Base. So there are no default thresholds. Pass the cut-offs that make sense for your chain.

Loading gas price
<GasPrice thresholds={{ low: 5, high: 30 }} />

The tone is set as data-tone (low, medium or high) and is announced to screen readers.

Prop Type Default Description
chainId number current chain Chain to read.
refreshInterval number | false 12000 Refresh interval in ms. false fetches once.
thresholds { low: number; high: number } — Gwei cut-offs for the tone.
icon ComponentType | false FuelIcon Custom icon, or false to hide it.
locale string runtime locale Number formatting locale.