Skip to content
tcpsystemsui

Theme

Colour scheme
Accent
Density
Radius
Esc

Markdown

Safe Markdown subset with explicit escaped or rejected raw HTML.

beta

Try it

Release notes

Version 2.4 adds streaming responses.

Svelte
<Markdown source="## Release notes

Version **2.4** adds *streaming* responses." />

Examples

Basic

Release notes

Version 2.4 adds streaming responses and fixes two bugs.

  • Faster cold starts
  • New --dry-run flag
  • Fixed pagination on the runs list
Basic.svelte
<script lang="ts">
	import Markdown from '@tcpsystems/ui/foundation/Markdown';
	const source = `## Release notes

Version **2.4** adds *streaming* responses and fixes two bugs.

- Faster cold starts
- New \`--dry-run\` flag
- Fixed pagination on the runs list`;
</script>

<Markdown {source} />

Getting started

Install the package, then read the component guide.

pnpm add @tcpsystems/ui

1. Import a component 2. Render it 3. Ship

Code and links.svelte
<script lang="ts">
	import Markdown from '@tcpsystems/ui/foundation/Markdown';
	const source = `### Getting started

Install the package, then read the [component guide](https://ui.tcp.systems).

\`\`\`bash
pnpm add @tcpsystems/ui
\`\`\`

1. Import a component
2. Render it
3. Ship`;
</script>

<Markdown {source} />

Raw html

User comment with <b>raw HTML</b> is shown as text, not rendered.

Raw html.svelte
<script lang="ts">
	import Markdown from '@tcpsystems/ui/foundation/Markdown';
	const source = `User comment with <b>raw HTML</b> is shown as text, not rendered.`;
</script>

<Markdown {source} rawHtml="escape" />

Live

Write a status update for the team.

  • Shipped the gateway
  • Next: docs
Live.svelte
<script lang="ts">
	import Markdown from '@tcpsystems/ui/foundation/Markdown';
	import Textarea from '@tcpsystems/ui/foundation/Textarea';
	const uid = $props.id();
	let source = $state('Write a **status update** for the team.\n\n- Shipped the gateway\n- Next: docs');
</script>

<Textarea id="{uid}-source" aria-label="Markdown source" bind:value={source} rows={5} />
<Markdown {source} />

API

Import
import Markdown from '@tcpsystems/ui/foundation/Markdown';
PropTypeDefault
sourcestringnone
rawHtml?'escape' | 'reject''escape'
HookKind
.tcp-proseRoot class