Skip to content
kitn AI/UI

Markdown

kai-markdown

Turns text into formatted prose with highlighted code, outside a framework tree.

  • 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/web-components';
await customElements.whenDefined('kai-markdown');
const md = document.getElementById('md');
md.content = '### Hello\nRenders **bold**, _italic_, and `code`.';
</script>
  • content: assign it in JavaScript; multiline strings don’t survive HTML attributes 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.

For dense contexts: cards, sidebar panels, tooltips.

No Shiki loads, so it suits raw terminal output or log lines.

PropertyTypeDefaultNotes
theme'auto'Color mode (`auto` follows prefers-color-scheme).
content''The markdown source.
proseSize'sm'Text and markdown sizing.
codeTheme'github-dark-dimmed'Shiki theme for fenced code blocks.
codeHighlighttrueSet false to render plain `pre` blocks, with no highlighter load.

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

Markdown