Markdown
Zero-dependency markdown subset with stream throttling for assistant text.
Installation
Every AI component page installs the same aggregate @constructive/ai entry. Examples use the default @/components/ui alias; use your configured ui alias if it differs.
components.json
{
"registries": {
"@constructive": "https://constructive-io.github.io/blocks/r/{name}.json"
}
}Install aggregate
pnpm dlx shadcn@latest add @constructive/aiWhen to use
- Use Markdown for assistant prose that may stream.
- Prefer a host marked and DOMPurify pipeline when you need full GFM tables.
Usage
example.tsx
tsx
import { Markdown } from '@/components/ui/ai';
<Markdown streaming={streaming}>{text}</Markdown>API
Primary props for this surface. The installed source types are the full contract.
| Prop | Type | Behavior |
|---|---|---|
| children | string | Markdown source. |
| streaming | boolean | Throttles re-renders while true. |