# Disclosure

> "More options" over rarely needed form fields, built on native details/summary.

- Group: Forms
- Status: stable
- Aliases: more-options, details
- HTML page: https://design.ipmnx.com/components/disclosure/
- Spec: https://design.ipmnx.com/design/#nx-disclosure

## Preview

**More options in a side sheet**

```html
<details class="nx-disclosure">
  <summary class="nx-disclosure__summary">More options</summary>
  <div class="nx-disclosure__body">
    <label class="nx-field">
      <span class="nx-field__label">Audience</span>
      <input class="nx-field__input">
    </label>
  </div>
</details>
```

```tsx
<NxDisclosure summary="More options" defaultOpen={hasAudience}>
  <NxField label="Audience" />
</NxDisclosure>
```

## API

### React props (NxKit)

| Prop | Type | Default | Required | Description |
| --- | --- | --- | --- | --- |
| `summary` | `ReactNode` |   | yes | The toggle text. |
| `defaultOpen` | `boolean` | `false` |   | Open when a hidden field has a value. |

### Classes

| Class | Description |
| --- | --- |
| `.nx-disclosure` | details element |
| `.nx-disclosure__summary` | Accent toggle with a rotating caret |

## Accessibility

- Native details/summary: keyboard and screen-reader support built in, works without JS.

## Do / Don't

- Do: Open by default when a hidden field already holds a value.
- Don't hide required fields.

## Related

- [Field](https://design.ipmnx.com/components/field.md)
- [Drawer](https://design.ipmnx.com/components/drawer.md)

---

Source: registry.js (NX Design System)
