Stream
VerifiedStreamdown-style streaming markdown: only the growing block re-renders, and output is safe by default.
When to use
- Use when
- Showing model output as it streams in, with safe links, images off by default, and highlighted code.
- Avoid when
- Authoring rich text; use an editor.
Installation
The source lands in src/components/ui/stream.tsx, along with any Shelf items it builds on, and .shelf/lock.json records what was installed. It's yours to edit.
Usage
Built on
- Packages
@stylexjs/stylex,marked,remend- Shelf items
- Code Block,
foundations,utils - Figma
- Optional native Figma library. See Designers.
Verified
- Size
- 5.0 kB gzipped on its own, 327 kB with the Shelf items and packages it builds on. JS and CSS in a production build, without React.
- Accessibility
- Axe passes on 8 stories
- Behavior
- 5 interaction tests in Storybook
- Rendering
- Parent re-renders skip its consumers
- React Compiler
- Compiles with React Compiler
- React Doctor
- React Doctor finds nothing