---
title: "JSON viewer | Free React & Tailwind Agents Component | Motion UI"
canonical: "https://blacknest.dev/motion/c/agents/json-viewer"
github_source: "https://github.com/Rkj0123/motion-ui-skill/blob/main/components/agents/json-viewer.tsx"
install_command: "npx motion-ui-skill add json-viewer"
dependencies: ["clsx","lucide-react","motion","react","tailwind-merge"]
category: "agents"
subcategory: "agents"
---

# JSON viewer

> A collapsible JSON tree with search, paging for long arrays, and copy value or path.

## Install

```bash
npx motion-ui-skill add json-viewer
```

## Dependencies

- `clsx`
- `lucide-react`
- `motion`
- `react`
- `tailwind-merge`

## Usage

```tsx
"use client";

import { JsonViewer as JsonViewer } from "@/components/agents/json-viewer";

export function Example() {
  return (
    <div className="p-6">
      <JsonViewer />
    </div>
  );
}
```

## Source Files

- [components/agents/json-viewer.tsx](https://github.com/Rkj0123/motion-ui-skill/blob/main/components/agents/json-viewer.tsx)
- [components/agents/json-viewer.module.css](https://github.com/Rkj0123/motion-ui-skill/blob/main/components/agents/json-viewer.module.css)
- [lib/utils.ts](https://github.com/Rkj0123/motion-ui-skill/blob/main/lib/utils.ts)
- [lib/motion-tokens.ts](https://github.com/Rkj0123/motion-ui-skill/blob/main/lib/motion-tokens.ts)
