> ## Documentation Index
> Fetch the complete documentation index at: https://docs.holydocs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Expandable

Collapsible section for nested API fields, keeping complex response shapes readable.

**Interactive playground** For isolated previews, theme switching, and sandbox editing, open [the Expandable playground on holydocs.com](https://holydocs.com/components/expandable).

## When to use

Use this component when endpoint documentation needs explicit request, response, schema, or lifecycle metadata.

## Live Examples

Every example below renders the real component directly inside HolyDocs, followed by the exact MDX you can paste into a page.

### Nested Fields

Expandable with nested response field definitions.

**user**

The authenticated user who created the project.
  **user fields**

**id**

Unique user identifier.
    **email**

Primary email address of the user.
    **name**

Display name of the user.

~~~mdx
<ResponseField name="user" type="object">
  The authenticated user who created the project.
  <Expandable title="user fields">
    <ResponseField name="id" type="string">
      Unique user identifier.
    </ResponseField>
    <ResponseField name="email" type="string">
      Primary email address of the user.
    </ResponseField>
    <ResponseField name="name" type="string">
      Display name of the user.
    </ResponseField>
  </Expandable>
</ResponseField>
~~~

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `title` | `string` | `Show fields` | Label on the collapsed toggle. |

## Usage

Start from this baseline shape and then tailor the copy, data, or nesting to the page you are writing.

~~~mdx
<ResponseField name="user" type="object">
  The authenticated user who created the project.
  <Expandable title="user fields">
    <ResponseField name="id" type="string">
      Unique user identifier.
    </ResponseField>
    <ResponseField name="email" type="string">
      Primary email address of the user.
    </ResponseField>
    <ResponseField name="name" type="string">
      Display name of the user.
    </ResponseField>
  </Expandable>
</ResponseField>
~~~

## Tips

- Keep naming and ordering consistent across fields, examples, and lifecycle notes so readers do not have to re-parse the endpoint surface on every page.
- Document the happy path and the sharp edges together. Request shape alone is not enough without auth, errors, and retry guidance.
- If a component renders into the right panel, verify the page on desktop width so you can confirm the supporting example is visible where readers expect it.

## Related Components

**[ParamField](/components/param-field)**

Documents a request parameter — path, query, or body — with type, requirement status, and description.
**[ResponseField](/components/response-field)**

Documents a field in an API response body with its name, type, and description.
**[RequestExample](/components/request-example)**

Pin request code examples in the right-side panel alongside API endpoint documentation.

## More

- Interactive playground: [Expandable on holydocs.com](https://holydocs.com/components/expandable)
- Component library index: [/components](/components)