---
title: ERC20 Decimals
description: Display the decimals of an ERC20 token.
component: true
wagmi:
  link: https://wagmi.sh/react/hooks/useContractRead
---

<ComponentPreview
  name="erc20-decimals-demo"
  className="[&_.preview>[data-orientation=vertical]]:sm:max-w-[70%]"
/>

## Installation

<Tabs defaultValue="cli">

<TabsList>
  <TabsTrigger value="cli">CLI</TabsTrigger>
  <TabsTrigger value="manual">Manual</TabsTrigger>
</TabsList>

<TabsContent value="cli">

```bash
npx buidl-cli@latest add erc20-decimals
```

</TabsContent>

<TabsContent value="manual">

<Steps>

<Step>Install the following components:</Step>

- [ErrorMessage](/docs/components/error-message)

<Step>Install the following shadcn/ui components:</Step>

- [Skeleton](https://ui.shadcn.com/docs/components/skeleton)

<Step>Copy and paste the following code into your project.</Step>

<ComponentSource name="erc20-decimals" />

</Steps>

</TabsContent>

</Tabs>

## Usage

```tsx
import { Erc20Decimals } from "@/registry/default/buidl/erc20/erc20-decimals"
```

```tsx
<Erc20Decimals
  address="0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"
  chainId={1}
/>
```
