Axon 911 Frontend DocsAxon 911 Frontend Docs
Axon 911 Frontend Docs
    Loading navigation…
U
User
Switch to light mode
  1. Components
  2. Response
  3. API and Development

Response

API and Development

View SourceOpens in a new tabSubmit IssueOpens in a new tab
Import Response, ResponseSize from @prepared911/ui/response.
PropTypeDefaultNotes
childrenstringrequiredThe Markdown source
labelsResponseLabelsrequiredCopy for links, code, tables and footnotes
streamingbooleanfalseTreat the source as a growing stream and complete unfinished Markdown
sizeResponseSizeDefaultCompact sets paragraphs and lists, and so their links, at Body Medium; use it inside a Reasoning
componentsComponents (react-markdown)Element overrides merged over the defaults; keep the object stable
classNamestringAppended after the generated classes
refRef<HTMLDivElement>The root element
ResponseLabels
FieldTypeUsed for
newTabLocalizedMessageAnnounced after a link that opens in a new tab
codeLocalizedMessageName of each code block and its scroll area
copyCodeLocalizedMessageName of a code block's copy control at rest
copiedCodeLocalizedMessageThe copy control once copied
copyCodeErrorLocalizedMessageThe copy control when the clipboard refused
tableLocalizedMessageName of each table's scroll area
footnotesLocalizedMessageName of the footnotes section
footnoteBackLocalizedMessageName of the link from a footnote back to its reference
Exports
Response and the types ResponseProps and ResponseLabels. Response shares its name with the global Fetch Response; import it from the package so the module scope shadows the global.
Dependencies
react-markdown ^9, remark-gfm ^4 and remend ^1.3, ordinary dependencies kept external by the build. See packages/ui/docs/decisions/0008-package-build.md.
Props
NameTypeDefaultDescription
childrenstring—The markdown source of the response. Data, not copy, so it is a plain string.
labelsResponseLabels—Copy for links, code blocks, tables and footnotes. Memoized blocks only redraw when a label's text changes.
classNamestring—Classes appended after the generated classes. Put overrides in @layer chroma.overrides.
componentsComponents—Element overrides merged over the default mapping. Pass a stable object (module-level or memoized): a new object redraws every block.
refRef<HTMLDivElement>—Ref to the root element.
sizeResponseSizeResponseSize.DefaultSize of the running text. Compact sets paragraphs and lists, and so the links in them, at Body Medium, which is the size of a Reasoning trigger.
streamingbooleanfalseTreats the source as a token stream that is still growing. Unfinished markdown (an unclosed **, a half-open code fence, a dangling link) is completed before it is parsed, so partial output draws without breaking the layout.
Storybook
Interactive examples and edge cases for this component are in Storybook.
DefaultOpens in a new tab
Previous
Response / Usage
Next
Response / Accessibility
On this page
ResponseLabels
Exports
Dependencies
Props
Storybook