Skip to content

Disclosure

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

View as Markdown

Preview

More options in a side sheet

More options
<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>

API

React props (NxKit)

React (NxKit) props
PropTypeDefaultRequiredDescription
summaryReactNodeRequiredThe toggle text.
defaultOpenbooleanfalseOpen when a hidden field has a value.

Classes

Framework-agnostic classes
ClassDescription
.nx-disclosuredetails element
.nx-disclosure__summaryAccent 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.

View in spec