A minimal example showing how to use Comark with Svelte and Vite.
src/App.svelte
<script lang="ts">
  import { Comark } from '@comark/svelte'
  import Alert from './components/Alert.svelte'

  const markdown = `
# Hello *World*

::alert{type="info"}
This is an alert!
::
`
</script>

<Comark markdown={markdown} components={{ Alert }} />

This example demonstrates the simplest way to use Comark with Svelte - use the Comark component and pass it markdown content. The component handles parsing and rendering automatically using Svelte 5's $state and $effect runes.

Copyright © 2026