---
title: Transaction
description: Primitives for displaying transaction details
component: true
wagmi:
  link: https://wagmi.sh/react/hooks/useTransaction
---

<ComponentPreview
  name="transaction-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 transaction
```

</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="transaction" />

</Steps>

</TabsContent>

</Tabs>

## Usage

```tsx
import {
  TransactionBlockHash,
  TransactionBlockNumber,
  TransactionFrom,
  TransactionGas,
  TransactionGasPrice,
  TransactionNonce,
  TransactionTo,
} from "@/registry/default/buidl/transaction"
```

```tsx
<TransactionFrom hash={hash} />
<TransactionTo hash={hash} />
<TransactionBlockHash hash={hash} />
<TransactionBlockNumber hash={hash} />
<TransactionGas hash={hash} />
<TransactionGasPrice hash={hash} />
<TransactionNonce hash={hash} />
```
