Skip to content

Disclosure

A native details/summary for optional settings most people skip, like "Advanced".

FormsServer-rendered

Examples

Advanced settings

Advanced

Only if the provider has no dynamic registration.

Example
<Disclosure summary="Advanced">
  <Field label="Client ID" hint="Only if the provider has no dynamic registration.">
    <Input name="client_id" mono />
  </Field>
</Disclosure>

Usage

Usage
import { Disclosure } from '@switchboard/ui'

<Disclosure summary="Advanced" open={Boolean(errors.client_id)}>…</Disclosure>

Props

Every component also takes mix, for css() and mixins applied after its own style.

Disclosure

Disclosure props
PropTypeDefaultDescription
summary*RemixNode–The always-visible toggle text.
openboolean–Start expanded, e.g. when a field inside has an error.

Also accepts every <details> attribute.

Accessibility

  • Native <details>: the summary is a button for assistive tech, toggles with Enter or Space, and works without JavaScript.
  • The chevron is decorative; the expanded state comes from the element.

Guidance

Do

  • Open it when a field inside has an error.
  • Keep the summary to one or two words.

Don’t

  • Hide fields most people need.
  • Nest disclosures.