Skip to content

Reasoning Accordion

A copy-paste ai / chat ui component in pure HTML & CSS. Zero dependencies, framework-agnostic, MIT-licensed.

AI / Chat UIHTMLCSSany framework
Thought for 4s

Checking the user's timezone before suggesting a meeting slot, then cross-referencing calendar availability.

Copy into your project

HTML
<!-- Reasoning Accordion — collapsible "thinking" trace -->
<details class="nuda-ac2-reason" open>
  <summary class="nuda-ac2-reason__summary">
    <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
         stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
      <path d="M9 18 L15 18 M10 21 L14 21 M12 3 A 6 6 0 0 1 15.5 13.8 L14.5 15 L9.5 15 L8.5 13.8 A 6 6 0 0 1 12 3 Z" />
    </svg>
    <span class="nuda-ac2-reason__title">Thought for 4s</span>
    <svg class="nuda-ac2-reason__chevron" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
         stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
      <path d="M6 9 L12 15 L18 9" />
    </svg>
  </summary>
  <div class="nuda-ac2-reason__body">
    <p class="nuda-ac2-reason__p">Checking the user's timezone before suggesting a meeting slot, then cross-referencing calendar availability.</p>
  </div>
</details>
CSS
.nuda-ac2-reason {
  width: 300px;
  padding: 2px;
  background: #141414;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px;
  box-sizing: border-box;
  font: 12px ui-sans-serif,system-ui,sans-serif;
}

.nuda-ac2-reason__summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  color: #a1a1aa;
  min-height: 22px;
}

.nuda-ac2-reason__summary::-webkit-details-marker {
  display: none;
}

.nuda-ac2-reason__summary svg {
  width: 14px;
  height: 14px;
  flex: none;
}

.nuda-ac2-reason__title {
  color: #cfcfcf;
  font-style: italic;
}

.nuda-ac2-reason__chevron {
  margin-left: auto;
  transition: transform .2s ease;
}

.nuda-ac2-reason[open] .nuda-ac2-reason__chevron {
  transform: rotate(180deg);
}

.nuda-ac2-reason__body {
  padding: 0 10px 10px 32px;
  animation: _nuda-ac2reason .35s ease both;
}

.nuda-ac2-reason__p {
  margin: 0;
  color: #777;
  line-height: 1.5;
  font-size: 11px;
}

@keyframes _nuda-ac2reason {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .nuda-ac2-reason__body {
    animation: none !important;
  }
  .nuda-ac2-reason__chevron {
    transition: none;
  }
}

How to use Reasoning Accordion

Paste the HTML where you need it and the CSS into a global stylesheet (or a <style> tag). Every class is prefixed nuda- so it never collides with Tailwind or your own styles. Tweak the CSS custom properties to match your design system.

Works in React, Vue, Svelte, Astro, Next.js, Nuxt, Laravel Blade, Django, Rails — or a single .html file. No npm install, no build step.

More ai / chat ui components

← Browse all NudaUI components