Skip to content
Focsd homeFocsd homeFocsd
Forms

Reasoning

A collapsed disclosure for the model’s reasoning, closed by default and never announced.

  • Tag: focsd-reasoning
  • Pattern: Disclosure
  • Category: AI

Example

HTML
<focsd-reasoning
text="The question needs the docs, so search them first."></focsd-reasoning>

Usage

Import the module once, then use the tag like any HTML element. Every framework below renders the same element; see Frameworks for setup.

<script type="module">
import '@focsd-dev/ai';
</script>
<focsd-reasoning text="The question needs the docs, so search them first."></focsd-reasoning>

API

Attributes

AttributePropertyTypeDefault
texttextstring—
streamingstreamingbooleanfalse
openopenbooleanfalse

Events

EventDescription
toggleFired when it opens or closes. Like <details>, it does not bubble.

CSS parts

Style the inside of the component with ::part(), for example focsd-reasoning::part(summary).

PartDescription
summaryThe button that opens and closes it.
bodyThe reasoning text.

Accessibility

  • A disclosure button named "Reasoning", or "Reasoning…" while it streams. It is collapsed by default.
  • Its text is plain text and is never announced as it arrives.
  • It fires the toggle event when it opens or closes, like <details>, and does not bubble.

Keyboard

KeyAction
Enter / SpaceOpen or close the reasoning