Skip to content

Collapsible

Stable

A heading with an arrow that shows or hides extra content when pressed.

Also known as disclosure, expander, details, show more

Install with npm install @tattva/ui (setup), or copy the code from the kit in Downloads.

Closed by default

The heading can hold more than words, like a count or a badge.

When to use it

Hides detail that most people do not need at first behind a heading they can press. The arrow turns to show whether it is open.

Made of: Arrow · Heading · Hidden section

Use it for

  • Advanced options under a simpler form.
  • Long detail, such as logs or notes, that would crowd the page.
  • Your own expandable section when ThinkingBlock or ToolCallCard do not fit.

Not for

  • The assistant's reasoning: use ThinkingBlock.
  • One step the assistant took, with its status: use ToolCallCard.
  • Content that most people need to read.

Do and avoid

Do. Extra settings most people skip stay out of the way.
Avoid. A deadline hidden under More details is easy to miss.

Do

  • Make the heading say what is inside, like Sources or Full output.
  • Use it to tuck away extra detail that would make the page long.
  • Add space inside the hidden section yourself.

Avoid

  • Do not hide anything a person must act on.
  • Do not put buttons inside the heading. The whole heading is one button.
  • Do not stack many of them when tabs or a table would be clearer.

On a phone

  • The whole header row is the button, so the tap target is the full width. On touch screens its tap area is at least 44px tall.
  • It opens by tap and has no hover state, so it works the same on a phone.
  • The content grows open in place and pushes the page down, with no scrolling area of its own.

Build your next AI screen with Tattva.

Free and open, with the code. Start in one line.

Get started