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
Installation
Section titled “Installation”npx shadcn@latest add @0xui/gas-pricepnpm dlx shadcn@latest add @0xui/gas-priceyarn dlx shadcn@latest add @0xui/gas-pricebunx --bun shadcn@latest add @0xui/gas-priceimport { GasPrice } from "@/components/gas-price";
<GasPrice />;Examples
Section titled “Examples”With thresholds
Section titled “With thresholds”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. |
