# Schema Display Body Example

> Example implementation of schema display-body.

A shadcn/ui block from the [@ai-elements](https://ai-sdk.dev/elements) registry, listed on [shadcn.exchange](https://shadcn.exchange/r/ai-elements/example-schema-display-body).

- Page, with a live preview: https://shadcn.exchange/r/ai-elements/example-schema-display-body
- Screenshot: https://abzjhwgwpdpz7ua5.public.blob.vercel-storage.com/shots/ai-elements/example-schema-display-body-light-5d4d5265a0534742.png
- Registry item: https://ai-sdk.dev/elements/api/registry/example-schema-display-body.json
- Listed: 2026-10-13, source last changed 2026-10-13

## Install

```bash
npx shadcn@latest add https://ai-sdk.dev/elements/api/registry/example-schema-display-body.json
```

Run it in a project that has shadcn/ui set up. It adds the files below and installs what they depend on.

## Dependencies

- Registry items: `https://elements.ai-sdk.dev/schema-display.json`

## Files

### `registry/default/examples/schema-display-body.tsx`

```tsx
"use client";

import { SchemaDisplay } from "@/components/ai-elements/schema-display";

const Example = () => (
  <SchemaDisplay
    method="POST"
    path="/api/posts"
    requestBody={[
      { name: "title", required: true, type: "string" },
      { name: "content", required: true, type: "string" },
    ]}
    responseBody={[
      { name: "id", required: true, type: "string" },
      { name: "createdAt", required: true, type: "string" },
    ]}
  />
);

export default Example;
```
