Skip to content
kitn AI/UI

Markdown

kai-markdown

Turn a raw markdown string into rendered prose — headings, bold, italic, lists, blockquotes, and syntax-highlighted code fences — in any framework or plain HTML.

  • Shadow DOM
  • Shiki highlighting
  • 4 prose sizes
  • GFM support
  • Highlight on/off

Set content in JavaScript with your markdown string:

<kai-markdown id="md"></kai-markdown>
<script type="module">
import '@kitn.ai/ui/elements';
const md = document.getElementById('md');
md.content = '### Hello\nRenders **bold**, _italic_, and `code`.';
</script>
  • content — assign it in JavaScript; HTML attributes don’t support multiline strings cleanly.
  • prose-size — scales body text: xs, sm (default), base, lg. Use sm in message bubbles, base/lg for doc pages.
  • code-theme — defaults to github-dark-dimmed; any Shiki theme works.
  • code-highlight="false" — skips Shiki entirely, rendering code fences as plain monospace.

Headings, bold, italic, a list, a blockquote, and a syntax-highlighted TypeScript fence.

Ordered lists, unordered lists, blockquotes, and a fenced code block together — representative of typical model output.

prose-size="xs" for dense contexts — cards, sidebar panels, or tooltips.

prose-size="lg" for standalone reading contexts — documentation pages or help articles.

code-highlight="false" renders code fences as plain monospace — no Shiki loads, ideal for raw terminal output or log lines.

PropertyTypeDefaultNotes
content '' The markdown source to render.
proseSize 'sm' Text/markdown sizing.
codeTheme 'github-dark-dimmed' Shiki theme for fenced code blocks.
codeHighlight true Disable syntax highlighting (no Shiki loads).

This element wraps these SolidJS components — reach for them directly when you need finer control than the props expose.

Markdown